Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / include / ircd_snprintf.h
1 #ifndef INCLUDED_ircd_snprintf_h
2 #define INCLUDED_ircd_snprintf_h
3 /*
4  * IRC - Internet Relay Chat, include/ircd_snprintf.h
5  * Copyright (C) 2000 Kevin L. Mitchell <klmitch@mit.edu>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  *
21  * $Id$
22  */
23 #ifndef INCLUDED_config_h
24 #include "config.h"
25 #endif
26 #ifndef INCLUDED_sys_types_h
27 #include <sys/types.h>
28 #define INCLUDED_sys_types_h
29 #endif
30 #ifndef INCLUDED_stdarg_h
31 #include <stdarg.h>
32 #define INCLUDED_stdarg_h
33 #endif
34
35 struct Client;
36
37 /* structure passed as argument for %v conversion */
38 struct VarData {
39   size_t        vd_chars;       /* number of characters inserted */
40   size_t        vd_overflow;    /* number of characters that couldn't be */
41   const char   *vd_format;      /* format string */
42   va_list       vd_args;        /* arguments for %v */
43 };
44
45 extern int ircd_snprintf(struct Client *dest, char *buf, size_t buf_len,
46                          const char *format, ...);
47 extern int ircd_vsnprintf(struct Client *dest, char *buf, size_t buf_len,
48                           const char *format, va_list args);
49
50 #endif /* INCLUDED_ircd_snprintf_h */