|
From: <kin...@us...> - 2023-07-08 14:13:05
|
Revision: 7060
http://sourceforge.net/p/teem/code/7060
Author: kindlmann
Date: 2023-07-08 14:13:02 +0000 (Sat, 08 Jul 2023)
Log Message:
-----------
syncing with source
Modified Paths:
--------------
teem/trunk/python/cffi/biffdata/bane.csv
teem/trunk/python/cffi/biffdata/nrrd.csv
teem/trunk/python/cffi/cdef/cdef_air.h
teem/trunk/python/cffi/cdef/cdef_bane.h
teem/trunk/python/cffi/cdef/cdef_coil.h
teem/trunk/python/cffi/cdef/cdef_gage.h
teem/trunk/python/cffi/cdef/cdef_hest.h
teem/trunk/python/cffi/cdef/cdef_meet.h
teem/trunk/python/cffi/cdef/cdef_mite.h
teem/trunk/python/cffi/cdef/cdef_nrrd.h
teem/trunk/python/cffi/cdef/cdef_pull.h
teem/trunk/python/cffi/cdef/cdef_push.h
teem/trunk/python/cffi/cdef/cdef_ten.h
teem/trunk/python/cffi/teem.py
Modified: teem/trunk/python/cffi/biffdata/bane.csv
===================================================================
--- teem/trunk/python/cffi/biffdata/bane.csv 2023-07-08 13:59:39 UTC (rev 7059)
+++ teem/trunk/python/cffi/biffdata/bane.csv 2023-07-08 14:13:02 UTC (rev 7060)
@@ -3,8 +3,8 @@
baneClipAnswer,int,1,0,bane,bane/clip.c:152
baneClipCopy,baneClip *,NULL,0,bane,bane/clip.c:167
baneFindInclusion,int,1,0,bane,bane/hvol.c:87
-baneMakeHVol,int,1,0,bane,bane/hvol.c:249
-baneGKMSHVol,Nrrd *,NULL,0,bane,bane/hvol.c:448
+baneMakeHVol,int,1,0,bane,bane/hvol.c:250
+baneGKMSHVol,Nrrd *,NULL,0,bane,bane/hvol.c:449
baneIncNew,baneInc *,NULL,0,bane,bane/inc.c:251
baneIncAnswer,int,1,0,bane,bane/inc.c:360
baneIncCopy,baneInc *,NULL,0,bane,bane/inc.c:375
Modified: teem/trunk/python/cffi/biffdata/nrrd.csv
===================================================================
--- teem/trunk/python/cffi/biffdata/nrrd.csv 2023-07-08 13:59:39 UTC (rev 7059)
+++ teem/trunk/python/cffi/biffdata/nrrd.csv 2023-07-08 14:13:02 UTC (rev 7060)
@@ -1,14 +1,14 @@
func_name,return_type,error_val(s),mubi,biff_key,filename:linenumber
nrrdArrayCompare,int,1,0,nrrd,nrrd/accessors.c:517
-nrrdApply1DLut,int,1,0,nrrd,nrrd/apply1D.c:433
-nrrdApplyMulti1DLut,int,1,0,nrrd,nrrd/apply1D.c:464
-nrrdApply1DRegMap,int,1,0,nrrd,nrrd/apply1D.c:513
-nrrdApplyMulti1DRegMap,int,1,0,nrrd,nrrd/apply1D.c:544
-nrrd1DIrregMapCheck,int,1,0,nrrd,nrrd/apply1D.c:586
-nrrd1DIrregAclCheck,int,1,0,nrrd,nrrd/apply1D.c:683
-nrrd1DIrregAclGenerate,int,1,0,nrrd,nrrd/apply1D.c:815
-nrrdApply1DIrregMap,int,1,0,nrrd,nrrd/apply1D.c:880
-nrrdApply1DSubstitution,int,1,0,nrrd,nrrd/apply1D.c:1054
+nrrdApply1DLut,int,1,0,nrrd,nrrd/apply1D.c:434
+nrrdApplyMulti1DLut,int,1,0,nrrd,nrrd/apply1D.c:465
+nrrdApply1DRegMap,int,1,0,nrrd,nrrd/apply1D.c:514
+nrrdApplyMulti1DRegMap,int,1,0,nrrd,nrrd/apply1D.c:545
+nrrd1DIrregMapCheck,int,1,0,nrrd,nrrd/apply1D.c:587
+nrrd1DIrregAclCheck,int,1,0,nrrd,nrrd/apply1D.c:684
+nrrd1DIrregAclGenerate,int,1,0,nrrd,nrrd/apply1D.c:816
+nrrdApply1DIrregMap,int,1,0,nrrd,nrrd/apply1D.c:881
+nrrdApply1DSubstitution,int,1,0,nrrd,nrrd/apply1D.c:1055
nrrdApply2DLut,int,1,0,nrrd,nrrd/apply2D.c:297
nrrdArithGamma,int,1,0,nrrd,nrrd/arith.c:50
nrrdArithSRGBGamma,int,1,0,nrrd,nrrd/arith.c:138
Modified: teem/trunk/python/cffi/cdef/cdef_air.h
===================================================================
--- teem/trunk/python/cffi/cdef/cdef_air.h 2023-07-08 13:59:39 UTC (rev 7059)
+++ teem/trunk/python/cffi/cdef/cdef_air.h 2023-07-08 14:13:02 UTC (rev 7060)
@@ -59,25 +59,16 @@
* but in many contexts the implementation complexity of handling them reliably is
* distracts from more urgent implementation goals. In the mean time, these can be used
* safely as long as the lengths are used consistently.
- *
- * The possibly unfortunate convention that has become established in Teem is code using
- * these tends to NOT add the +1 to explicitly indicate the space for 0-termination, and
- * instead assumes it is part of the numbers below, even though this is at the cost of
- * confusion about how the maximal strlen() will be less than each of
- * these numbers. This will be addressed in Teem 2.0.
- *
- * (NOTE: The +1 has been done manually here to assist the modest C parser used in
- * (Python module) cffi's FFI.cdef())
*/
-#define AIR_STRLEN_SMALL 129
+#define AIR_STRLEN_SMALL 128
/* SMALL has to be big enough to hold:
- printed value of size_t and
- ptrdiff_t, line of text that
- should contain file format "magic"
*/
-#define AIR_STRLEN_MED 257
-#define AIR_STRLEN_LARGE 513
-#define AIR_STRLEN_HUGE 1025
+#define AIR_STRLEN_MED 256
+#define AIR_STRLEN_LARGE 512
+#define AIR_STRLEN_HUGE 1024
/* HUGE has to be big enough to hold one line of biff error message */
/*
******** airPtrPtrUnion
@@ -150,7 +141,7 @@
extern char *airEnumFmtDesc(const airEnum *enm, int val, int canon, const char *fmt);
extern void airEnumPrint(FILE *file, const airEnum *enm);
/* ---- BEGIN non-NrrdIO */
-extern int airEnumCheck(char err[AIR_STRLEN_LARGE], const airEnum *enm);
+extern int airEnumCheck(char err[AIR_STRLEN_LARGE + 1], const airEnum *enm);
/* ---- END non-NrrdIO */
/*
******** airEndian enum
@@ -486,7 +477,7 @@
extern const char *const airTeemVersion;
extern const int airTeemReleaseDone;
extern const char *const airTeemReleaseDate;
-extern void airTeemVersionSprint(char buff[AIR_STRLEN_LARGE]);
+extern void airTeemVersionSprint(char buff[AIR_STRLEN_LARGE + 1]);
extern void *airNull(void);
extern void *airSetNull(void **ptrP);
extern void *airFree(void *ptr);
@@ -493,11 +484,11 @@
extern FILE *airFopen(const char *name, FILE *std, const char *mode);
extern FILE *airFclose(FILE *file);
extern int airSinglePrintf(FILE *file, char *str, const char *fmt, ...);
-extern char *airSprintSize_t(char str[AIR_STRLEN_SMALL], size_t val);
+extern char *airSprintSize_t(char str[AIR_STRLEN_SMALL + 1], size_t val);
/* ---- BEGIN non-NrrdIO */
extern char *airSprintVecSize_t(char *str, const size_t *vec, unsigned int len);
-extern char *airPrettySprintSize_t(char str[AIR_STRLEN_SMALL], size_t v);
-extern char *airSprintPtrdiff_t(char str[AIR_STRLEN_SMALL], ptrdiff_t v);
+extern char *airPrettySprintSize_t(char str[AIR_STRLEN_SMALL + 1], size_t v);
+extern char *airSprintPtrdiff_t(char str[AIR_STRLEN_SMALL + 1], ptrdiff_t v);
extern const int airPresent;
extern FILE *airStderr(void);
extern FILE *airStdout(void);
@@ -510,7 +501,7 @@
extern airULLong airIndexClampULL(double min, double val, double max, airULLong N);
extern char *airDoneStr(double start, double here, double end, char *str);
extern double airTime(void);
-extern const char airTypeStr[AIR_TYPE_MAX + 1][AIR_STRLEN_SMALL];
+extern const char airTypeStr[AIR_TYPE_MAX + 1][AIR_STRLEN_SMALL + 1];
extern const size_t airTypeSize[AIR_TYPE_MAX + 1];
extern void airEqvAdd(airArray *eqvArr, unsigned int j, unsigned int k);
extern unsigned int airEqvMap(airArray *eqvArr, unsigned int *map, unsigned int len);
Modified: teem/trunk/python/cffi/cdef/cdef_bane.h
===================================================================
--- teem/trunk/python/cffi/cdef/cdef_bane.h 2023-07-08 13:59:39 UTC (rev 7059)
+++ teem/trunk/python/cffi/cdef/cdef_bane.h 2023-07-08 14:13:02 UTC (rev 7060)
@@ -61,7 +61,7 @@
** things used to operate on ranges
*/
typedef struct {
- char name[AIR_STRLEN_SMALL];
+ char name[AIR_STRLEN_SMALL + 1];
int type;
double center; /* for baneRangeAnywhere: nominal center of value range
NOTE: there is currently no API for setting this,
@@ -112,7 +112,7 @@
** from histNew should be eventually passed to nrrdNuke.
*/
typedef struct baneInc_t {
- char name[AIR_STRLEN_SMALL];
+ char name[AIR_STRLEN_SMALL + 1];
int type;
double S, SS;
int num; /* used for calculating standard dev */
@@ -145,7 +145,7 @@
** things used to calculate and describe clipping
*/
typedef struct {
- char name[AIR_STRLEN_SMALL];
+ char name[AIR_STRLEN_SMALL + 1];
int type;
double parm[BANE_PARM_NUM];
int (*answer)(int *countP, Nrrd *hvol, double *clipParm);
@@ -197,7 +197,7 @@
** things used to calculate and describe measurements
*/
typedef struct baneMeasr_t {
- char name[AIR_STRLEN_SMALL];
+ char name[AIR_STRLEN_SMALL + 1];
int type;
double parm[BANE_PARM_NUM];
gageQuery query; /* the gageScl query needed for this measure,
Modified: teem/trunk/python/cffi/cdef/cdef_coil.h
===================================================================
--- teem/trunk/python/cffi/cdef/cdef_coil.h 2023-07-08 13:59:39 UTC (rev 7059)
+++ teem/trunk/python/cffi/cdef/cdef_coil.h 2023-07-08 14:13:02 UTC (rev 7060)
@@ -69,7 +69,7 @@
** running one method, regardless of kind
*/
typedef struct {
- char name[AIR_STRLEN_SMALL];
+ char name[AIR_STRLEN_SMALL + 1];
int type; /* from coilMethodType* enum */
int numParm; /* number of parameters we need */
} coilMethod;
@@ -98,11 +98,11 @@
** at some point in the future where appropriate.
*/
typedef struct {
- char name[AIR_STRLEN_SMALL]; /* short identifying string for kind */
- unsigned int valLen; /* number of scalars per data point
- 1 for plain scalars (baseDim=0),
- or something else (baseDim=1) */
- /* all the available methods */
+ char name[AIR_STRLEN_SMALL + 1]; /* short identifying string for kind */
+ unsigned int valLen; /* number of scalars per data point
+ 1 for plain scalars (baseDim=0),
+ or something else (baseDim=1) */
+ /* all the available methods */
void (*filter[COIL_METHOD_TYPE_MAX + 1])(coil_t *delta, int xi, int yi, int zi,
coil_t **iv3, double spacing[3],
double parm[COIL_PARMS_NUM]);
Modified: teem/trunk/python/cffi/cdef/cdef_gage.h
===================================================================
--- teem/trunk/python/cffi/cdef/cdef_gage.h 2023-07-08 13:59:39 UTC (rev 7059)
+++ teem/trunk/python/cffi/cdef/cdef_gage.h 2023-07-08 14:13:02 UTC (rev 7060)
@@ -646,7 +646,7 @@
something is actually sprintf'ed into errStr is controlled by
parm.generateErrStr.
NOTE: these variables used to be globals "gageErrStr" and "gageErrNum" */
- char errStr[AIR_STRLEN_LARGE];
+ char errStr[AIR_STRLEN_LARGE + 1];
int errNum; /* takes values from the gageErr enum */
/* what fraction of the values in the kernel support had to be invented
(by bleeding out the margin) in order to satisfy a probe that was near
@@ -714,25 +714,25 @@
** and set everything in a single shot).
*/
typedef struct gageKind_t {
- int dynamicAlloc; /* non-zero if this kind struct was
- dynamically allocated */
- char name[AIR_STRLEN_SMALL]; /* short identifying string for kind */
- const airEnum *enm; /* such as gageScl. NB: the "unknown"
- value in the enum *must* be 0. */
- unsigned int baseDim, /* dimension that x,y,z axes start on
- (e.g. 0 for scalars, 1 for vectors) */
- valLen; /* number of scalars per data point,
- -or- 0 to represent "this value will
- be learned later at runtime" */
- int itemMax; /* such as GAGE_SCL_ITEM_MAX */
- gageItemEntry *table; /* array of gageItemEntry's, indexed
- by the item value,
- -or- NULL if the table cannot be
- statically allocated (not because it
- can come in different sizes, but
- because it needs to be a modified
- version of the compile-time table */
- void (*iv3Print)(FILE *, /* such as _gageSclIv3Print() */
+ int dynamicAlloc; /* non-zero if this kind struct was
+ dynamically allocated */
+ char name[AIR_STRLEN_SMALL + 1]; /* short identifying string for kind */
+ const airEnum *enm; /* such as gageScl. NB: the "unknown"
+ value in the enum *must* be 0. */
+ unsigned int baseDim, /* dimension that x,y,z axes start on
+ (e.g. 0 for scalars, 1 for vectors) */
+ valLen; /* number of scalars per data point,
+ -or- 0 to represent "this value will
+ be learned later at runtime" */
+ int itemMax; /* such as GAGE_SCL_ITEM_MAX */
+ gageItemEntry *table; /* array of gageItemEntry's, indexed
+ by the item value,
+ -or- NULL if the table cannot be
+ statically allocated (not because it
+ can come in different sizes, but
+ because it needs to be a modified
+ version of the compile-time table */
+ void (*iv3Print)(FILE *, /* such as _gageSclIv3Print() */
gageContext *,
gagePerVolume *),
(*filter)(gageContext *, /* such as _gageSclFilter() */
@@ -1053,7 +1053,7 @@
const gageStackBlurParm *sbpB,
const char *nameB,
int *differ,
- char explain[AIR_STRLEN_LARGE]);
+ char explain[AIR_STRLEN_LARGE + 1]);
extern int gageStackBlurParmScaleSet(gageStackBlurParm *sbp, unsigned int num,
double sigmaMin, double sigmaMax,
int uniformSigma, int optimalL2L2);
@@ -1080,7 +1080,7 @@
char **extraParmsP,
const char *str);
extern const hestCB *const gageHestStackBlurParm;
-extern int gageStackBlurParmSprint(char str[AIR_STRLEN_LARGE],
+extern int gageStackBlurParmSprint(char str[AIR_STRLEN_LARGE + 1],
const gageStackBlurParm *sbp,
int extraFlag[256],
char *extraParm);
Modified: teem/trunk/python/cffi/cdef/cdef_hest.h
===================================================================
--- teem/trunk/python/cffi/cdef/cdef_hest.h 2023-07-08 13:59:39 UTC (rev 7059)
+++ teem/trunk/python/cffi/cdef/cdef_hest.h 2023-07-08 14:13:02 UTC (rev 7060)
@@ -48,7 +48,7 @@
typedef struct {
size_t size; /* sizeof() one thing */
const char *type; /* used by hestGlossary() to describe the type */
- int (*parse)(void *ptr, const char *str, char err[AIR_STRLEN_HUGE]);
+ int (*parse)(void *ptr, const char *str, char err[AIR_STRLEN_HUGE + 1]);
/* how to parse one thing from a string. This will be called multiple times for
multiple parameter options. A non-zero return value is considered an error. Error
message goes in the err string */
@@ -61,9 +61,13 @@
/*
******** hestOpt struct
**
-** information which specifies one command-line option
+** information which specifies one command-line option,
+** and describes it how it was parsed
*/
typedef struct {
+ /* --------------------- "input" fields
+ set by user, possibly directly, more likely indirectly via one of the various
+ functions (like hestOptAdd or hestOptAdd_nva or hestOptSingleSet ... ) */
char *flag, /* how the option is identified on the cmd line */
*name; /* simple description of option's parameter(s) */
int type; /* type of option (from airType enum) */
@@ -75,21 +79,25 @@
*info; /* description to be printed with "glossary" info */
unsigned int *sawP; /* used ONLY for multiple variable parameter options
(min < max >= 2): storage of # of parsed values */
- airEnum *enm; /* used ONLY for airTypeEnum options */
- hestCB *CB; /* used ONLY for airTypeOther options */
- /* --------------------- end of user-defined fields; the following fields must be set
- by hestParse() as part of its operation. This does prevent adding const to much
- usage of the hestOpt */
- int kind, /* what kind of option is this, based on min and max,set by hestParse()
- (actually _hestPanic()), later used by hestFree():
+ const airEnum *enm; /* used ONLY for airTypeEnum options */
+ const hestCB *CB; /* used ONLY for airTypeOther options */
+ /* --------------------- end of user-defined fields
+ These are set by hest functions to remember state for the sake of other hest functions.
+ It is probably a drawback of the simple design of hest that this internal state ends
+ up in the same struct as the input parameters above, because it blocks some
+ const-correctness opportunities that would otherwise make sense. */
+ int kind, /* What kind of option is this, based on min and max:
+ 0: (invalid; unset)
1: min == max == 0 stand-alone flag; no parameters
2: min == max == 1 single fixed parameter
3: min == max >= 2 multiple fixed parameters
4: min == 0; max == 1; single variable parameter
- 5: min < max; max >= 2 multiple variable parameters */
- alloc; /* information about whether flag is non-NULL, and what parameters were used,
- that determines whether or not memory was allocated by hestParse(); info
- later used by hestParseFree():
+ 5: min < max; max >= 2 multiple variable parameters
+ This is set by hest functions as part of building up an array of hestOpt,
+ and informs the later action of hestOptFree */
+ alloc; /* Information (set by hestParse) about whether flag is non-NULL, and what
+ parameters were used, that determines whether or not memory was allocated
+ by hestParse(). Informs later action of hestParseFree():
0: no free()ing needed
1: free(*valueP), either because it is a single string, or because was a
dynamically allocated array of non-strings
@@ -97,16 +105,38 @@
array of strings
3: free((*valueP)[i]) and free(*valueP), because it is a dynamically
allocated array of strings */
- /* --------------------- Output */
+ /* Since hest's beginning, the basic container for a set of options was an array of
+ hestOpt structs (not pointers to them, which rules out argv-style NULL-termination of
+ the array), also unfortunately with no other top-level container (which is why
+ helpWanted below is set only in the first hestOpt of the array). hestOptAdd has
+ historically reallocated the entire array, incrementing the length only by one with
+ each call, while maintaining a single terminating hestOpt, wherein some fields were set
+ to special values to indicate termination. With the 2023 code revisit, that was deemed
+ even uglier than this hack: the first hestOpt now stores here in arrAlloc the allocated
+ length of the hestOpt array, and in arrLen the number of hestOpts actually used and
+ set. This facilitates implementing something much like an airArray, but without the
+ burden of extra calls for the user (like airArrayLenIncr), nor new kinds of containers
+ for hest and its users to manage: just same same array of hestOpt structs */
+ unsigned int arrAlloc, arrLen;
+ /* --------------------- Output
+ Things set/allocated by hestParse. */
int source; /* from the hestSource* enum; from whence was this information learned,
- else hestSourceUnknown if not */
+ else hestSourceUnknown if not */
+ char *parmStr; /* if non-NULL: a string (freed by hestParseFree) from which hestParse
+ ultimately parsed whatever values were set in *valueP. All the
+ parameters associated with this option are joined (with " " separation)
+ into this single string. hestParse has always formed this string
+ internally as part of its operation, but only belatedly (in 2023) is a
+ copy of that string being made available here to the caller. Note that
+ in the case of single variable parameter options used without a
+ parameter, the value stored will be "inverted" from the string here. */
int helpWanted; /* hestParse() saw something (like "--help") in one of the given
- arguments that looks like a call for help (and respectDashDashHelp
- is set in the hestParm), so it recorded that here. There is
- unfortunately no other top-level output container for info generated
- by hestParse(), so this field is going to be set only in the *first*
- hestOpt passed to hestParse(), even though that hestOpt has no
- particular relation to where hestParse() saw the call for help. */
+ arguments that looks like a call for help (and respectDashDashHelp is
+ set in the hestParm), so it recorded that here. There is unfortunately
+ no other top-level output container for info generated by hestParse(),
+ so this field is going to be set only in the *first* hestOpt passed to
+ hestParse(), even though that hestOpt has no particular relation to
+ where hestParse() saw the call for help. */
} hestOpt;
/*
******** hestParm struct
@@ -152,10 +182,12 @@
char respFileFlag, /* the character at the beginning of an argument
indicating that this is a response file name */
respFileComment, /* comment character for the response files */
- varParamStopFlag, /* prefixed by '-' to form the flag which signals the end of a
- variable parameter option (single or multiple), flagged or
- unflagged. Originally imagined as most useful for flagged
- options, but also works in unflagged. */
+ varParamStopFlag, /* prefixed by '-' to form the flag (usually "--") that signals the
+ end of a *flagged* variable parameter option (single or
+ multiple). This is important to use if there is a flagged
+ variable parameter option preceeding an unflagged variable
+ parameter option, because otherwise how will you know where the
+ first stops and the second begins */
multiFlagSep; /* character in flag which signifies that there is a long and short
version, and which separates the two. Or, can be set to '\0' to
disable this behavior entirely. */
@@ -183,6 +215,15 @@
extern hestParm *hestParmNew(void);
extern hestParm *hestParmFree(hestParm *parm);
extern void *hestParmFree_vp(void *parm);
+extern void hestOptSingleSet(hestOpt *opt, const char *flag, const char *name,
+ int type, int min, int max, void *valueP,
+ const char *dflt, const char *info, unsigned int *sawP,
+ const airEnum *enm, const hestCB *CB);
+extern unsigned int hestOptAdd_nva(hestOpt **optP, const char *flag,
+ const char *name, int type, int min, int max,
+ void *valueP, const char *dflt, const char *info,
+ unsigned int *sawP, const airEnum *enm,
+ const hestCB *CB);
extern unsigned int hestOptAdd(hestOpt **optP,
const char *flag, const char *name,
int type, int min, int max,
@@ -189,8 +230,10 @@
void *valueP, const char *dflt,
const char *info,
... /* unsigned int *sawP,
- airEnum *enm,
+ const airEnum *enm,
const hestCB *CB */);
+/* see also all the special-purpose and type-checked versions in adders.c, below */
+extern unsigned int hestOptNum(const hestOpt *opt);
extern hestOpt *hestOptFree(hestOpt *opt);
extern void *hestOptFree_vp(void *opt);
extern int hestOptCheck(hestOpt *opt, char **errP);
@@ -210,3 +253,44 @@
extern void hestGlossary(FILE *file, hestOpt *opt, const hestParm *parm);
extern void hestInfo(FILE *file, const char *argv0, const char *info,
const hestParm *parm);
+/* adders.c */
+extern unsigned int hestOptAdd_Flag(hestOpt **optP, const char *flag, int *valueP,
+ const char *info);
+extern unsigned int hestOptAdd_1_Bool(hestOpt **optP, const char *flag,
+ const char *name, int *valueP, int dflt,
+ const char *info);
+extern unsigned int hestOptAdd_1_Int(hestOpt **optP, const char *flag,
+ const char *name, int *valueP, int dflt,
+ const char *info);
+extern unsigned int hestOptAdd_1_UInt(hestOpt **optP, const char *flag,
+ const char *name, unsigned int *valueP,
+ unsigned int dflt, const char *info);
+extern unsigned int hestOptAdd_1_LongInt(hestOpt **optP, const char *flag,
+ const char *name, long int *valueP,
+ long int dflt, const char *info);
+extern unsigned int hestOptAdd_1_ULongInt(hestOpt **optP, const char *flag,
+ const char *name,
+ unsigned long int *valueP,
+ unsigned long int dflt, const char *info);
+extern unsigned int hestOptAdd_1_Size_t(hestOpt **optP, const char *flag,
+ const char *name, size_t *valueP,
+ size_t dflt, const char *info);
+extern unsigned int hestOptAdd_1_Float(hestOpt **optP, const char *flag,
+ const char *name, float *valueP, float dflt,
+ const char *info);
+extern unsigned int hestOptAdd_1_Double(hestOpt **optP, const char *flag,
+ const char *name, double *valueP,
+ double dflt, const char *info);
+extern unsigned int hestOptAdd_1_Char(hestOpt **optP, const char *flag,
+ const char *name, char *valueP, char dflt,
+ const char *info);
+extern unsigned int hestOptAdd_1_String(hestOpt **optP, const char *flag,
+ const char *name, char **valueP,
+ const char *dflt, const char *info);
+extern unsigned int hestOptAdd_1_Enum(hestOpt **optP, const char *flag,
+ const char *name, int *valueP, int dflt,
+ const char *info, const airEnum *enm);
+extern unsigned int hestOptAdd_1_Other(hestOpt **optP, const char *flag,
+ const char *name, void *valueP,
+ const char *dflt, const char *info,
+ const hestCB *CB);
Modified: teem/trunk/python/cffi/cdef/cdef_meet.h
===================================================================
--- teem/trunk/python/cffi/cdef/cdef_meet.h 2023-07-08 13:59:39 UTC (rev 7059)
+++ teem/trunk/python/cffi/cdef/cdef_meet.h 2023-07-08 14:13:02 UTC (rev 7060)
@@ -105,7 +105,7 @@
extern int meetPullVolLeechable(const meetPullVol *lchr,
const meetPullVol *orig,
int *can,
- char explain[AIR_STRLEN_HUGE]);
+ char explain[AIR_STRLEN_HUGE + 1]);
extern meetPullVol *meetPullVolNix(meetPullVol *pvol);
extern const hestCB *const meetHestPullVol;
extern int meetPullVolStackBlurParmFinishMulti(meetPullVol **mpv,
Modified: teem/trunk/python/cffi/cdef/cdef_mite.h
===================================================================
--- teem/trunk/python/cffi/cdef/cdef_mite.h 2023-07-08 13:59:39 UTC (rev 7059)
+++ teem/trunk/python/cffi/cdef/cdef_mite.h 2023-07-08 14:13:02 UTC (rev 7060)
@@ -108,8 +108,8 @@
specification, its up to them to verify that the normalStr and the
shadeStr refer to the same vector.
*/
- char shadeStr[AIR_STRLEN_MED], /* how to do shading */
- normalStr[AIR_STRLEN_MED]; /* what is the "surface normal" */
+ char shadeStr[AIR_STRLEN_MED + 1], /* how to do shading */
+ normalStr[AIR_STRLEN_MED + 1]; /* what is the "surface normal" */
/* for each possible element of the txf range, what value should it
start at prior to rendering. Mainly needed to store non-unity values
for the quantities not covered by a transfer function */
Modified: teem/trunk/python/cffi/cdef/cdef_nrrd.h
===================================================================
--- teem/trunk/python/cffi/cdef/cdef_nrrd.h 2023-07-08 13:59:39 UTC (rev 7059)
+++ teem/trunk/python/cffi/cdef/cdef_nrrd.h 2023-07-08 14:13:02 UTC (rev 7060)
@@ -959,12 +959,12 @@
** All information and behavior relevent to one datafile format
*/
typedef struct {
- char name[AIR_STRLEN_SMALL]; /* short identifying string */
- int isImage, /* this format is intended solely for "2D" images, which
- controls the invocation of nrrdAxesInsert()
- if nrrdStateGrayscaleImage3D */
- readable, /* we can read as well as write this format */
- usesDIO; /* this format can use Direct IO */
+ char name[AIR_STRLEN_SMALL + 1]; /* short identifying string */
+ int isImage, /* this format is intended solely for "2D" images, which
+ controls the invocation of nrrdAxesInsert()
+ if nrrdStateGrayscaleImage3D */
+ readable, /* we can read as well as write this format */
+ usesDIO; /* this format can use Direct IO */
/* tests if this format is currently available in this build */
int (*available)(void);
/* (for writing) returns non-zero if a given filename could likely be
@@ -989,8 +989,8 @@
** This is necessitated by the memory restrictions of direct I/O
*/
typedef struct NrrdEncoding_t {
- char name[AIR_STRLEN_SMALL], /* short identifying string */
- suffix[AIR_STRLEN_SMALL]; /* costumary filename suffix */
+ char name[AIR_STRLEN_SMALL + 1], /* short identifying string */
+ suffix[AIR_STRLEN_SMALL + 1]; /* customary filename suffix */
int endianMatters, isCompression;
int (*available)(void);
/* The "data" and "elementNum" values have to be passed explicitly
@@ -1218,7 +1218,7 @@
typedef struct {
/* terse string representation of kernel function, irrespective of
the parameter vector */
- char name[AIR_STRLEN_SMALL];
+ char name[AIR_STRLEN_SMALL + 1];
/* number of parameters needed (# elements in parm[] used) */
unsigned int numParm; /* HEY: should be "parmNum" in standard convention */
/* smallest x (x > 0) such that k(y) = 0 for all y > x, y < -x */
@@ -1490,7 +1490,7 @@
/* ---- END non-NrrdIO */
/******** arrays of things (poor-man's functions/predicates) */
/* arraysNrrd.c */
-extern const char nrrdTypePrintfStr[NRRD_TYPE_MAX + 1][AIR_STRLEN_SMALL];
+extern const char nrrdTypePrintfStr[NRRD_TYPE_MAX + 1][AIR_STRLEN_SMALL + 1];
extern const size_t nrrdTypeSize[NRRD_TYPE_MAX + 1];
extern const double nrrdTypeMin[NRRD_TYPE_MAX + 1];
extern const double nrrdTypeMax[NRRD_TYPE_MAX + 1];
@@ -1505,12 +1505,12 @@
extern NrrdBoundarySpec *nrrdBoundarySpecCopy(const NrrdBoundarySpec *bsp);
extern int nrrdBoundarySpecCheck(const NrrdBoundarySpec *bspec);
extern int nrrdBoundarySpecParse(NrrdBoundarySpec *bspec, const char *str);
-extern int nrrdBoundarySpecSprint(char str[AIR_STRLEN_LARGE],
+extern int nrrdBoundarySpecSprint(char str[AIR_STRLEN_LARGE + 1],
const NrrdBoundarySpec *bspec);
extern int nrrdBoundarySpecCompare(const NrrdBoundarySpec *bspecA,
const NrrdBoundarySpec *bspecB,
int *differ,
- char explain[AIR_STRLEN_LARGE]);
+ char explain[AIR_STRLEN_LARGE + 1]);
/* ---- END non-NrrdIO */
extern NrrdIoState *nrrdIoStateNew(void);
extern void nrrdIoStateInit(NrrdIoState *nio);
@@ -1549,7 +1549,8 @@
... /* size_t sx, sy, .., ax(dim-1) size */);
/* ---- BEGIN non-NrrdIO */
extern int nrrdCompare(const Nrrd *ninA, const Nrrd *ninB, int onlyData,
- double epsilon, int *differ, char explain[AIR_STRLEN_LARGE]);
+ double epsilon, int *differ,
+ char explain[AIR_STRLEN_LARGE + 1]);
extern int nrrdPPM(Nrrd *, size_t sx, size_t sy);
extern int nrrdPGM(Nrrd *, size_t sx, size_t sy);
/* ---- END non-NrrdIO */
@@ -1575,7 +1576,7 @@
extern int nrrdAxisInfoCompare(const NrrdAxisInfo *axisA,
const NrrdAxisInfo *axisB,
int *differ,
- char explain[AIR_STRLEN_LARGE]);
+ char explain[AIR_STRLEN_LARGE + 1]);
/* ---- END non-NrrdIO */
extern unsigned int nrrdDomainAxesGet(const Nrrd *nrrd,
unsigned int axisIdx[NRRD_DIM_MAX]);
@@ -1751,7 +1752,7 @@
const void *);
extern int nrrdArrayCompare(int type, const void *valA, const void *valB,
size_t valNum, double epsilon, int *differ,
- char explain[AIR_STRLEN_LARGE]);
+ char explain[AIR_STRLEN_LARGE + 1]);
/* ---- END non-NrrdIO */
/******** permuting, shuffling, and all flavors of reshaping */
/* reorder.c */
@@ -2190,9 +2191,9 @@
double *parm,
const char *str);
extern int nrrdKernelSpecParse(NrrdKernelSpec *ksp, const char *str);
-extern int nrrdKernelSpecSprint(char str[AIR_STRLEN_LARGE],
+extern int nrrdKernelSpecSprint(char str[AIR_STRLEN_LARGE + 1],
const NrrdKernelSpec *ksp);
-extern int nrrdKernelSprint(char str[AIR_STRLEN_LARGE],
+extern int nrrdKernelSprint(char str[AIR_STRLEN_LARGE + 1],
const NrrdKernel *kernel,
const double kparm[NRRD_KERNEL_PARMS_NUM]);
extern int nrrdKernelCompare(const NrrdKernel *kernA,
@@ -2200,11 +2201,11 @@
const NrrdKernel *kernB,
const double parmB[NRRD_KERNEL_PARMS_NUM],
int *differ,
- char explain[AIR_STRLEN_LARGE]);
+ char explain[AIR_STRLEN_LARGE + 1]);
extern int nrrdKernelSpecCompare(const NrrdKernelSpec *aa,
const NrrdKernelSpec *bb,
int *differ,
- char explain[AIR_STRLEN_LARGE]);
+ char explain[AIR_STRLEN_LARGE + 1]);
extern int nrrdKernelCheck(const NrrdKernel *kern,
const double parm[NRRD_KERNEL_PARMS_NUM], size_t evalNum,
double epsilon, unsigned int diffOkEvalMax,
Modified: teem/trunk/python/cffi/cdef/cdef_pull.h
===================================================================
--- teem/trunk/python/cffi/cdef/cdef_pull.h 2023-07-08 13:59:39 UTC (rev 7059)
+++ teem/trunk/python/cffi/cdef/cdef_pull.h 2023-07-08 14:13:02 UTC (rev 7060)
@@ -371,7 +371,7 @@
** shape inside the support.
*/
typedef struct {
- char name[AIR_STRLEN_SMALL];
+ char name[AIR_STRLEN_SMALL + 1];
unsigned int parmNum;
double (*well)(double *wx, const double parm[PULL_ENERGY_PARM_NUM]);
double (*eval)(double *denr, double dist, const double parm[PULL_ENERGY_PARM_NUM]);
@@ -973,7 +973,7 @@
extern pullInfoSpec *pullInfoSpecNix(pullInfoSpec *ispec);
extern int pullInfoSpecAdd(pullContext *pctx, pullInfoSpec *ispec);
extern int pullInfoGet(Nrrd *ninfo, int info, pullContext *pctx);
-extern int pullInfoSpecSprint(char str[AIR_STRLEN_LARGE],
+extern int pullInfoSpecSprint(char str[AIR_STRLEN_LARGE + 1],
const pullContext *pctx,
const pullInfoSpec *ispec);
/* contextPull.c */
Modified: teem/trunk/python/cffi/cdef/cdef_push.h
===================================================================
--- teem/trunk/python/cffi/cdef/cdef_push.h 2023-07-08 13:59:39 UTC (rev 7059)
+++ teem/trunk/python/cffi/cdef/cdef_push.h 2023-07-08 14:13:02 UTC (rev 7060)
@@ -105,7 +105,7 @@
** non-NULL pointers into which to store energy and force
*/
typedef struct {
- char name[AIR_STRLEN_SMALL];
+ char name[AIR_STRLEN_SMALL + 1];
unsigned int parmNum;
void (*eval)(double *energy, double *force, double dist,
const double parm[PUSH_ENERGY_PARM_NUM]);
Modified: teem/trunk/python/cffi/cdef/cdef_ten.h
===================================================================
--- teem/trunk/python/cffi/cdef/cdef_ten.h 2023-07-08 13:59:39 UTC (rev 7059)
+++ teem/trunk/python/cffi/cdef/cdef_ten.h 2023-07-08 14:13:02 UTC (rev 7060)
@@ -1033,13 +1033,13 @@
/* description of *one* parameter in the parameter vector that
defines one instance of a given model */
typedef struct {
- char name[AIR_STRLEN_SMALL]; /* name */
- double min, max; /* bounds */
- int cyclic; /* non-zero if effectively min == max */
- int vec3; /* non-zero if this is a coefficient
- of a UNIT-LENGTH 3-vector */
- unsigned int vecIdx; /* *if* this param is part of vector,
- the index into it, i.e. 0, 1, or 2 */
+ char name[AIR_STRLEN_SMALL + 1]; /* name */
+ double min, max; /* bounds */
+ int cyclic; /* non-zero if effectively min == max */
+ int vec3; /* non-zero if this is a coefficient
+ of a UNIT-LENGTH 3-vector */
+ unsigned int vecIdx; /* *if* this param is part of vector,
+ the index into it, i.e. 0, 1, or 2 */
} tenModelParmDesc;
/*
******** struct tenModel
@@ -1067,13 +1067,13 @@
** The "parmNum" field below therefore always includes the B0 value
*/
typedef struct tenModel_t {
- char name[AIR_STRLEN_SMALL];
+ char name[AIR_STRLEN_SMALL + 1];
unsigned int parmNum;
const tenModelParmDesc *parmDesc;
/* noise free simulation */
void (*simulate)(double *dwiSim, const double *parm, const tenExperSpec *espec);
/* parameter vector operations */
- char *(*sprint)(char str[AIR_STRLEN_MED], const double *parm);
+ char *(*sprint)(char str[AIR_STRLEN_MED + 1], const double *parm);
double *(*alloc)(void);
void (*rand)(double *parm, airRandMTState *rng, int knownB0);
void (*step)(double *parm1, const double scl, const double *grad, const double *parm0);
Modified: teem/trunk/python/cffi/teem.py
===================================================================
--- teem/trunk/python/cffi/teem.py 2023-07-08 13:59:39 UTC (rev 7059)
+++ teem/trunk/python/cffi/teem.py 2023-07-08 14:13:02 UTC (rev 7060)
@@ -123,15 +123,15 @@
_BIFF_DICT = { # contents here are filled in by teem/python/cffi/exult.py Tffi.wrap()
'nrrdArrayCompare': (_equals_one, 0, b'nrrd', 'nrrd/accessors.c:517'),
- 'nrrdApply1DLut': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:433'),
- 'nrrdApplyMulti1DLut': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:464'),
- 'nrrdApply1DRegMap': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:513'),
- 'nrrdApplyMulti1DRegMap': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:544'),
- 'nrrd1DIrregMapCheck': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:586'),
- 'nrrd1DIrregAclCheck': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:683'),
- 'nrrd1DIrregAclGenerate': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:815'),
- 'nrrdApply1DIrregMap': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:880'),
- 'nrrdApply1DSubstitution': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:1054'),
+ 'nrrdApply1DLut': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:434'),
+ 'nrrdApplyMulti1DLut': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:465'),
+ 'nrrdApply1DRegMap': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:514'),
+ 'nrrdApplyMulti1DRegMap': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:545'),
+ 'nrrd1DIrregMapCheck': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:587'),
+ 'nrrd1DIrregAclCheck': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:684'),
+ 'nrrd1DIrregAclGenerate': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:816'),
+ 'nrrdApply1DIrregMap': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:881'),
+ 'nrrdApply1DSubstitution': (_equals_one, 0, b'nrrd', 'nrrd/apply1D.c:1055'),
'nrrdApply2DLut': (_equals_one, 0, b'nrrd', 'nrrd/apply2D.c:297'),
'nrrdArithGamma': (_equals_one, 0, b'nrrd', 'nrrd/arith.c:50'),
'nrrdArithSRGBGamma': (_equals_one, 0, b'nrrd', 'nrrd/arith.c:138'),
@@ -351,8 +351,8 @@
'baneClipAnswer': (_equals_one, 0, b'bane', 'bane/clip.c:152'),
'baneClipCopy': (_equals_null, 0, b'bane', 'bane/clip.c:167'),
'baneFindInclusion': (_equals_one, 0, b'bane', 'bane/hvol.c:87'),
- 'baneMakeHVol': (_equals_one, 0, b'bane', 'bane/hvol.c:249'),
- 'baneGKMSHVol': (_equals_null, 0, b'bane', 'bane/hvol.c:448'),
+ 'baneMakeHVol': (_equals_one, 0, b'bane', 'bane/hvol.c:250'),
+ 'baneGKMSHVol': (_equals_null, 0, b'bane', 'bane/hvol.c:449'),
'baneIncNew': (_equals_null, 0, b'bane', 'bane/inc.c:251'),
'baneIncAnswer': (_equals_one, 0, b'bane', 'bane/inc.c:360'),
'baneIncCopy': (_equals_null, 0, b'bane', 'bane/inc.c:375'),
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|