2002-08-02 04:07:25 +00:00
|
|
|
/*
|
|
|
|
#FILENAME#
|
|
|
|
|
|
|
|
#DESCRIPTION#
|
|
|
|
|
|
|
|
Copyright (C) 2002 #AUTHOR#
|
|
|
|
|
|
|
|
Author: #AUTHOR#
|
|
|
|
Date: #DATE#
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to:
|
|
|
|
|
|
|
|
Free Software Foundation, Inc.
|
|
|
|
59 Temple Place - Suite 330
|
|
|
|
Boston, MA 02111-1307, USA
|
2002-08-08 09:20:00 +00:00
|
|
|
|
|
|
|
$Id$
|
2002-08-02 04:07:25 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define GIB_DATA(buffer) ((gib_buffer_data_t *)(buffer->data))
|
|
|
|
|
|
|
|
typedef struct gib_buffer_data_s {
|
|
|
|
struct dstring_s *arg_composite;
|
2002-08-03 06:04:00 +00:00
|
|
|
struct dstring_s *current_token;
|
2002-08-07 06:17:50 +00:00
|
|
|
struct dstring_s *loop_program;
|
2002-08-28 08:00:35 +00:00
|
|
|
struct dstring_s *loop_data;
|
|
|
|
|
|
|
|
char *loop_var_p, *loop_list_p;
|
2002-08-03 06:04:00 +00:00
|
|
|
|
|
|
|
// Data for handling return values
|
|
|
|
struct {
|
2002-08-06 08:15:20 +00:00
|
|
|
qboolean waiting, available; // Return value states
|
2002-08-07 06:17:50 +00:00
|
|
|
struct dstring_s *retval; // Returned value
|
|
|
|
|
2002-08-06 08:15:20 +00:00
|
|
|
// Data saved by tokenizer/processor
|
2002-08-03 06:04:00 +00:00
|
|
|
unsigned int line_pos; // Position within line
|
|
|
|
unsigned int token_pos; // Position within token
|
2002-08-06 08:15:20 +00:00
|
|
|
qboolean cat; // Concatenate to previous token?
|
2002-08-07 06:17:50 +00:00
|
|
|
int noprocess; // Process tokens?
|
2002-08-06 08:15:20 +00:00
|
|
|
char delim; // delimiter of token
|
2002-08-07 06:17:50 +00:00
|
|
|
|
2002-08-03 06:04:00 +00:00
|
|
|
} ret;
|
|
|
|
|
2002-08-05 00:01:06 +00:00
|
|
|
struct hashtab_s *locals; // Local variables
|
|
|
|
|
2002-08-03 06:04:00 +00:00
|
|
|
enum {
|
|
|
|
GIB_BUFFER_NORMAL, // Normal buffer
|
|
|
|
GIB_BUFFER_LOOP, // Looping buffer
|
|
|
|
GIB_BUFFER_PROXY // Responsible for embedded command
|
|
|
|
} type;
|
2002-08-02 04:07:25 +00:00
|
|
|
} gib_buffer_data_t;
|
|
|
|
|
|
|
|
void GIB_Buffer_Construct (struct cbuf_s *cbuf);
|
|
|
|
void GIB_Buffer_Destruct (struct cbuf_s *cbuf);
|
2002-08-08 09:20:00 +00:00
|
|
|
|