new
[libcurl.git] / include / curl / mprintf.h
blob74b95715e2dd99d3c18576a318c2828599615f72
1 /*************************************************************************
3 * $Id: mprintf.h,v 1.1.1.1 1999-12-29 14:21:15 bagder Exp $
5 * The contents of this file are subject to the Mozilla Public License
6 * Version 1.0 (the "License"); you may not use this file except in
7 * compliance with the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS"
11 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
12 * the License for the specific language governing rights and limitations
13 * under the License.
15 * The Original Code is Triacle.
17 * The Initial Developers of the Original Code are Bjorn Reese and
18 * Daniel Stenberg.
20 * Portions created by Initial Developers are
22 * Copyright (C) 1998 Bjorn Reese and Daniel Stenberg.
23 * All Rights Reserved.
25 * Contributor(s):
27 *************************************************************************
29 * Preliminary documentation
31 * printf conversions:
33 * conversion ::= '%%' | '%' [position] ( number | float | string )
34 * position ::= digits '$'
35 * number ::= [number-flags] ( 'd' | 'i' | 'o' | 'x' | 'X' | 'u')
36 * number-flags ::= 'h' | 'l' | 'L' ...
37 * float ::= [float-flags] ( 'f' | 'e' | 'E' | 'g' | 'G' )
38 * string ::= [string-flags] 's'
39 * string-flags ::= padding | '#'
40 * digits ::= (digit)+
41 * digit ::= 0-9
43 * c
44 * p
45 * n
47 * qualifiers
49 * - : left adjustment
50 * + : show sign
51 * SPACE : padding
52 * # : alterative
53 * . : precision
54 * * : width
55 * 0 : padding / size
56 * 1-9 : size
57 * h : short
58 * l : long
59 * ll : longlong
60 * L : long double
61 * Z : long / longlong
62 * q : longlong
64 ************************************************************************/
66 #ifndef H_MPRINTF
67 #define H_MPRINTF
69 #include <stdarg.h>
71 int mprintf(const char *format, ...);
72 int mfprintf(FILE *fd, const char *format, ...);
73 int msprintf(char *buffer, const char *format, ...);
74 int msnprintf(char *buffer, size_t maxlength, const char *format, ...);
75 int mvprintf(const char *format, va_list args);
76 int mvfprintf(FILE *fd, const char *format, va_list args);
77 int mvsprintf(char *buffer, const char *format, va_list args);
78 int mvsnprintf(char *buffer, size_t maxlength, const char *format, va_list args);
79 char *maprintf(const char *format, ...);
80 char *mvaprintf(const char *format, va_list args);
82 #ifdef _MPRINTF_REPLACE
83 # define printf mprintf
84 # define fprintf mfprintf
85 # define sprintf msprintf
86 # define snprintf msnprintf
87 # define vprintf mvprintf
88 # define vfprintf mvfprintf
89 # define vsprintf mvsprintf
90 # define vsnprintf mvsnprintf
91 #endif
93 #endif /* H_MPRINTF */