Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
a79815f01765b634b639e7f483e169872404f05f
[simgrid.git] / src / xbt / module.c
1 /* $Id$ */
2
3 /* module handling                                                          */
4
5 /* Copyright (c) 2003, 2004 Martin Quinson. 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 #include "xbt/sysdep.h"
11 #include "xbt/log.h"
12 #include "xbt/error.h"
13 #include "xbt/dynar.h"
14 #include "xbt/config.h"
15
16 #include "xbt/module.h" /* this module */
17
18 #include "xbt_modinter.h"  /* prototype of other module's init/exit in XBT */
19
20 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(module,xbt, "module handling");
21
22 struct xbt_module_ {
23   xbt_dynar_t *deps;
24   xbt_cfg_t *cfg;
25   int ref;
26   xbt_module_new_fct_t new;
27   xbt_module_finalize_fct_t finalize;
28 };
29
30 /** @brief Initialize the xbt mechanisms. */
31 void 
32 xbt_init(int *argc, char **argv) {
33   static short int first_run = 1;
34   if (!first_run)
35     return;
36   
37   first_run = 0;
38   VERB0("Initialize XBT");
39   
40   xbt_log_init(argc,argv);
41 }
42
43 /** @brief Finalize the xbt mechanisms. */
44 void 
45 xbt_exit(){
46   xbt_log_exit();
47 }
48