File: mm.h

package info (click to toggle)
libtk-tablematrix-perl 1.29-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,344 kB
  • sloc: ansic: 22,028; perl: 2,751; makefile: 2,132; sh: 16
file content (115 lines) | stat: -rw-r--r-- 3,686 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/* 
 * mm.h --
 *
 *	This is the header file for the module that implements
 *	command structure lookups.
 *
 * Copyright (c) 1997,1998 Jeffrey Hobbs
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 */

#ifndef _MM_H_
#define _MM_H_

#include <string.h>
#include <stdlib.h>
#include "tk.h"

/* Make sure this syncs with Makefile.in */
#define MM_MAJOR_VERSION	1
#define MM_MINOR_VERSION	0
#define MM_RELEASE_SERIAL	0
#define MM_VERSION		"1.0"
#define MM_PATCH_LEVEL		"1.0.0"

/* Now we start defining package specific stuff */

#define MM_ERROR	0
#define MM_VALUE	(1<<0)
#define MM_PROC		(1<<1)
#define MM_OBJPROC	(1<<2)
#define MM_SUBPROC	(1<<3)

#define MM_LAST		(         NULL)

#define MM_OVERWRITE	(1<<0)
#define MM_MERGE	(1<<1)

/* structure for use in parsing general major/minor commands */
typedef struct {
    char *name;		/* name of the command/value */
    Tcl_CmdProc *proc;	/* >0 because 0 represents an error or proc */
    int type;		/* whether it is proc or just value */
    ClientData data;	/* optional clientData arg */
} MajorMinor_Cmd;

extern int	MM_GetProcExact _ANSI_ARGS_((const MajorMinor_Cmd *cmds,
					     const char *name,
					     Tcl_CmdProc **proc));
extern void	MM_GetError _ANSI_ARGS_((Tcl_Interp *interp,
					 const MajorMinor_Cmd *cmds,
					 const char *arg));
extern int	MM_GetProc _ANSI_ARGS_((Tcl_Interp *interp,
					MajorMinor_Cmd *cmds,
					const char *arg,
					MajorMinor_Cmd **cmd));
extern int	MM_HandleArgs _ANSI_ARGS_((ClientData clientData,
					   Tcl_Interp *interp,
					   MajorMinor_Cmd *cmds,
					   int argc, Tcl_Obj *CONST *objv));
extern int	MM_HandleCmds _ANSI_ARGS_((ClientData clientData,
					   Tcl_Interp *interp,
					   int argc, Tcl_Obj *CONST *objv));
extern MajorMinor_Cmd *MM_InitCmds _ANSI_ARGS_((Tcl_Interp *interp, char *name,
					 MajorMinor_Cmd *cmds,
					 ClientData clientData, int flags));
extern int	MM_InsertCmd _ANSI_ARGS_((Tcl_Interp *interp,
					  MajorMinor_Cmd *cmds,
					  const char *name,
					  Tcl_CmdProc **proc,
					  int type));
extern int	MM_RemoveCmd _ANSI_ARGS_((Tcl_Interp *interp,
					  MajorMinor_Cmd *cmds,
					  const char *name));

EXTERN int	Majmin_Init _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN int	Majmin_SafeInit _ANSI_ARGS_((Tcl_Interp *interp));
EXTERN int	Tcl_MajminCmd _ANSI_ARGS_((ClientData clientData,
			Tcl_Interp *interp, int argc, Tcl_Obj *CONST *objv));

/* structure for use in parsing table commands/values */
typedef struct {
  char *name;		/* name of the command/value */
  int value;		/* >0 because 0 represents an error or proc */
} Cmd_Struct;

extern char *	Cmd_GetName _ANSI_ARGS_((const Cmd_Struct *cmds, int val));
extern int	Cmd_GetValue _ANSI_ARGS_((const Cmd_Struct *cmds,
					  Arg arg));
extern void	Cmd_GetError _ANSI_ARGS_((Tcl_Interp *interp,
					  const Cmd_Struct *cmds,
					  Arg arg));
extern int	Cmd_Parse _ANSI_ARGS_((Tcl_Interp *interp, Cmd_Struct *cmds,
				       const char *arg));

extern int	Cmd_OptionSet _ANSI_ARGS_((ClientData clientData,
					   Tcl_Interp *interp,
					   Tk_Window unused, Arg  value,
					   char *widgRec, int offset));
extern Arg	Cmd_OptionGet _ANSI_ARGS_((ClientData clientData,
					   Tk_Window unused, char *widgRec,
					   int offset,
					   Tcl_FreeProc **freeProcPtr));
extern int	Cmd_BitSet _ANSI_ARGS_((ClientData clientData,
					Tcl_Interp *interp,
					Tk_Window unused, Arg value,
					char *widgRec, int offset));
extern char *	Cmd_BitGet _ANSI_ARGS_((ClientData clientData,
					Tk_Window unused, char *widgRec,
					int offset,
					Tcl_FreeProc **freeProcPtr));

#endif /* _MM_H_ */