Commit Graph

17 Commits

Author SHA1 Message Date
Bill Currie 12c84046f3 [cvar] Make cvars properly typed
This is an extremely extensive patch as it hits every cvar, and every
usage of the cvars. Cvars no longer store the value they control,
instead, they use a cexpr value object to reference the value and
specify the value's type (currently, a null type is used for strings).
Non-string cvars are passed through cexpr, allowing expressions in the
cvars' settings. Also, cvars have returned to an enhanced version of the
original (id quake) registration scheme.

As a minor benefit, relevant code having direct access to the
cvar-controlled variables is probably a slight optimization as it
removed a pointer dereference, and the variables can be located for data
locality.

The static cvar descriptors are made private as an additional safety
layer, though there's nothing stopping external modification via
Cvar_FindVar (which is needed for adding listeners).

While not used yet (partly due to working out the design), cvars can
have a validation function.

Registering a cvar allows a primary listener (and its data) to be
specified: it will always be called first when the cvar is modified. The
combination of proper listeners and direct access to the controlled
variable greatly simplifies the more complex cvar interactions as much
less null checking is required, and there's no need for one cvar's
callback to call another's.

nq-x11 is known to work at least well enough for the demos. More testing
will come.
2022-04-24 19:15:22 +09:00
Bill Currie bc1b483525 Nuke the rcsid stuff.
It's pretty useless in git.
2012-04-22 10:56:32 +09:00
Bill Currie 3fb03fc2be hah, should have been using __attribute__((used)) all that time (rather
than __attribute__((unused))). fixes the missing console in -x11
2005-08-04 15:27:09 +00:00
Brian Koropoff e707e9bb89 Moved gib_*.h into include/ and moved the necessary declarations and struct
definitions to QF/gib.h to interface with libQFgib.
2003-04-13 22:07:58 +00:00
Brian Koropoff d8c0f50c11 The ultimate GIB bugfix commit, including reworked semantic processing,
a fix for arguments passed to a GIB function run via rcon, and various
other fixes.
2003-04-11 02:57:11 +00:00
Brian Koropoff ce80fffe69 Massive bug and memory leak fixing. 2003-02-26 07:44:34 +00:00
Brian Koropoff c9fbb334f1 Cleaned up the GIB parser and GIB_Execute() a lot. Made aliases work in
GIB.  Added some breakpoint GIB builtins for debugging script/intepreter
interactions.  Made carne work properly again (local variables don't
disappear in interactive mode)
2003-02-25 06:52:27 +00:00
Brian Koropoff af520a373a More cleanups and bug fixes. Added stem-and-leaf variables back in and
added the global::delete builtin.
2003-02-16 02:44:24 +00:00
Bill Currie c91137e4db run gib through indent 2003-02-14 22:42:11 +00:00
Brian Koropoff 3c522a83bc Various cleanups and bugfixes. Added proper line number reporting to
errors.  A few new builtin functions, such as slice::find and thread::list.
2003-02-14 08:06:01 +00:00
Brian Koropoff 4ee0c42dcc Made GIB var substitution use cvars as a last resort. 2003-01-30 20:43:57 +00:00
Brian Koropoff 59fbd48a81 Overhauled GIB to parse scripts in advance, among other design and language
changes.  There still remains some bugs to be squashed, a feature or two to
add, and some polishing to be done.  However, it seems to be in a workable
state.
2003-01-28 21:16:21 +00:00
Bill Currie 761a7546dd re-arrange things so __attribute__ and __builtin_expect are properly
autoconfiscated so rcsid will continue to work with gcc 3.3
2003-01-15 15:31:36 +00:00
Bill Currie 71196fedf6 make gcc more anal about prototypes, string constants and function
visibility (ie, global functions must have a prototype)
2003-01-06 18:28:13 +00:00
Brian Koropoff 0e0d8bd542 Added support for enclosing embedded commands in $() and cleaned up the
parser a bit to accomodate this.  Backslashes in double quotes are now only
removed if they escape a character that can't be written normally, or
another backslash.  Removed start position support from string::findsub
since variable slices can be used instead.  Added support for regular
expressions in the form of regex::match, regex::replace, and
regex::extract.  Checked in regex.c from GNU regex 0.12 for platforms that
do not have regex functions in their standard library. Two minor changes
were made to this file to fix gcc warnings.  Prepared the path transform
function for a change to a filesystem rooted at fs_userpath instead of the
current gamedir, but these changes are commented out pending security
considerations.
2002-11-19 04:15:36 +00:00
Brian Koropoff cef0d957e2 Added useful error messages to the math parser, cleaned up implied
multiplication a bit, and added some whitespace to cbuf errors for
readability.
2002-11-13 03:03:37 +00:00
Brian Koropoff b40400d59c Moved GIB into libs/gib and made util no longer depend on it. Cleaned up
some cruft from a previous incarnation of GIB.
2002-11-09 07:13:52 +00:00
Renamed from libs/util/gib_process.c (Browse further)