[cbeced]: ogg123 / cfgfile_options.h Maximize Restore History

Download this file

cfgfile_options.h    60 lines (49 with data), 1.9 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/********************************************************************
* *
* THIS FILE IS PART OF THE OggVorbis SOFTWARE CODEC SOURCE CODE. *
* USE, DISTRIBUTION AND REPRODUCTION OF THIS SOURCE IS GOVERNED BY *
* THE GNU PUBLIC LICENSE 2, WHICH IS INCLUDED WITH THIS SOURCE. *
* PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
* THE Ogg123 SOURCE CODE IS (C) COPYRIGHT 2000-2001 *
* by Kenneth C. Arnold <ogg@arnoldnet.net> AND OTHER CONTRIBUTORS *
* http://www.xiph.org/ *
* *
********************************************************************
last mod: $Id: cfgfile_options.h,v 1.2 2001/12/19 02:52:53 volsung Exp $
********************************************************************/
#ifndef __CFGFILE_OPTIONS_H__
#define __CFGFILE_OPTIONS_H__
#include <stdio.h>
typedef enum {
opt_type_none = 0,
opt_type_bool,
opt_type_char,
opt_type_string,
opt_type_int, /* long int */
opt_type_float,
opt_type_double
} file_option_type_t;
typedef enum {
parse_ok = 0,
parse_syserr,
parse_keynotfound,
parse_nokey,
parse_badvalue,
parse_badtype
} parse_code_t;
typedef struct file_option_t {
char found;
const char *name;
const char *desc;
file_option_type_t type;
void *ptr;
void *dfl;
} file_option_t;
void file_options_init (file_option_t opts[]);
void file_options_describe (file_option_t opts[], FILE *outfile);
parse_code_t parse_line (file_option_t opts[], char *line);
parse_code_t parse_config_file (file_option_t opts[], const char *filename);
const char *parse_error_string (parse_code_t pcode);
void parse_std_configs (file_option_t opts[]);
#endif /* __OPTIONS_H__ */