Logo AND Algorithmique Numérique Distribuée

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