|
From: <kin...@us...> - 2025-09-28 09:02:04
|
Revision: 7512
http://sourceforge.net/p/teem/code/7512
Author: kindlmann
Date: 2025-09-28 09:02:02 +0000 (Sun, 28 Sep 2025)
Log Message:
-----------
more descriptive comments
Modified Paths:
--------------
teem/trunk/src/hest/methodsHest.c
teem/trunk/src/hest/privateHest.h
Modified: teem/trunk/src/hest/methodsHest.c
===================================================================
--- teem/trunk/src/hest/methodsHest.c 2025-09-28 08:52:54 UTC (rev 7511)
+++ teem/trunk/src/hest/methodsHest.c 2025-09-28 09:02:02 UTC (rev 7512)
@@ -72,7 +72,7 @@
tokens, and to properly tokenize default strings and response files, we should stop using
the airParseStrT functions that internally use airStrtok(): we have exactly one token to
parse. These functions thus return non-zero in case of error, instead of returning the
-number of parsed values. */
+number of parsed values. See also comment about _hestP(arse)Pack in privateHest.h */
static int
parseSingleB(void *_out, const char *str, _hestPPack *hpp) {
if (!(_out && str && hpp)) return 1;
Modified: teem/trunk/src/hest/privateHest.h
===================================================================
--- teem/trunk/src/hest/privateHest.h 2025-09-28 08:52:54 UTC (rev 7511)
+++ teem/trunk/src/hest/privateHest.h 2025-09-28 09:02:02 UTC (rev 7512)
@@ -72,6 +72,15 @@
HEST_EXPORT const char _hestTypeStr[_HEST_TYPE_MAX + 1][AIR_STRLEN_SMALL + 1];
HEST_EXPORT const size_t _hestTypeSize[_HEST_TYPE_MAX + 1];
HEST_EXPORT void (*const _hestInvertScalar[_HEST_TYPE_MAX + 1])(void *);
+/* the _hestPPack (hest parse pack) struct is a 2025 idea for addressing one of the most
+annoying parts of hest's code: the special-casing of how values are parsed from strings,
+depending on type (scalar vs enum vs other-via-callbacks). Old code has long had nested
+switch statements: first for option kind, and then for option type. Fresh scrutiny of
+this code revealed how, now that there is no more airStrtok/airStrntok action because all
+individual args have been saved into per-option arg vectors, the parsing problem is just
+to get a single value, and, how to get a single value can be made entirely uniform across
+type; via the _hestParseSingle[] array. By putting the caller's mop in here too, that
+removes one layer of allocation tracking from hest's setting-values function. */
typedef struct {
airArray *cmop; // caller's mop to clean up things if airMopError
const airEnum *enm; // for parsing an airTypeEnum value
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|