home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / mm.h < prev    next >
Encoding:
C/C++ Source or Header  |  2003-04-27  |  3.7 KB  |  116 lines

  1. /*
  2.  * mm.h --
  3.  *
  4.  *    This is the header file for the module that implements
  5.  *    command structure lookups.
  6.  *
  7.  * Copyright (c) 1997,1998 Jeffrey Hobbs
  8.  *
  9.  * See the file "license.terms" for information on usage and redistribution
  10.  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
  11.  *
  12.  */
  13.  
  14. #ifndef _MM_H_
  15. #define _MM_H_
  16.  
  17. #include <string.h>
  18. #include <stdlib.h>
  19. #include "tk.h"
  20.  
  21. /* Make sure this syncs with Makefile.in */
  22. #define MM_MAJOR_VERSION    1
  23. #define MM_MINOR_VERSION    0
  24. #define MM_RELEASE_SERIAL    0
  25. #define MM_VERSION        "1.0"
  26. #define MM_PATCH_LEVEL        "1.0.0"
  27.  
  28. /* Now we start defining package specific stuff */
  29.  
  30. #define MM_ERROR    0
  31. #define MM_VALUE    (1<<0)
  32. #define MM_PROC        (1<<1)
  33. #define MM_OBJPROC    (1<<2)
  34. #define MM_SUBPROC    (1<<3)
  35.  
  36. #define MM_LAST        (         NULL)
  37.  
  38. #define MM_OVERWRITE    (1<<0)
  39. #define MM_MERGE    (1<<1)
  40.  
  41. /* structure for use in parsing general major/minor commands */
  42. typedef struct {
  43.     char *name;        /* name of the command/value */
  44.     Tcl_CmdProc *proc;    /* >0 because 0 represents an error or proc */
  45.     int type;        /* whether it is proc or just value */
  46.     ClientData data;    /* optional clientData arg */
  47. } MajorMinor_Cmd;
  48.  
  49. extern int    MM_GetProcExact _ANSI_ARGS_((const MajorMinor_Cmd *cmds,
  50.                          const char *name,
  51.                          Tcl_CmdProc **proc));
  52. extern void    MM_GetError _ANSI_ARGS_((Tcl_Interp *interp,
  53.                      const MajorMinor_Cmd *cmds,
  54.                      const char *arg));
  55. extern int    MM_GetProc _ANSI_ARGS_((Tcl_Interp *interp,
  56.                     MajorMinor_Cmd *cmds,
  57.                     const char *arg,
  58.                     MajorMinor_Cmd **cmd));
  59. extern int    MM_HandleArgs _ANSI_ARGS_((ClientData clientData,
  60.                        Tcl_Interp *interp,
  61.                        MajorMinor_Cmd *cmds,
  62.                        int argc, Tcl_Obj **objv));
  63. extern int    MM_HandleCmds _ANSI_ARGS_((ClientData clientData,
  64.                        Tcl_Interp *interp,
  65.                        int argc, Tcl_Obj **objv));
  66. extern MajorMinor_Cmd *MM_InitCmds _ANSI_ARGS_((Tcl_Interp *interp, char *name,
  67.                      MajorMinor_Cmd *cmds,
  68.                      ClientData clientData, int flags));
  69. extern int    MM_InsertCmd _ANSI_ARGS_((Tcl_Interp *interp,
  70.                       MajorMinor_Cmd *cmds,
  71.                       const char *name,
  72.                       Tcl_CmdProc **proc,
  73.                       int type));
  74. extern int    MM_RemoveCmd _ANSI_ARGS_((Tcl_Interp *interp,
  75.                       MajorMinor_Cmd *cmds,
  76.                       const char *name));
  77.  
  78. EXTERN int    Majmin_Init _ANSI_ARGS_((Tcl_Interp *interp));
  79. EXTERN int    Majmin_SafeInit _ANSI_ARGS_((Tcl_Interp *interp));
  80. EXTERN int    Tcl_MajminCmd _ANSI_ARGS_((ClientData clientData,
  81.             Tcl_Interp *interp, int argc, Tcl_Obj **objv));
  82.  
  83. /* structure for use in parsing table commands/values */
  84. typedef struct {
  85.   char *name;        /* name of the command/value */
  86.   int value;        /* >0 because 0 represents an error or proc */
  87. } Cmd_Struct;
  88.  
  89. extern char *    Cmd_GetName _ANSI_ARGS_((const Cmd_Struct *cmds, int val));
  90. extern int    Cmd_GetValue _ANSI_ARGS_((const Cmd_Struct *cmds,
  91.                       Arg arg));
  92. extern void    Cmd_GetError _ANSI_ARGS_((Tcl_Interp *interp,
  93.                       const Cmd_Struct *cmds,
  94.                       Arg arg));
  95. extern int    Cmd_Parse _ANSI_ARGS_((Tcl_Interp *interp, Cmd_Struct *cmds,
  96.                        const char *arg));
  97.  
  98. extern int    Cmd_OptionSet _ANSI_ARGS_((ClientData clientData,
  99.                        Tcl_Interp *interp,
  100.                        Tk_Window unused, Arg  value,
  101.                        char *widgRec, int offset));
  102. extern Arg    Cmd_OptionGet _ANSI_ARGS_((ClientData clientData,
  103.                        Tk_Window unused, char *widgRec,
  104.                        int offset,
  105.                        Tcl_FreeProc **freeProcPtr));
  106. extern int    Cmd_BitSet _ANSI_ARGS_((ClientData clientData,
  107.                     Tcl_Interp *interp,
  108.                     Tk_Window unused, Arg value,
  109.                     char *widgRec, int offset));
  110. extern char *    Cmd_BitGet _ANSI_ARGS_((ClientData clientData,
  111.                     Tk_Window unused, char *widgRec,
  112.                     int offset,
  113.                     Tcl_FreeProc **freeProcPtr));
  114.  
  115. #endif /* _MM_H_ */
  116.