3 /* simgrid_config.h - Results of the configure made visible to user code */
5 /* Copyright (c) 2009, Da SimGrid team. All rights reserved. */
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. */
10 #include "xbt/misc.h" /* XBT_PUBLIC */
12 #ifndef SIMGRID_PUBLIC_CONFIG_H
13 #define SIMGRID_PUBLIC_CONFIG_H
16 #undef SIMGRID_NEED_GETLINE
17 #undef SIMGRID_NEED_ASPRINTF
18 #undef SIMGRID_NEED_VASPRINTF
23 /* Use that config to declare missing elements */
24 #ifdef SIMGRID_NEED_GETLINE
25 #include <stdlib.h> /* size_t */
26 #include <stdio.h> /* FILE* */
27 XBT_PUBLIC(long) getline(char **lineptr, size_t * n, FILE * stream);
36 /* snprintf related functions */
37 /** @addtogroup XBT_str
39 /** @brief print to allocated string (reimplemented when not provided by the system)
41 * The functions asprintf() and vasprintf() are analogues of
42 * sprintf() and vsprintf(), except that they allocate a string large
43 * enough to hold the output including the terminating null byte, and
44 * return a pointer to it via the first parameter. This pointer
45 * should be passed to free(3) to release the allocated storage when
46 * it is no longer needed.
48 #if defined(SIMGRID_NEED_ASPRINTF)||defined(DOXYGEN)
49 XBT_PUBLIC(int) asprintf(char **ptr, const char *fmt, /*args */
50 ...) _XBT_GNUC_PRINTF(2, 3);
52 /** @brief print to allocated string (reimplemented when not provided by the system)
56 #if defined(SIMGRID_NEED_VASPRINTF)||defined(DOXYGEN)
58 XBT_PUBLIC(int) vasprintf(char **ptr, const char *fmt, va_list ap);
60 /** @brief print to allocated string
62 * Works just like asprintf(), but returns a pointer to the newly created string
64 XBT_PUBLIC(char *) bprintf(const char *fmt, ...) _XBT_GNUC_PRINTF(1, 2);
67 #endif /* SIMGRID_PUBLIC_CONFIG_H */