Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Variables setted by an other file.
[simgrid.git] / include / simgrid_config.h.in
1 /* $Id$ */
2
3 /* simgrid_config.h - Results of the configure made visible to user code    */
4
5 /* Copyright (c) 2009, Da SimGrid team. All rights reserved.                */
6
7 /* This program is free software; you can redistribute it and/or modify it
8  * under the terms of the license (GNU LGPL) which comes with this package. */
9
10 #include "xbt/misc.h"           /* XBT_PUBLIC */
11
12 #ifdef _XBT_DLL_EXPORT
13         #define DLL_EXPORT
14 #else
15         #define DLL_IMPORT
16 #endif
17
18 #ifndef SIMGRID_PUBLIC_CONFIG_H
19 #define SIMGRID_PUBLIC_CONFIG_H
20
21 /* Get the config */
22 #undef SIMGRID_NEED_GETLINE
23 #undef SIMGRID_NEED_ASPRINTF
24 #undef SIMGRID_NEED_VASPRINTF
25 @need_getline@
26 @need_asprintf@
27 @need_vasprintf@
28
29 /* Use that config to declare missing elements */
30 #ifdef SIMGRID_NEED_GETLINE
31 #include <stdlib.h> /* size_t */
32 #include <stdio.h>  /* FILE*  */
33 XBT_PUBLIC(long) getline(char **lineptr, size_t * n, FILE * stream);
34 #else
35 #ifndef _GNU_SOURCE
36         #define _GNU_SOURCE
37 #endif
38 #include <stdio.h>
39 #endif
40
41
42 /* snprintf related functions */
43 /** @addtogroup XBT_str
44   * @{ */
45 /** @brief print to allocated string (reimplemented when not provided by the system)
46  *
47  * The functions asprintf() and vasprintf() are analogues of
48  * sprintf() and vsprintf(), except that they allocate a string large
49  * enough to hold the output including the terminating null byte, and
50  * return a pointer to it via the first parameter.  This pointer
51  * should be passed to free(3) to release the allocated storage when
52  * it is no longer needed.
53  */
54 #if defined(SIMGRID_NEED_ASPRINTF)||defined(DOXYGEN)
55 XBT_PUBLIC(int) asprintf(char **ptr, const char *fmt,   /*args */
56                          ...) _XBT_GNUC_PRINTF(2, 3);
57 #endif
58 /** @brief print to allocated string (reimplemented when not provided by the system)
59  *
60  * See asprintf()
61  */
62 #if defined(SIMGRID_NEED_VASPRINTF)||defined(DOXYGEN)
63 #include <stdarg.h>
64 XBT_PUBLIC(int) vasprintf(char **ptr, const char *fmt, va_list ap);
65 #endif
66 /** @brief print to allocated string
67  *
68  * Works just like asprintf(), but returns a pointer to the newly created string
69  */
70 XBT_PUBLIC(char *) bprintf(const char *fmt, ...) _XBT_GNUC_PRINTF(1, 2);
71 /** @} */
72
73 #endif /* SIMGRID_PUBLIC_CONFIG_H */