#163 closed enhancement (later)
Need wrappers for psMetadataAdd for the sake of SWIG
| Reported by: | Owned by: | Paul Price | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | sys | Version: | unspecified |
| Severity: | minor | Keywords: | |
| Cc: |
Description
SWIG cannot handle varargs functions (googling "SWIG varargs" finds an explanation from
SWIG's author).
In consequence, we need wrappers for psMetadataAdd for the various data types if we
are to use them from e.g. python:
/
*
*/
/*
- SWIG doesn't like varargs functions; so provide non-varargs versions of psMetadataAdd */
bool psMetadataAddF32(psMetadata* restrict md, int where, const char *name, const char *comment,
float val)
{
return psMetadataAdd(md, where, name, PS_META_F32, comment, val);
}
bool psMetadataAddF64(psMetadata* restrict md, int where, const char *name, const char *comment,
double val)
{
return psMetadataAdd(md, where, name, PS_META_F64, comment, val);
}
bool psMetadataAddS32(psMetadata* restrict md, int where, const char *name, const char *comment,
int val)
{
return psMetadataAdd(md, where, name, PS_META_S32, comment, val);
}
bool psMetadataAddStr(psMetadata* restrict md, int where, const char *name, const char *comment,
char *val)
{
return psMetadataAdd(md, where, name, PS_META_STR, comment, val);
}

We'll worry about SWIG later.