1 /* 2 * rarian-reg-utils.h 3 * This file is part of Rarian 4 * 5 * Copyright (C) 2006 - Don Scorgie 6 * 7 * Rarian is free software; you can redistribute it and/or 8 * modify it under the terms of the GNU Lesser General Public 9 * License as published by the Free Software Foundation; either 10 * version 2.1 of the License, or (at your option) any later version. 11 * 12 * Rarian is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 * Lesser General Public License for more details. 16 * 17 * You should have received a copy of the GNU Lesser General Public 18 * License along with this library; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 */ 21 22 #ifndef __RARIAN_REG_UTILS_H 23 #define __RARIAN_REG_UTILS_H 24 25 #ifndef I_KNOW_RARIAN_0_8_IS_UNSTABLE 26 #error Rarian is unstable. To use it, you must acknowledge that 27 #endif 28 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 33 typedef struct _RrnReg RrnReg; 34 typedef struct _RrnSect RrnSect; 35 36 struct _RrnReg 37 { 38 char *name; 39 char *uri; 40 char *comment; 41 char *identifier; 42 char *type; 43 char *icon; 44 char **categories; 45 int weight; 46 char *heritage; 47 char *omf_location; 48 char *ghelp_name; 49 char *lang; 50 char *default_section; 51 int hidden; 52 RrnSect *children; 53 }; 54 55 struct _RrnSect 56 { 57 char *name; 58 char *identifier; 59 char *uri; 60 char *owner; 61 RrnSect *next; 62 RrnSect *prev; 63 RrnSect *children; 64 65 /* Used internally to determine whether to overwrite 66 * the section 67 */ 68 int priority; 69 }; 70 71 RrnReg * rrn_reg_new (); 72 RrnSect * rrn_sect_new (); 73 74 RrnReg * rrn_reg_parse_file (char *filename); 75 RrnSect * rrn_sect_parse_file (char *filename); 76 77 RrnSect * rrn_reg_add_sections (RrnReg *reg, RrnSect *sects); 78 79 void rrn_reg_free (RrnReg *reg); 80 void rrn_sect_free (RrnSect *sect); 81 82 #ifdef __cplusplus 83 } 84 #endif 85 86 #endif /*__RARIAN_REG_UTILS_H */ 87