diff options
Diffstat (limited to 'swigweb/tutorial')
-rwxr-xr-x | swigweb/tutorial/example_wrap.html | 176 | ||||
-rwxr-xr-x | swigweb/tutorial/example_wrap_perl5.html | 37 | ||||
-rwxr-xr-x | swigweb/tutorial/example_wrap_tcl.html | 36 |
3 files changed, 0 insertions, 249 deletions
diff --git a/swigweb/tutorial/example_wrap.html b/swigweb/tutorial/example_wrap.html deleted file mode 100755 index 511200277..000000000 --- a/swigweb/tutorial/example_wrap.html +++ /dev/null @@ -1,176 +0,0 @@ -<html> -<head> </head> -<body BGCOLOR="#FFFFFF"> -<tt> <pre> - -/* - * File : example_wrap.c - * Thu Apr 4 13:11:45 1996 - * - * This file was automatically generated by : - * Simplified Wrapper and Interface Generator (SWIG) - * - * Copyright (c) 1995,1996 - * The Regents of the University of California and - * The University of Utah - * - */ - -/* Implementation : TCL */ - -#define INCLUDE_TCL <tcl.h> -#define INCLUDE_TK <tk.h> -#include INCLUDE_TCL -#include <string.h> -#include <stdlib.h> -static void _swig_make_hex(char *_c, void *_ptr, char *type) { -static char _hex[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', - 'a', 'b', 'c', 'd', 'e', 'f' }; - unsigned long _p,_s; - char _result[128], *_r; - _r = _result; - _p = (unsigned long) _ptr; - if (_p > 0) { - while (_p > 0) { - _s = _p & 0xf; - *(_r++) = _hex[_s]; - _p = _p >> 4; - } - *_r = '_'; - while (_r >= _result) *(_c++) = *(_r--); - } else { - strcpy(_c,"NULL"); - } - if (_ptr) strcpy(_c,type); -} -static char *_swig_get_hex(char *_c, void **ptr, char *_t) { - unsigned long _p; - char *_tt; - _p = 0; - if (*_c == '_') { - _c++; - while (*_c) { - if ((*_c >= '0') && (*_c <= '9')) _p = (_p << 4) + (*_c - '0'); - else if ((*_c >= 'a') && (*_c <= 'f')) _p = (_p << 4) + ((*_c - 'a') + 10); - else break; - _c++; - } - if (_p == 0) { - return (char *) _c; - } - _tt = _c; - if (_t) { - if (strcmp(_c,_t)) return _tt; - } - *ptr = (void *) _p; - return (char *) 0; - } else { - if (strcmp(_c,"NULL") == 0) { - *ptr = (void *) 0; - return (char *) 0; - } - else - return _c; - } -} - -#define SWIG_init Wrap_Init - - - - -/* A TCL_AppInit() function that lets you build a new copy - * of tclsh. - * - * The macro WG_init contains the name of the initialization - * function in the wrapper file. - */ - -#ifndef SWIG_RcFileName -char *SWIG_RcFileName = "~/.myapprc"; -#endif - -#if TCL_MAJOR_VERSION == 7 && TCL_MINOR_VERSION >= 4 -int main(int argc, char **argv) { - - Tcl_Main(argc, argv, Tcl_AppInit); - return(0); - -} -#else -extern int main(); -#endif - -int Tcl_AppInit(Tcl_Interp *interp){ - int SWIG_init(Tcl_Interp *); /* Forward reference */ - - if (Tcl_Init(interp) == TCL_ERROR) - return TCL_ERROR; - - /* Now initialize our functions */ - - if (SWIG_init(interp) == TCL_ERROR) - return TCL_ERROR; - - tcl_RcFileName = SWIG_RcFileName; - return TCL_OK; -} - -extern double My_variable; -extern int fact(int ); -extern int mod(int ,int ); -extern char * get_time(); -int _wrap_tcl_fact(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) { - int _result; - int _arg0; - - if (argc != 2) { - Tcl_SetResult(interp, "Wrong # args int : fact n ",TCL_STATIC); - return TCL_ERROR; - } - _arg0 = (int ) atol(argv[1]); - _result = fact(_arg0); - sprintf(interp->result,"%ld", (long) _result); - return TCL_OK; -} -int _wrap_tcl_mod(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) { - int _result; - int _arg0; - int _arg1; - - if (argc != 3) { - Tcl_SetResult(interp, "Wrong # args int : mod x y ",TCL_STATIC); - return TCL_ERROR; - } - _arg0 = (int ) atol(argv[1]); - _arg1 = (int ) atol(argv[2]); - _result = mod(_arg0,_arg1); - sprintf(interp->result,"%ld", (long) _result); - return TCL_OK; -} -int _wrap_tcl_get_time(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) { - char * _result; - - if (argc != 1) { - Tcl_SetResult(interp, "Wrong # args char * : get_time ",TCL_STATIC); - return TCL_ERROR; - } - _result = get_time(); - Tcl_SetResult(interp, _result, TCL_VOLATILE); - return TCL_OK; -} -int Wrap_Init(Tcl_Interp *interp) { - if (interp == 0) - return TCL_ERROR; - Tcl_LinkVar(interp, "My_variable", (char *) &My_variable, TCL_LINK_DOUBLE); - Tcl_CreateCommand(interp, "fact", _wrap_tcl_fact, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "mod", _wrap_tcl_mod, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); - Tcl_CreateCommand(interp, "get_time", _wrap_tcl_get_time, (ClientData) NULL, (Tcl_CmdDeleteProc *) NULL); - return TCL_OK; -} - -</pre> </tt> </body> -</html> - - - diff --git a/swigweb/tutorial/example_wrap_perl5.html b/swigweb/tutorial/example_wrap_perl5.html deleted file mode 100755 index 29141a102..000000000 --- a/swigweb/tutorial/example_wrap_perl5.html +++ /dev/null @@ -1,37 +0,0 @@ -<HTML> -<HEAD> -<TITLE> -Simple Example</TITLE> -<BODY BGCOLOR="#ffffff"> -<H1>Simple Example</H1> -[ Module : swig, Package : swig ]<BR> - -<HR><H1> Contents </H1> -<UL><LI> <A HREF="#s1_">1. My Commands</A> -</UL> - -<A name="s1_"> -<HR><H2>1. My Commands</H2></A> -<P><TT><B>$My_variable</B></TT> -<BLOCKQUOTE>[ Global : double My_variable ] -<BR> This is an interesting variable -</BLOCKQUOTE> - -<P><TT><B>fact(n);</B></TT> -<BLOCKQUOTE>[ returns int ] -<BR> Computes n factorial -</BLOCKQUOTE> - -<P><TT><B>my_mod(x,y);</B></TT> -<BLOCKQUOTE>[ returns int ] -<BR> Calculates x % y -</BLOCKQUOTE> - -<P><TT><B>get_time();</B></TT> -<BLOCKQUOTE>[ returns char * ] -<BR> Returns the current time as a string -</BLOCKQUOTE> - - -</BODY> -</HTML> diff --git a/swigweb/tutorial/example_wrap_tcl.html b/swigweb/tutorial/example_wrap_tcl.html deleted file mode 100755 index ad3f4ce07..000000000 --- a/swigweb/tutorial/example_wrap_tcl.html +++ /dev/null @@ -1,36 +0,0 @@ -<HTML> -<HEAD> -<TITLE> -Simple Example</TITLE> -<BODY BGCOLOR="#ffffff"> -<H1>Simple Example</H1> - -<HR><H1> Contents </H1> -<UL><LI> <A HREF="#s1_">1. My Commands</A> -</UL> - -<A name="s1_"> -<HR><H2>1. My Commands</H2></A> -<P><TT><B>$My_variable</B></TT> -<BLOCKQUOTE>[ Global : double My_variable ] -<BR> This is an interesting variable -</BLOCKQUOTE> - -<P><TT><B>fact n </B></TT> -<BLOCKQUOTE>[ returns int ] -<BR> Computes n factorial -</BLOCKQUOTE> - -<P><TT><B>my_mod x y </B></TT> -<BLOCKQUOTE>[ returns int ] -<BR> Calculates x % y -</BLOCKQUOTE> - -<P><TT><B>get_time </B></TT> -<BLOCKQUOTE>[ returns char * ] -<BR> Returns the current time as a string -</BLOCKQUOTE> - - -</BODY> -</HTML> |