Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
get rid of xbt_os_thread_yield() using C++11
[simgrid.git] / include / xbt / misc.h
1 /* xbt.h - Public interface to the xbt (simgrid's toolbox)                  */
2
3 /* Copyright (c) 2004-2018. The SimGrid Team. All rights reserved.          */
4
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. */
7
8 #ifndef XBT_MISC_H
9 #define XBT_MISC_H
10
11 #include <simgrid/config.h>
12 #include <xbt/base.h>
13 #include <xbt/dynar.h>
14
15 #include <stdarg.h>
16
17 SG_BEGIN_DECL()
18
19 /** Cache the size of a memory page for the current system. */
20 XBT_PUBLIC_DATA int xbt_pagesize;
21
22 /** Cache the number of bits of addresses inside a given page, log2(xbt_pagesize). */
23 XBT_PUBLIC_DATA int xbt_pagebits;
24
25 /** Helps ensuring that header version (SIMGRID_VERSION_MAJOR and friends) and dynamic library version do match. */
26 XBT_PUBLIC void sg_version_check(int lib_version_major, int lib_version_minor, int lib_version_patch);
27
28 /** Contains all the parameters we got from the command line */
29 XBT_PUBLIC_DATA xbt_dynar_t sg_cmdline;
30
31 /* snprintf related functions */
32 /** @addtogroup XBT_str
33   * @{ */
34
35 /** @brief print to allocated string
36  *
37  * Similar to vasprintf(), but returns a pointer to the newly created string (or aborts on error).
38  */
39 XBT_PUBLIC char* bvprintf(const char* fmt, va_list ap);
40 /** @brief print to allocated string
41  *
42  * Similar to asprintf(), but returns a pointer to the newly created string (or aborts on error).
43  */
44 XBT_PUBLIC char* bprintf(const char* fmt, ...) XBT_ATTRIB_PRINTF(1, 2);
45 /** @} */
46
47 SG_END_DECL()
48
49 #endif                          /* XBT_MISC_H */