home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rexxtk12.zip / rexxtk.h < prev    next >
Text File  |  2002-08-07  |  5KB  |  147 lines

  1. /*
  2.  *  Rexx/Tk
  3.  *  Copyright (C) 1999       Roger O'Connor <ocon@metronet.com>
  4.  *  Copyright (C) 2000-2001  Mark Hessling  <M.Hessling@qut.edu.au>
  5.  *
  6.  *  This library is free software; you can redistribute it and/or
  7.  *  modify it under the terms of the GNU Library General Public
  8.  *  License as published by the Free Software Foundation; either
  9.  *  version 2 of the License, or (at your option) any later version.
  10.  *
  11.  *  This library is distributed in the hope that it will be useful,
  12.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  13.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  14.  *  Library General Public License for more details.
  15.  *
  16.  *  You should have received a copy of the GNU Library General Public
  17.  *  License along with this library; if not, write to the Free
  18.  *  Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  */
  20.  
  21. #include "rxpack.h"
  22.  
  23. #include <tk.h> 
  24. /*
  25.  * The following is to get around the Win32 ports of Tcl/Tk that have
  26.  * version numbers in their libraries. This is intended to make Rexx/Tk
  27.  * independent of this crap.
  28.  */
  29. #ifdef WIN32
  30. # define Tcl_CreateInterp  RexxTk_TclCreateInterp
  31. # define Tcl_DeleteInterp  RexxTk_TclDeleteInterp
  32. # define Tcl_Eval          RexxTk_TclEval
  33. # define Tcl_Init          RexxTk_TclInit
  34. # define Tk_Init           RexxTk_TkInit
  35. # define Tcl_FindExecutable RexxTk_TclFindExecutable
  36. extern Tcl_Interp *RexxTk_TclCreateInterp(void);
  37. extern int         RexxTk_TclDeleteInterp(Tcl_Interp *);
  38. extern int         RexxTk_TclEval(Tcl_Interp *, char *);
  39. extern int         RexxTk_TclInit(Tcl_Interp *);
  40. extern int         RexxTk_TkInit(Tcl_Interp *);
  41. extern void        RexxTk_TclFindExecutable(char *);
  42. typedef Tcl_Interp *TclCreateInterpType(void);
  43. typedef int         TclDeleteInterpType(Tcl_Interp *);
  44. typedef int         TclEvalType(Tcl_Interp *, char *);
  45. typedef int         TclInitType(Tcl_Interp *);
  46. typedef int         TkInitType(Tcl_Interp *);
  47. typedef void        TclFindExecutableType(char *);
  48. #endif
  49. /*
  50.  * Rexx/Tk error stuff and commonly shared memory for extension
  51.  * libraries
  52.  */
  53. typedef struct
  54. {
  55.    Tcl_Interp *RexxTkInterp;
  56.    int  REXXTK_IntCode;
  57.    char REXXTK_ErrMsg[256];
  58. #ifdef WIN32
  59.    TclCreateInterpType *Dyn_TclCreateInterp;
  60.    TclDeleteInterpType *Dyn_TclDeleteInterp;
  61.    TclEvalType *Dyn_TclEval;
  62.    TclInitType *Dyn_TclInit;
  63.    TkInitType *Dyn_TkInit;
  64.    TclFindExecutableType *Dyn_TclFindExecutable;
  65. #endif
  66. } REXXTKDATA;
  67.  
  68. #define TCLCOMMANDLEN 10240
  69.  
  70. void SetIntError(REXXTKDATA *,int, char *);
  71. void ClearIntError(REXXTKDATA *);
  72. int ReturnError( REXXTKDATA *,RXSTRING *, int,  char *);
  73. int rtk_procOptArgs(RFH_ARG0_TYPE name,char czCommand[], RFH_ARG1_TYPE argc, RFH_ARG2_TYPE argv, RFH_ARG1_TYPE start);
  74. int rtk_procOptArgArray(RFH_ARG0_TYPE name,char czCommand[], RFH_ARG2_TYPE argv, RFH_ARG1_TYPE start);
  75. int rtk_procOptArgIndirect(RFH_ARG0_TYPE name,char czCommand[], RFH_ARG1_TYPE argc, RFH_ARG2_TYPE argv, RFH_ARG1_TYPE start);
  76. int rtk_procOptArgDash(RFH_ARG0_TYPE name,char czCommand[], RFH_ARG1_TYPE argc, RFH_ARG2_TYPE argv, RFH_ARG1_TYPE start);
  77. char *rtk_quote(char string[]) ;
  78. /*
  79.  * Type A commands
  80.  * Tk form:
  81.  *   command pathName ?options?
  82.  * Rexx form:
  83.  *   TkCommand(pathName, [options...])
  84.  */
  85. RFH_RETURN_TYPE rtk_TypeA(REXXTKDATA *,char [],RFH_ARG0_TYPE,char *,RFH_ARG1_TYPE, RFH_ARG2_TYPE, RFH_ARG4_TYPE );
  86. /*
  87.  * Type B commands
  88.  * Tk form:
  89.  *   command arg ?arg arg ...?
  90.  * Rexx form:
  91.  *   TkCommand(arg, [arg, arg, ...])
  92.  */
  93. RFH_RETURN_TYPE rtk_TypeB(REXXTKDATA *,char [],RFH_ARG0_TYPE,char *,RFH_ARG1_TYPE, RFH_ARG2_TYPE, RFH_ARG4_TYPE);
  94. /*
  95.  * Type C commands
  96.  * Tk form:
  97.  *   pathName command ?arg arg ...?
  98.  * Rexx form:
  99.  *   TkCommand(pathName, [arg, arg, ...])
  100.  */
  101. RFH_RETURN_TYPE rtk_TypeC(REXXTKDATA *,char [],RFH_ARG0_TYPE,char *,RFH_ARG1_TYPE, RFH_ARG2_TYPE, RFH_ARG4_TYPE);
  102. /*
  103.  * Type D commands
  104.  * Tk form:
  105.  *   pathName command arg ?options?
  106.  * Rexx form:
  107.  *   TkCommand(pathName, arg, [options...])
  108.  */
  109. RFH_RETURN_TYPE rtk_TypeD(REXXTKDATA *,char [],RFH_ARG0_TYPE,char *,RFH_ARG1_TYPE, RFH_ARG2_TYPE, RFH_ARG4_TYPE );
  110. /*
  111.  * Type E commands
  112.  * Tk form:
  113.  *   pathName command ?options?
  114.  * Rexx form:
  115.  *   TkCommand(pathName, [options...])
  116.  */
  117. RFH_RETURN_TYPE rtk_TypeE(REXXTKDATA *,char [],RFH_ARG0_TYPE,char *,RFH_ARG1_TYPE, RFH_ARG2_TYPE, RFH_ARG4_TYPE);
  118. /*
  119.  * Type F commands
  120.  * Tk form:
  121.  *   command pathName ?pathName? ?options?
  122.  * or
  123.  *   command arg ?arg? ?options?
  124.  * Rexx form:
  125.  *   TkCommand(pathName [,pathName...] [options...])
  126.  * or
  127.  *   TkCommand(arg [,arg...] [options...])
  128.  */
  129. RFH_RETURN_TYPE rtk_TypeF(REXXTKDATA *,char [],RFH_ARG0_TYPE,char *,RFH_ARG1_TYPE, RFH_ARG2_TYPE, RFH_ARG4_TYPE);
  130. /*
  131.  * Type G commands
  132.  * Tk form:
  133.  *   command pathName arg ?options?
  134.  * Rexx form:
  135.  *   TkCommand(pathName, arg [,options...])
  136.  */
  137. RFH_RETURN_TYPE rtk_TypeG(REXXTKDATA *,char [],RFH_ARG0_TYPE,char *,RFH_ARG1_TYPE, RFH_ARG2_TYPE, RFH_ARG4_TYPE );
  138. /*
  139.  * Type H commands
  140.  * Tk form:
  141.  *   command ?options?
  142.  * Rexx form:
  143.  *   TkCommand([,options...])
  144.  */
  145. RFH_RETURN_TYPE rtk_TypeH(REXXTKDATA *,char [],RFH_ARG0_TYPE,char *,RFH_ARG1_TYPE, RFH_ARG2_TYPE, RFH_ARG4_TYPE );
  146.  
  147.