-static struct psi_std_type {
- token_t type_tag;
- const char *type_name;
-} psi_std_types[] = {
- {PSI_T_FLOAT, "float"},
- {PSI_T_DOUBLE, "double"},
- {PSI_T_INT8, "int8_t"},
- {PSI_T_INT16, "int16_t"},
- {PSI_T_INT32, "int32_t"},
- {PSI_T_INT64, "int64_t"},
- {PSI_T_UINT8, "uint8_t"},
- {PSI_T_UINT16, "uint16_t"},
- {PSI_T_UINT32, "uint32_t"},
- {PSI_T_UINT64, "uint64_t"},
- {0}
-};
-
-static struct psi_predef_type {
- token_t type_tag;
- const char *type_name;
- const char *alias;
-} psi_predef_types[] = {
- PSI_TYPES
- {0}
-};
-
-static struct psi_predef_const {
- token_t type_tag;
- const char *type_name;
- const char *var_name;
- const char *val_text;
- token_t val_type_tag;
-} psi_predef_consts[] = {
- PSI_CONSTS
- {0}
-};
-
-PSI_MACROS
-
-int psi_glob(const char *pattern, int flags,
- int (*errfunc) (const char *epath, int eerrno),
- glob_t *pglob) {
- size_t offs = flags & GLOB_DOOFFS ? pglob->gl_offs : 0;
- int rv = glob(pattern, flags, errfunc, pglob);
- if (pglob->gl_pathv) {
- while (offs--) {
- pglob->gl_pathv[offs] = NULL;
- }
- }
- return rv;
-}
-
-int psi_printf(const char *fmt, ...) {
- int rs;
- char *a1;
- va_list ap1, ap2;
-
- va_start(ap1, fmt);
- va_copy(ap2, ap1);
- a1 = va_arg(ap2, char *);
- rs = vprintf(fmt, ap1);
- va_end(ap1);
- va_end(ap2);
- return rs;
-}
-
-static struct psi_func_redir {
- const char *name;
- void (*func)(void);
-} psi_func_redirs[] = {
- {"glob", (void (*)(void)) psi_glob},
- {"printf", (void (*)(void)) psi_printf},
- PSI_REDIRS
- {0}
-};