quakeforge/include/QF/cbuf.h
Bill Currie ad6e025a91 take cmd.[ch] back to basics. the gib code is temporarily gone pending
renovations. cmd_source handling is a little hacky in nq, but it's working.
2002-07-31 05:19:03 +00:00

70 lines
1.7 KiB
C

/*
#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
$Id$
*/
#ifndef __QF_cbuf_h
#define __QF_cbuf_h
#include "QF/qtypes.h"
typedef struct cbuf_args_s {
int argc;
struct dstring_s **argv;
const char **args;
int argv_size;
} cbuf_args_t;
typedef struct cbuf_s {
struct dstring_s *buf;
struct dstring_s *line;
cbuf_args_t *args;
void (*extract_line) (struct cbuf_s *cbuf);
void (*parse_line) (struct cbuf_s *cbuf);
qboolean wait;
} cbuf_t;
extern cbuf_t *cbuf_active;
extern const char *com_token;
const char *COM_Parse (const char *data);
void COM_TokenizeString (const char *str, cbuf_args_t *args);
cbuf_args_t *Cbuf_ArgsNew (void);
void Cbuf_ArgsDelete (cbuf_args_t *);
void Cbuf_ArgsAdd (cbuf_args_t *args, const char *arg);
cbuf_t *Cbuf_New (void);
void CBuf_Delete (cbuf_t *cbuf);
void Cbuf_AddText (cbuf_t *cbuf, const char *text);
void Cbuf_InsertText (cbuf_t *cbuf, const char *text);
void Cbuf_Execute (cbuf_t *cbuf);
void Cbuf_Execute_Sets (cbuf_t *cbuf);
#endif//__QF_cbuf_h