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
|
/*********************************************************
* Copyright (C) 2008 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation version 2.1 and no later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
*********************************************************/
/*
* stub-msgfmt-fbsd.c --
*
* FreeBSD-specific stubs for lib/misc/msgfmt.c. This stubs out two
* specific funtions in that file - MsgFmt_Asprintf and MsgFmt_Snprintf,
* which don't have FreeBSD implementations in our code base.
*
* Tools don't really use the Msg_* functions for error reporting and etc,
* so this is easier than getting all that stuff to compile on FreeBSD.
*
* The stubs won't assert, but they're sort of dumb: they'll just
* print the format string with no substitutions to the output.
*/
#include "msgfmt.h"
#include "str.h"
int
MsgFmt_Snprintf(char *buf, // OUT: formatted string
size_t size, // IN: size of buffer
const char *format, // IN: format
const MsgFmt_Arg *args, // IN: message arguments
int numArgs) // IN: number of arguments
{
return Str_Snprintf(buf, size, "%s", format);
}
char *
MsgFmt_Asprintf(size_t *length, // OUT: length of returned string
const char *format, // IN: format
const MsgFmt_Arg *args, // IN: message arguments
int numArgs) // IN: number of arguments
{
return Str_Asprintf(length, "%s", format);
}
|