1 /* xbt.h - Public interface to the xbt (simgrid's toolbox) */
3 /* Copyright (c) 2004-2015. The SimGrid Team.
4 * All rights reserved. */
6 /* This program is free software; you can redistribute it and/or modify it
7 * under the terms of the license (GNU LGPL) which comes with this package. */
12 #include "simgrid_config.h"
20 /** Cache the size of a memory page for the current system. */
21 XBT_PUBLIC_DATA(int) xbt_pagesize;
23 /** Cache the number of bits of addresses inside a given page, log2(xbt_pagesize). */
24 XBT_PUBLIC_DATA(int) xbt_pagebits;
26 XBT_PUBLIC(const char *) xbt_procname(void);
28 /** Retrieves the version numbers of the used dynamic library (so, DLL or dynlib) , while
29 SIMGRID_VERSION_MAJOR and friends give the version numbers of the used header files */
30 XBT_PUBLIC(void) sg_version(int *major,int *minor,int *patch);
32 /** Helps ensuring that the header version (SIMGRID_VERSION_MAJOR and friends) and the dynamic library version do match. */
33 XBT_PUBLIC(void) sg_version_check(int lib_version_major,int lib_version_minor,int lib_version_patch);
35 /** Contains all the parameters we got from the command line */
36 XBT_PUBLIC_DATA(xbt_dynar_t) sg_cmdline;
38 #define XBT_BACKTRACE_SIZE 10 /* FIXME: better place? Do document */
40 /* snprintf related functions */
41 /** @addtogroup XBT_str
44 /** @brief print to allocated string
46 * Similar to vasprintf(), but returns a pointer to the newly created string (or aborts on error).
48 XBT_PUBLIC(char *) bvprintf(const char *fmt, va_list ap);
49 /** @brief print to allocated string
51 * Similar to asprintf(), but returns a pointer to the newly created string (or aborts on error).
53 XBT_PUBLIC(char *) bprintf(const char *fmt, ...) XBT_ATTRIB_PRINTF(1, 2);
58 #endif /* XBT_MISC_H */