source: tags/svn.1.5.4/ARBDB/ad_config.h

Last change on this file was 8309, checked in by westram, 14 years ago
  • moved much code into static scope

(partly reverted by [8310])

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.5 KB
Line 
1// ==================================================================== //
2//                                                                      //
3//   File      : ad_config.h                                            //
4//   Purpose   : Read/write editor configurations                       //
5//                                                                      //
6//                                                                      //
7// Coded by Ralf Westram (coder@reallysoft.de) in May 2005              //
8// Copyright Department of Microbiology (Technical University Munich)   //
9//                                                                      //
10// Visit our web site at: http://www.arb-home.de/                       //
11//                                                                      //
12// ==================================================================== //
13
14#ifndef AD_CONFIG_H
15#define AD_CONFIG_H
16
17#ifndef ARBDB_BASE_H
18#include "arbdb_base.h"
19#endif
20
21#define CONFIG_DATA_PATH "configuration_data"
22#define CONFIG_ITEM      "configuration"
23
24GBDATA *GBT_find_configuration(GBDATA *gb_main, const char *name);
25GBDATA *GBT_create_configuration(GBDATA *gb_main, const char *name);
26
27void GBT_get_configuration_names(class ConstStrArray& configNames, GBDATA *gb_main);
28
29struct GBT_config {
30    char *top_area;
31    char *middle_area;
32};
33
34GBT_config *GBT_load_configuration_data(GBDATA *gb_main, const char *name, GB_ERROR *error);
35GB_ERROR GBT_save_configuration_data(GBT_config *data, GBDATA *gb_main, const char *name);
36
37enum GBT_CONFIG_ITEM_TYPE {
38    CI_UNKNOWN       = 1,
39    CI_GROUP         = 2,
40    CI_FOLDED_GROUP  = 4,
41    CI_SPECIES       = 8,
42    CI_SAI           = 16,
43    CI_CLOSE_GROUP   = 32,
44    CI_END_OF_CONFIG = 64,
45};
46
47struct GBT_config_item {
48    GBT_CONFIG_ITEM_TYPE  type;
49    char                 *name;
50};
51
52struct GBT_config_parser {
53    char *config_string;
54    int   parse_pos;
55};
56
57GBT_config_parser *GBT_start_config_parser(const char *config_string);
58void               GBT_free_config_parser(GBT_config_parser *parser);
59
60GB_ERROR         GBT_parse_next_config_item(GBT_config_parser *parser, GBT_config_item *item);
61void             GBT_append_to_config_string(const GBT_config_item *item, struct GBS_strstruct *strstruct);
62
63GBT_config_item *GBT_create_config_item();
64void             GBT_free_config_item(GBT_config_item *item);
65
66#if defined(DEBUG)
67void GBT_test_config_parser(GBDATA *gb_main);
68#endif // DEBUG
69
70#else
71#error ad_config.h included twice
72#endif // AD_CONFIG_H
73
Note: See TracBrowser for help on using the repository browser.