Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
af16b984b450ea09448457522cceff042b54f4de
[simgrid.git] / include / xbt / misc.h
1 /* $Id$ */
2
3 /* xbt.h - Public interface to the xbt (gras's toolbox)                   */
4
5 /* Authors: Martin Quinson                                                  */
6 /* Copyright (C) 2004 the OURAGAN project.                                  */
7
8 /* This program is free software; you can redistribute it and/or modify it
9    under the terms of the license (GNU LGPL) which comes with this package. */
10
11 #ifndef XBT_MISC_H
12 #define XBT_MISC_H
13
14 #define max(a, b) (((a) > (b))?(a):(b))
15 #define min(a, b) (((a) < (b))?(a):(b))
16
17 #define TRUE  1
18 #define FALSE 0
19
20 #define XBT_MAX_CHANNEL 10 /* FIXME: killme */
21 /*! C++ users need love */
22 #ifndef BEGIN_DECL
23 # ifdef __cplusplus
24 #  define BEGIN_DECL extern "C" {
25 # else
26 #  define BEGIN_DECL 
27 # endif
28 #endif
29
30 /*! C++ users need love */
31 #ifndef END_DECL
32 # ifdef __cplusplus
33 #  define END_DECL }
34 # else
35 #  define END_DECL 
36 # endif
37 #endif
38 /* End of cruft for C++ */
39
40 BEGIN_DECL
41 /* Dunno where to place this: needed by config and amok */
42 typedef struct {  
43    char *name;
44    int port;
45 } xbt_host_t;
46
47 /* pointer to a function freeing something */
48 typedef   void (void_f_ppvoid_t)(void**);
49 typedef   void (void_f_pvoid_t) (void*);
50
51 /* The following two definitions concern the type of the keys used for
52    the heaps. That should be handled via configure (FIXME). */
53 typedef long double xbt_heap_float_t;
54 #define XBT_HEAP_FLOAT_T "%Lg"  /* for printing purposes */
55
56 typedef long double xbt_maxmin_float_t;
57 #define XBT_MAXMIN_FLOAT_T "%Lg"        /* for printing purposes */
58
59
60 END_DECL
61
62 #endif /* XBT_MISC_H */