2 * $Id: script.h,v 1.2 2007/07/22 13:35:20 khansen Exp $
4 * Revision 1.2 2007/07/22 13:35:20 khansen
5 * convert tabs to whitespaces
7 * Revision 1.1 2004/06/30 07:56:42 kenth
13 * (C) 2004 Kent Hansen
15 * The XORcyst is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * The XORcyst is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with The XORcyst; if not, write to the Free Software
27 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
34 * The possible kinds of command.
36 enum tag_xlnk_command_type
{
47 typedef enum tag_xlnk_command_type xlnk_command_type
;
50 * A list of command arguments
52 struct tag_xlnk_command_arg
56 struct tag_xlnk_command_arg
*next
;
59 typedef struct tag_xlnk_command_arg xlnk_command_arg
;
64 struct tag_xlnk_script_command
{
65 xlnk_command_type type
;
66 xlnk_command_arg
*first_arg
;
68 struct tag_xlnk_script_command
*next
;
71 typedef struct tag_xlnk_script_command xlnk_script_command
;
76 struct tag_xlnk_script
{
78 xlnk_script_command
*first_command
;
81 typedef struct tag_xlnk_script xlnk_script
;
83 /** Signature for procedure to process a script command */
84 typedef void (*xlnk_script_commandproc
)(xlnk_script
*, xlnk_script_command
*, void *);
87 * Structure that represents a mapping from script command type to processor function.
89 struct tag_xlnk_script_commandprocmap
{
90 xlnk_command_type type
;
91 xlnk_script_commandproc proc
;
94 typedef struct tag_xlnk_script_commandprocmap xlnk_script_commandprocmap
;
96 /* Function prototypes */
98 int xlnk_script_parse(const char *, xlnk_script
*);
99 void xlnk_script_finalize(xlnk_script
*);
100 int xlnk_script_length(xlnk_script
*);
101 xlnk_script_command
*xlnk_script_get_command(xlnk_script
*, int);
102 void xlnk_script_walk(xlnk_script
*, xlnk_script_commandprocmap
*, void *);
103 const char *xlnk_script_get_command_arg(xlnk_script_command
*, const char *);
104 const char *xlnk_script_command_type_to_string(xlnk_command_type
);
105 int xlnk_script_count_command_type(xlnk_script
*, xlnk_command_type
);
107 #endif /* !XLNK_SCRIPT_H */