/* $Id$ */ /* simgrid_config.h - Results of the configure made visible to user code */ /* Copyright (c) 2009, Da SimGrid team. All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it * under the terms of the license (GNU LGPL) which comes with this package. */ #include "xbt/misc.h" /* XBT_PUBLIC */ #ifndef SIMGRID_PUBLIC_CONFIG_H #define SIMGRID_PUBLIC_CONFIG_H /* Get the config */ #undef SIMGRID_NEED_GETLINE #undef SIMGRID_NEED_ASPRINTF #undef SIMGRID_NEED_VASPRINTF @need_getline@ @need_asprintf@ @need_vasprintf@ /* Use that config to declare missing elements */ #ifdef SIMGRID_NEED_GETLINE #include /* size_t */ #include /* FILE* */ XBT_PUBLIC(long) getline(char **lineptr, size_t * n, FILE * stream); #else #define _GNU_SOURCE #include #endif /* snprintf related functions */ /** @addtogroup XBT_str * @{ */ /** @brief print to allocated string (reimplemented when not provided by the system) * * The functions asprintf() and vasprintf() are analogues of * sprintf() and vsprintf(), except that they allocate a string large * enough to hold the output including the terminating null byte, and * return a pointer to it via the first parameter. This pointer * should be passed to free(3) to release the allocated storage when * it is no longer needed. */ #if defined(SIMGRID_NEED_ASPRINTF)||defined(DOXYGEN) XBT_PUBLIC(int) asprintf(char **ptr, const char *fmt, /*args */ ...) _XBT_GNUC_PRINTF(2, 3); #endif /** @brief print to allocated string (reimplemented when not provided by the system) * * See asprintf() */ #if defined(SIMGRID_NEED_VASPRINTF)||defined(DOXYGEN) XBT_PUBLIC(int) vasprintf(char **ptr, const char *fmt, va_list ap); #endif /** @brief print to allocated string * * Works just like asprintf(), but returns a pointer to the newly created string */ XBT_PUBLIC(char *) bprintf(const char *fmt, ...) _XBT_GNUC_PRINTF(1, 2); /** @} */ #endif /* SIMGRID_PUBLIC_CONFIG_H */