home *** CD-ROM | disk | FTP | other *** search
/ Amiga Times / AmigaTimes.iso / spiele / FreeCiv / src / freeciv-1.7.0 / server / registry.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-10-06  |  1.9 KB  |  72 lines

  1. /********************************************************************** 
  2.  Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
  3.    This program is free software; you can redistribute it and/or modify
  4.    it under the terms of the GNU General Public License as published by
  5.    the Free Software Foundation; either version 2, or (at your option)
  6.    any later version.
  7.  
  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.
  12. ***********************************************************************/
  13. #ifndef __REGISTRY_H
  14. #define __REGISTRY_H
  15.  
  16. #include "genlist.h"
  17.  
  18.  
  19. struct section_file {
  20.   struct genlist section_list;
  21. };
  22.  
  23.  
  24. struct section {
  25.   char *name;
  26.   struct genlist entry_list;
  27. };
  28.  
  29.  
  30. struct section_entry {
  31.   char *name;
  32.   int  ivalue;
  33.   char *svalue;
  34. };
  35.  
  36.  
  37. void secfile_insert_int(struct section_file *my_section_file, 
  38.             int val, char *path, ...);
  39.  
  40. void secfile_insert_str(struct section_file *my_section_file, 
  41.             char *sval, char *path, ...);
  42.  
  43.  
  44.  
  45. int section_file_load(struct section_file *my_section_file, char *filename);
  46. int section_file_save(struct section_file *my_section_file, char *filename);
  47. void section_file_free(struct section_file *file);
  48.  
  49. void section_file_init(struct section_file *file);
  50.  
  51.  
  52. int secfile_lookup_int(struct section_file *my_section_file, 
  53.                char *path, ...);
  54.  
  55. char *secfile_lookup_str(struct section_file *my_section_file, 
  56.              char *path, ...);
  57.  
  58. int section_file_lookup(struct section_file *my_section_file, 
  59.             char *path, ...);
  60.  
  61. struct section_entry *section_file_lookup_internal(struct section_file 
  62.                            *my_section_file,  
  63.                            char *fullpath);
  64.  
  65.  
  66. struct section_entry *section_file_insert_internal(struct section_file 
  67.                            *my_section_file, 
  68.                            char *fullpath);
  69.  
  70. #endif
  71.  
  72.