Commit Graph

13 Commits

Author SHA1 Message Date
Bill Currie 654b208641 [plist] Add functions to extend dictionaries and arrays
The idea is to make it easy (and efficient) to merge property list
items.
2023-03-15 19:47:30 +09:00
Bill Currie 7d4c1d79b1 [plist] Use reference counts for items
This makes it much easier to share items between property lists (eg,
targets and the main entity list in cl_light).
2023-03-13 11:26:13 +09:00
Bill Currie ea77df2daa [plist] Add parsing for bare dictionaries and arrays
Requiring top-level {} or () for (usually) hand-written files is awkward
and even a little error prone, and certainly ugly at times. With this,
loaders that expect a particular format can specify the format a little
more directly.
2023-03-12 14:31:17 +09:00
Bill Currie e57a06f37b [plist] Refactor the dictionary and array parsing
This makes it easier to reuse the code for parsing bare dictionaries and
arrays.
2023-03-12 12:27:45 +09:00
Bill Currie b9106c09cb [plist] Clean up string parsing
I had looked into doing reference counting on the strings, but didn't
like the implementation. However, it did make for better string handling
in the property list parser.
2023-03-09 13:33:49 +09:00
Bill Currie d89ad6b00f [plist] Fix a typo in the type mismatch message 2023-02-18 16:56:38 +09:00
Bill Currie d5b93c20b3 [plist] Pass array index/label to the parse function
I ran into the need to get at the label of labeled array element and the
best way seemed to be by setting the name field of the plfield_t item
passed to the parser function, and then found that PL_ParseSymtab
already does this. I then decided passing the array index would also be
good, and the offset field made sense.
2023-02-14 12:45:04 +09:00
Bill Currie 978d0306c0 [hash] Rename the publicly visible hashlink_t to hashctx_t
I think my biggest problem with the hashlink freelist parameter was how
much implementation it exposed in just the name.
2022-05-12 18:02:01 +09:00
Bill Currie ae9e8f8f4e [plist] Report line-relative character position in errors
Far better than string-relative.
2022-05-06 20:10:41 +09:00
Bill Currie a6703c95cf [plist] Allow ` to be used without quotes
It has no special meaning when parsing property lists, so there's no
reason to require quotes around it.
2021-12-24 06:45:12 +09:00
Bill Currie 032f9971ed [plist] Remove incorrect const from PL_RemoveObjectForKey
I'm not sure what I was thinking when I made PL_RemoveObjectForKey take
a const plitem. One of those times where C could do with being a little
more strict.
2021-12-17 08:30:00 +09:00
Bill Currie cc4167668c Fix a pile of leaks and uninit errors
Still "some" more to go: a pile to do with transforms and temporary
entities, and a nasty one with host_cbuf. There's also all the static
block-alloc lists :/
2021-03-21 19:56:17 +09:00
Bill Currie a3c1b2e992 [util] Rename qfplist.[ch]
The name is a hold-over from before the current quakeforge tree and the
QF include directory.
2021-03-21 16:13:03 +09:00
Renamed from libs/util/qfplist.c (Browse further)