/*
 * Wrappers for psLib
 */
#include <stdio.h>
#include "pslib.h"

void
psErrorStackPrintForSwig(void)
{
    psErrorStackPrint(stdout, "");
}

const psErr *psErrorGetForSwig(int i)
{
    const psErr *err = psErrorGet(i);

    return (err->code == PS_ERR_NONE ? NULL : err);
}

/************************************************************************************************************/

#if defined(psTrace)
#   undef psTrace
#endif

void psTrace(const char *comp,		// component being traced
	     int level,			// desired trace level
	     char *str)			// output string
{
    p_psTrace(comp, level, str);
}

/************************************************************************************************************/
/*
 * SWIG doesn't like varargs functions; so provide non-varargs versions of psMetadataAdd
 */
bool psMetadataAddBool(psMetadata* restrict md, int where, const char *name, const char *comment, int val)
{
    return psMetadataAdd(md, where, name, PS_TYPE_BOOL, comment, val);
}

