[LON-CAPA-cvs] cvs: modules /TexConvert/tthperl Makefile.PL tthfunc.i tthperl.c tthperl.h tthperl.i

droeschl droeschl@source.lon-capa.org
Mon, 03 May 2010 00:24:45 -0000


droeschl		Mon May  3 00:24:45 2010 EDT

  Added files:                 
    /modules/TexConvert/tthperl	tthperl.i 

  Removed files:               
    /modules/TexConvert/tthperl	tthfunc.i 

  Modified files:              
    /modules/TexConvert/tthperl	Makefile.PL tthperl.c tthperl.h 
  Log:
  Mainly cosmetics. 
  - Since we're actually wrapping tthperl and not tthfunc the swig interface file tthfunc.i was replaced by
  tthperl.i. You need to call swig like this now: swig -perl5 -noproxy tthperl.i
  Makefile.PL was changed accordingly.
  This change should reduce confusion.
  - also the syntax was corrected, see http://www.swig.org/Doc1.3/Preprocessor.html#Preprocessor_nn2
  - tthperl.h got include guards and extern keywords was removed (declared functions aren't extern).
  - tthperl.c includes its header file.
  
  
Index: modules/TexConvert/tthperl/Makefile.PL
diff -u modules/TexConvert/tthperl/Makefile.PL:1.7 modules/TexConvert/tthperl/Makefile.PL:1.8
--- modules/TexConvert/tthperl/Makefile.PL:1.7	Thu Feb 27 20:31:25 2003
+++ modules/TexConvert/tthperl/Makefile.PL	Mon May  3 00:24:45 2010
@@ -16,7 +16,7 @@
      'NAME' => 'tth',            # Name of your module
      'LIBS' => [''],                 # Custom libraries (if any)
      'DEFINE' => '-O1 -D_GNU_SOURCE -DPERL_POLLUTE',    
-     'OBJECT' => 'tthfunc_wrap.o tthperl.o tthfunc.o ttmfunc.o'    # Object files
+     'OBJECT' => 'tthperl_wrap.o tthperl.o tthfunc.o ttmfunc.o'    # Object files
 );
 
 
Index: modules/TexConvert/tthperl/tthperl.c
diff -u modules/TexConvert/tthperl/tthperl.c:1.7 modules/TexConvert/tthperl/tthperl.c:1.8
--- modules/TexConvert/tthperl/tthperl.c:1.7	Fri Feb 28 21:03:57 2003
+++ modules/TexConvert/tthperl/tthperl.c	Mon May  3 00:24:45 2010
@@ -1,6 +1,7 @@
 #include <stdio.h>
 #include <malloc.h>
 #include <string.h>
+#include "tthperl.h"
 
 #define CHARLEN 1024*1024
 
Index: modules/TexConvert/tthperl/tthperl.h
diff -u modules/TexConvert/tthperl/tthperl.h:1.2 modules/TexConvert/tthperl/tthperl.h:1.3
--- modules/TexConvert/tthperl/tthperl.h:1.2	Sun May  2 21:53:17 2010
+++ modules/TexConvert/tthperl/tthperl.h	Mon May  3 00:24:45 2010
@@ -1,9 +1,14 @@
-extern char* tth(char* tex);
-extern char* ttherror();
-extern void  tthinit();
-extern int  tthoptions(char* args);
-extern char* ttm(char* tex);
-extern char* ttmerror();
-extern void  ttminit();
-extern int  ttmoptions(char* args);
-extern int  tthmessedup();
+#ifndef TTHPERL_H
+#define TTHPERL_H
+
+char* tth(char* tex);
+char* ttherror();
+void  tthinit();
+int  tthoptions(char* args);
+char* ttm(char* tex);
+char* ttmerror();
+void  ttminit();
+int  ttmoptions(char* args);
+int  tthmessedup();
+
+#endif

Index: modules/TexConvert/tthperl/tthperl.i
+++ modules/TexConvert/tthperl/tthperl.i
%module tth
%{
#include "tthperl.h"
%}
%include "tthperl.h"