source: tags/arb-6.0.3/ARBDB/ad_config.h

Last change on this file was 11165, checked in by westram, 10 years ago
  • stuffed leak in "rename species"
  • Note: atm all unittests pass with valgrind activated
  • 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(struct 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);
35void        GBT_free_configuration_data(GBT_config *data);
36GB_ERROR    GBT_save_configuration_data(GBT_config *data, GBDATA *gb_main, const char *name);
37
38enum GBT_CONFIG_ITEM_TYPE {
39    CI_UNKNOWN       = 1,
40    CI_GROUP         = 2,
41    CI_FOLDED_GROUP  = 4,
42    CI_SPECIES       = 8,
43    CI_SAI           = 16,
44    CI_CLOSE_GROUP   = 32,
45    CI_END_OF_CONFIG = 64,
46};
47
48struct GBT_config_item {
49    GBT_CONFIG_ITEM_TYPE  type;
50    char                 *name;
51};
52
53struct GBT_config_parser {
54    char *config_string;
55    int   parse_pos;
56};
57
58GBT_config_parser *GBT_start_config_parser(const char *config_string);
59void               GBT_free_config_parser(GBT_config_parser *parser);
60
61GB_ERROR         GBT_parse_next_config_item(GBT_config_parser *parser, GBT_config_item *item);
62void             GBT_append_to_config_string(const GBT_config_item *item, struct GBS_strstruct *strstruct);
63
64GBT_config_item *GBT_create_config_item();
65void             GBT_free_config_item(GBT_config_item *item);
66
67#if defined(DEBUG)
68void GBT_test_config_parser(GBDATA *gb_main);
69#endif // DEBUG
70
71#else
72#error ad_config.h included twice
73#endif // AD_CONFIG_H
74
Note: See TracBrowser for help on using the repository browser.