/****************************************************************************
- * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
#include <term.h>
#include <tic.h>
-MODULE_ID("$Id: lib_tparm.c,v 1.68 2004/02/07 20:52:51 tom Exp $")
+MODULE_ID("$Id: lib_tparm.c,v 1.71 2006/11/26 01:12:56 tom Exp $")
/*
* char *
}
#endif
-static inline void
+static NCURSES_INLINE void
get_space(size_t need)
{
need += out_used;
}
}
-static inline void
+static NCURSES_INLINE void
save_text(const char *fmt, const char *s, int len)
{
size_t s_len = strlen(s);
out_used += strlen(out_buff + out_used);
}
-static inline void
+static NCURSES_INLINE void
save_number(const char *fmt, int number, int len)
{
if (len < 30)
out_used += strlen(out_buff + out_used);
}
-static inline void
+static NCURSES_INLINE void
save_char(int c)
{
if (c == 0)
out_buff[out_used++] = c;
}
-static inline void
+static NCURSES_INLINE void
npush(int x)
{
if (stack_ptr < STACKSIZE) {
}
}
-static inline int
+static NCURSES_INLINE int
npop(void)
{
int result = 0;
return result;
}
-static inline void
+static NCURSES_INLINE void
spush(char *x)
{
if (stack_ptr < STACKSIZE) {
}
}
-static inline char *
+static NCURSES_INLINE char *
spop(void)
{
static char dummy[] = ""; /* avoid const-cast */
return result;
}
-static inline const char *
+static NCURSES_INLINE const char *
parse_format(const char *s, char *format, int *len)
{
*len = 0;
return number;
}
-static inline char *
+static NCURSES_INLINE char *
tparam_internal(const char *string, va_list ap)
{
#define NUM_VARS 26
char *p_is_s[NUM_PARM];
- long param[NUM_PARM];
+ TPARM_ARG param[NUM_PARM];
int popcount;
int number;
int len;
if (p_is_s[i] != 0) {
p_is_s[i] = va_arg(ap, char *);
} else {
- param[i] = va_arg(ap, long int);
+ param[i] = va_arg(ap, TPARM_ARG);
}
}
return (out_buff);
}
+#if NCURSES_TPARM_VARARGS
+#define tparm_varargs tparm
+#else
+#define tparm_proto tparm
+#endif
+
NCURSES_EXPORT(char *)
-tparm(NCURSES_CONST char *string,...)
+tparm_varargs(NCURSES_CONST char *string,...)
{
va_list ap;
char *result;
va_end(ap);
return result;
}
+
+#if !NCURSES_TPARM_VARARGS
+NCURSES_EXPORT(char *)
+tparm_proto(NCURSES_CONST char *string,
+ TPARM_ARG a1,
+ TPARM_ARG a2,
+ TPARM_ARG a3,
+ TPARM_ARG a4,
+ TPARM_ARG a5,
+ TPARM_ARG a6,
+ TPARM_ARG a7,
+ TPARM_ARG a8,
+ TPARM_ARG a9)
+{
+ return tparm_varargs(string, a1, a2, a3, a4, a5, a6, a7, a8, a9);
+}
+#endif /* NCURSES_TPARM_VARARGS */