1 /* xbt.h - Public interface to the xbt (SimGrid's toolbox) */
3 /* Copyright (c) 2004-2023. The SimGrid Team. All rights reserved. */
5 /* This program is free software; you can redistribute it and/or modify it
6 * under the terms of the license (GNU LGPL) which comes with this package. */
17 /** Cache the size of a memory page for the current system. */
18 XBT_PUBLIC_DATA const int xbt_pagesize;
20 /** Cache the number of bits of addresses inside a given page, log2(xbt_pagesize). */
21 XBT_PUBLIC_DATA const int xbt_pagebits;
23 /** Helps ensuring that header version (SIMGRID_VERSION_MAJOR and friends) and dynamic library version do match. */
24 XBT_PUBLIC void sg_version_check(int lib_version_major, int lib_version_minor, int lib_version_patch);
26 /* snprintf related functions */
27 /** @addtogroup XBT_str
30 /** @brief print to allocated string
32 * Similar to vasprintf(), but returns a pointer to the newly created string (or aborts on error).
34 XBT_PUBLIC char* bvprintf(const char* fmt, va_list ap) XBT_ATTRIB_PRINTF(1, 0);
35 /** @brief print to allocated string
37 * Similar to asprintf(), but returns a pointer to the newly created string (or aborts on error).
39 XBT_PUBLIC char* bprintf(const char* fmt, ...) XBT_ATTRIB_PRINTF(1, 2);
44 #endif /* XBT_MISC_H */