snprintf: fix namespace of snprintf types for freebsd
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 21 Feb 2012 02:18:20 +0000 (21:18 -0500)
committerChristian Babeux <christian.babeux@efficios.com>
Tue, 27 Nov 2012 19:55:34 +0000 (14:55 -0500)
commit 002e1fde60208d5eea1cfde037672ac23422d8c3 upstream.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Christian Babeux <christian.babeux@efficios.com>
snprintf/fflush.c
snprintf/fileext.h
snprintf/fvwrite.c
snprintf/fvwrite.h
snprintf/local.h
snprintf/snprintf.c
snprintf/various.h
snprintf/vfprintf.c
snprintf/wsetup.c

index fc52bb300f678df0fcde1253fca78083070e039a..32cc6602ea91aae89fd4a94e9c7794b83aa2a3ab 100644 (file)
@@ -36,7 +36,7 @@
 #include "local.h"
 
 /* Flush a single file, or (if fp is NULL) all files.  */
-int ust_safe_fflush(LFILE *fp)
+int ust_safe_fflush(LTTNG_UST_LFILE *fp)
 {
 
        if (fp == NULL)
@@ -50,7 +50,7 @@ int ust_safe_fflush(LFILE *fp)
 }
 
 int
-__sflush(LFILE *fp)
+__sflush(LTTNG_UST_LFILE *fp)
 {
        unsigned char *p;
        int n, t;
index 2d070430248d28971c43db9216fe1fa7f7ba51cd..422cf8234a92902e546936969e8b5abd8377b9c4 100644 (file)
 /*
  * file extension
  */
-struct __sfileext {
-       struct  __sbuf _ub; /* ungetc buffer */
+struct __lttng_ust_sfileext {
+       struct  __lttng_ust_sbuf _ub; /* ungetc buffer */
        struct wchar_io_data _wcio;     /* wide char io status */
 };
 
-#define _EXT(fp) ((struct __sfileext *)((fp)->_ext._base))
+#define _EXT(fp) ((struct __lttng_ust_sfileext *)((fp)->_ext._base))
 #define _UB(fp) _EXT(fp)->_ub
 
 #define _FILEEXT_INIT(fp) \
index 62f713e073a9f9a53353777c40c85a09f982e9bb..fb075f1ba90014eb8ac8059644b77df48caeab8f 100644 (file)
  * to the three different kinds of output buffering is handled here.
  */
 int
-__sfvwrite(LFILE *fp, struct __suio *uio)
+__sfvwrite(LTTNG_UST_LFILE *fp, struct __lttng_ust_suio *uio)
 {
        size_t len;
        char *p;
-       struct __siov *iov;
+       struct __lttng_ust_siov *iov;
        int w, s;
        char *nl;
        int nlknown, nldist;
index 19b633dbd42263b4d13c1ea3b73d0fb3b94cf16d..6553621213c109bbc1cd2009a23d068478e6ca8c 100644 (file)
 /*
  * I/O descriptors for __sfvwrite().
  */
-struct __siov {
+struct __lttng_ust_siov {
        void    *iov_base;
        size_t  iov_len;
 };
-struct __suio {
-       struct  __siov *uio_iov;
+struct __lttng_ust_suio {
+       struct  __lttng_ust_siov *uio_iov;
        int     uio_iovcnt;
        int     uio_resid;
 };
 
-extern int __sfvwrite(LFILE *, struct __suio *);
+extern int __sfvwrite(LTTNG_UST_LFILE *, struct __lttng_ust_suio *);
index c322cafc2be57a3e4f6ea2a2597e05ceaf484d55..d9251bf61c8021c5695aa526771d6a3214673442 100644 (file)
 #include "wcio.h"
 #include "fileext.h"
 
-int    __sflush(LFILE *);
-LFILE  *__sfp(void);
-int    __srefill(LFILE *);
+int    __sflush(LTTNG_UST_LFILE *);
+LTTNG_UST_LFILE        *__sfp(void);
+int    __srefill(LTTNG_UST_LFILE *);
 int    __sread(void *, char *, int);
 int    __swrite(void *, const char *, int);
 fpos_t __sseek(void *, fpos_t, int);
 int    __sclose(void *);
 void   __sinit(void);
 void   _cleanup(void);
-void   __smakebuf(LFILE *);
-int    __swhatbuf(LFILE *, size_t *, int *);
-int    _fwalk(int (*)(LFILE *));
-int    __swsetup(LFILE *);
+void   __smakebuf(LTTNG_UST_LFILE *);
+int    __swhatbuf(LTTNG_UST_LFILE *, size_t *, int *);
+int    _fwalk(int (*)(LTTNG_UST_LFILE *));
+int    __swsetup(LTTNG_UST_LFILE *);
 int    __sflags(const char *, int *);
-wint_t __fgetwc_unlock(LFILE *);
+wint_t __fgetwc_unlock(LTTNG_UST_LFILE *);
 
 extern void __atexit_register_cleanup(void (*)(void));
 extern int __sdidinit;
 
 /*
- * Return true if the given LFILE cannot be written now.
+ * Return true if the given LTTNG_UST_LFILE cannot be written now.
  */
 #define        cantwrite(fp) \
        ((((fp)->_flags & __SWR) == 0 || (fp)->_bf._base == NULL) && \
index b0ea5d3b0373cd46e282335d303beb136e1f21f4..bbc66a0743982a6bde5a925a689dbbaa4a7a441e 100644 (file)
@@ -42,8 +42,8 @@ int ust_safe_vsnprintf(char *str, size_t n, const char *fmt, va_list ap)
 {
        int ret;
        char dummy;
-       LFILE f;
-       struct __sfileext fext;
+       LTTNG_UST_LFILE f;
+       struct __lttng_ust_sfileext fext;
 
        /* While snprintf(3) specifies size_t stdio uses an int internally */
        if (n > INT_MAX)
index 882f517e7cc099ec781ece3b365dafb8f86e3991..30bedd048be2e9558762e8b13dce9b13c57dfb54 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <stdarg.h>
 
-struct __sbuf {
+struct __lttng_ust_sbuf {
         unsigned char *_base;
         int     _size;
 };
@@ -64,13 +64,13 @@ struct __sbuf {
  * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
  * _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
  */
-typedef struct __sFILE {
+typedef struct __lttng_ust_sFILE {
         unsigned char *_p;      /* current position in (some) buffer */
         int     _r;             /* read space left for getc() */
         int     _w;             /* write space left for putc() */
         short   _flags;         /* flags, below; this FILE is free if 0 */
         short   _file;          /* fileno, if Unix descriptor, else -1 */
-        struct  __sbuf _bf;     /* the buffer (at least 1 byte, if !NULL) */
+        struct  __lttng_ust_sbuf _bf;     /* the buffer (at least 1 byte, if !NULL) */
         int     _lbfsize;       /* 0 or -_bf._size, for inline putc */
 
         /* operations */
@@ -81,7 +81,7 @@ typedef struct __sFILE {
         int     (*_write)(void *, const char *, int);
 
         /* extension data, to avoid further ABI breakage */
-        struct  __sbuf _ext;
+        struct  __lttng_ust_sbuf _ext;
         /* data for long sequences of ungetc() */
         unsigned char *_up;     /* saved _p when _p is doing ungetc data */
         int     _ur;            /* saved _r when _r is counting ungetc data */
@@ -91,12 +91,12 @@ typedef struct __sFILE {
         unsigned char _nbuf[1]; /* guarantee a getc() buffer */
 
         /* separate buffer for fgetln() when line crosses buffer boundary */
-        struct  __sbuf _lb;     /* buffer for fgetln() */
+        struct  __lttng_ust_sbuf _lb;     /* buffer for fgetln() */
 
         /* Unix stdio files get aligned to block boundaries on fseek() */
         int     _blksize;       /* stat.st_blksize (may be != _bf._size) */
         fpos_t  _offset;        /* current lseek offset */
-} LFILE;
+} LTTNG_UST_LFILE;
 
 #define __SLBF  0x0001          /* line buffered */
 #define __SNBF  0x0002          /* unbuffered */
@@ -117,8 +117,8 @@ typedef struct __sFILE {
 
 #define __sferror(p)    (((p)->_flags & __SERR) != 0)
 
-extern int ust_safe_fflush(LFILE *fp);
-extern int ust_safe_vfprintf(LFILE *fp, const char *fmt0, va_list ap);
+extern int ust_safe_fflush(LTTNG_UST_LFILE *fp);
+extern int ust_safe_vfprintf(LTTNG_UST_LFILE *fp, const char *fmt0, va_list ap);
 
 extern size_t ust_safe_mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps);
 
index 1b8fba6721a8d1af6ed806959c1f2daf11c5d8e3..cedd4fb7eb9e408c498b3ba901cd4180ef0d4569 100644 (file)
@@ -92,7 +92,7 @@ static int __grow_type_table(unsigned char **typetable, int *tablesize);
  * then reset it so that it can be reused.
  */
 static int
-__sprint(LFILE *fp, struct __suio *uio)
+__sprint(LTTNG_UST_LFILE *fp, struct __lttng_ust_suio *uio)
 {
        int err;
 
@@ -112,10 +112,10 @@ __sprint(LFILE *fp, struct __suio *uio)
  * worries about ungetc buffers and so forth.
  */
 //static int
-//__sbprintf(LFILE *fp, const char *fmt, va_list ap)
+//__sbprintf(LTTNG_UST_LFILE *fp, const char *fmt, va_list ap)
 //{
 //     int ret;
-//     LFILE fake;
+//     LTTNG_UST_LFILE fake;
 //     struct __sfileext fakeext;
 //     unsigned char buf[BUFSIZ];
 //
@@ -189,13 +189,13 @@ static int exponent(char *, int, int);
 #define CHARINT                0x0800          /* 8 bit integer */
 #define MAXINT         0x1000          /* largest integer size (intmax_t) */
 
-int ust_safe_vfprintf(LFILE *fp, const char *fmt0, va_list ap)
+int ust_safe_vfprintf(LTTNG_UST_LFILE *fp, const char *fmt0, va_list ap)
 {
        char *fmt;              /* format string */
        int ch;                 /* character from fmt */
        int n, n2;              /* handy integers (short term usage) */
        char *cp;               /* handy char pointer (short term usage) */
-       struct __siov *iovp;    /* for PRINT macro */
+       struct __lttng_ust_siov *iovp;  /* for PRINT macro */
        int flags;              /* flags as above */
        int ret;                /* return value accumulator */
        int width;              /* width from format (%8d), or 0 */
@@ -241,8 +241,8 @@ int ust_safe_vfprintf(LFILE *fp, const char *fmt0, va_list ap)
        int size;               /* size of converted field or string */
        const char *xdigs = NULL;       /* digits for %[xX] conversion */
 #define NIOV 8
-       struct __suio uio;      /* output information: summary */
-       struct __siov iov[NIOV];/* ... and individual io vectors */
+       struct __lttng_ust_suio uio;    /* output information: summary */
+       struct __lttng_ust_siov iov[NIOV];/* ... and individual io vectors */
        char buf[BUF];          /* buffer with space for digits of uintmax_t */
        char ox[2];             /* space for 0x; ox[1] is either x, X, or \0 */
        union arg *argtable;    /* args, built due to positional arg */
index 433df29870db8feb8b84efecbe9efbfcd072b468..a15b8eaa2a2c98d05a593af48943077ff230f354 100644 (file)
@@ -42,7 +42,7 @@
  * _wsetup returns 0 if OK to write, nonzero otherwise.
  */
 int
-__swsetup(LFILE *fp)
+__swsetup(LTTNG_UST_LFILE *fp)
 {
        /* make sure stdio is set up */
 //     if (!__sdidinit)
This page took 0.0308580000000001 seconds and 4 git commands to generate.