File: proto.h

package info (click to toggle)
nut 2.7.2-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 10,220 kB
  • ctags: 8,034
  • sloc: ansic: 66,197; sh: 12,738; python: 2,196; cpp: 1,710; makefile: 1,335; perl: 702; xml: 10
file content (94 lines) | stat: -rw-r--r-- 2,316 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef PROTO_H
#define PROTO_H

#include "attribute.h"

#ifdef __cplusplus
/* *INDENT-OFF* */
extern "C" {
/* *INDENT-ON* */
#endif

#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF)

/* Define this as a fall through, HAVE_STDARG_H is probably already set */

#ifndef HAVE_VARARGS_H
#define HAVE_VARARGS_H
#endif

/* varargs declarations: */

#if defined(HAVE_STDARG_H)
# include <stdarg.h>
# define HAVE_STDARGS    /* let's hope that works everywhere (mj) */
# define VA_LOCAL_DECL   va_list ap
# define VA_START(f)     va_start(ap, f)
# define VA_SHIFT(v,t)  ;   /* no-op for ANSI */
# define VA_END          va_end(ap)
#else
# if defined(HAVE_VARARGS_H)
#  include <varargs.h>
#  undef HAVE_STDARGS
#  define VA_LOCAL_DECL   va_list ap
#  define VA_START(f)     va_start(ap)      /* f is ignored! */
#  define VA_SHIFT(v,t) v = va_arg(ap,t)
#  define VA_END        va_end(ap)
# else
/*XX ** NO VARARGS ** XX*/
# endif
#endif

#if !defined (HAVE_SNPRINTF) || defined (__Lynx__)
int snprintf (char *str, size_t count, const char *fmt, ...)
	__attribute__ ((__format__ (__printf__, 3, 4)));
#endif

#if !defined (HAVE_VSNPRINTF)
int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
#endif

#endif

#ifndef HAVE_SETENV
int nut_setenv(const char *name, const char *value, int overwrite);
static inline int setenv(const char *name, const char *value, int overwrite) {
	return nut_setenv(name, value, overwrite);
}
#endif

#ifdef __hpux
#ifdef HAVE_SYS_MODEM_H
#include <sys/modem.h>
#endif
/* See sys/termio.h and sys/modem.h
   The following serial bits are not defined by HPUX.
   The numbers are octal like I found in BSD.
   TIOCM_ST is used in genericups.[ch] for the Powerware 3115.
   These defines make it compile, but I have no idea if it works.
 */
#define         TIOCM_LE        0001            /* line enable */
#define         TIOCM_ST        0010            /* secondary transmit */
#define         TIOCM_SR        0020            /* secondary receive */
#endif

#ifdef HAVE_GETPASSPHRASE
#define GETPASS getpassphrase
#else
#define GETPASS getpass
#endif

#ifdef __Lynx__
/* Missing prototypes on LynxOS */
int seteuid(uid_t);
int vprintf(const char *, va_list);
int putenv(char *);
#endif

#ifdef __cplusplus
/* *INDENT-OFF* */
}
/* *INDENT-ON* */
#endif

#endif /* PROTO_H */