quakeforge/libs/util
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
..
test [cexpr] Require designated initializers for exprtype_t 2022-04-24 17:31:17 +09:00
bsearch.c
bspfile.c [util] Make bsp_t counts size_t 2021-08-01 21:54:05 +09:00
buildnum.c
cbuf.c
cexpr-lex.l [cexpr] Add optional error message prefix string 2022-04-24 19:15:22 +09:00
cexpr-lib.c [cexpr] Add support for casting plitems 2021-12-24 06:45:13 +09:00
cexpr-parse.y [cexpr] Expose cexpr assignment 2022-04-24 19:15:22 +09:00
cexpr-type.c [cexpr] Allow assignment of double to float 2022-04-24 19:15:22 +09:00
cexpr-vars.c [cvar] Make cvars properly typed 2022-04-24 19:15:22 +09:00
checksum.c
cmd.c [cvar] Make cvars properly typed 2022-04-24 19:15:22 +09:00
cmem.c Fix some null pointer shenanigans 2022-03-31 00:25:22 +09:00
crc.c
cvar.c [cvar] Make cvars properly typed 2022-04-24 19:15:22 +09:00
dirent.c
dstring.c
fendian.c
fnmatch.c
getopt.c
getopt1.c
hash.c
heapsort.c [util] Add functions for binary heaps 2021-08-02 12:44:08 +09:00
idparse.c
info.c [util] Make hunk (optionally) thread-safe 2021-07-29 11:43:27 +09:00
link.c
llist.c
Makemodule.am [cexpr] Add a small library with some useful functions 2021-12-24 06:45:12 +09:00
math.S
mathlib.c [mathlib] Remove suspicious IS_NAN 2022-03-19 12:50:08 +09:00
mdfour.c
mersenne.c [util] Add mtwist float random number functions 2021-12-24 06:45:13 +09:00
msg.c [util] Write some tests for utf8 r/w 2021-07-27 23:29:14 +09:00
pakfile.c
plist.c [plist] Allow ` to be used without quotes 2021-12-24 06:45:12 +09:00
plugin.c [cvar] Make cvars properly typed 2022-04-24 19:15:22 +09:00
qargs.c [cvar] Make cvars properly typed 2022-04-24 19:15:22 +09:00
qendian.c
qsort_r.c
quakefs.c [cvar] Make cvars properly typed 2022-04-24 19:15:22 +09:00
quakeio.c
riff.c
script.c
segtext.c
set.c [util] Minimize set growth 2021-08-11 12:31:03 +09:00
simd.c [simd] Split out the ivec implementations 2022-01-02 16:02:57 +09:00
sizebuf.c [util] Make hunk (optionally) thread-safe 2021-07-29 11:43:27 +09:00
string.c
sys.c [cvar] Make cvars properly typed 2022-04-24 19:15:22 +09:00
sys_ia32.S
va.c
ver_check.c
wad.c
wadfile.c
zone.c [cvar] Make cvars properly typed 2022-04-24 19:15:22 +09:00