/[vps]/baselayout-vserver/trunk/src/core/parse.h
Gentoo

Diff of /baselayout-vserver/trunk/src/core/parse.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 126 Revision 127
1/*
2 * parse.h
3 *
4 * Parser for Gentoo style rc-scripts.
5 *
6 * Copyright (C) 2004,2005 Martin Schlemmer <azarah@nosferatu.za.org>
7 *
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the
11 * Free Software Foundation version 2 of the License.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 675 Mass Ave, Cambridge, MA 02139, USA.
21 *
22 * $Header$
23 */
24
25#ifndef _PARSE_H
26#define _PARSE_H
27
28#include <sys/types.h>
29#include "list.h"
30
31#define RC_CONF_FILE_NAME "/etc/rc.conf"
32#define RC_CONFD_FILE_NAME "/etc/conf.d/rc"
33#define INITD_DIR_NAME "/etc/init.d/"
34#define CONFD_DIR_NAME "/etc/conf.d/"
35
36#define SVCDIR_CONFIG_ENTRY "svcdir"
37
38#define SHELL_PARSER "/bin/bash"
39
40#define LEGACY_CACHE_FILE_NAME "deptree"
41
42#define FIELD_RCSCRIPT "RCSCRIPT"
43#define FIELD_NEED "NEED"
44#define FIELD_USE "USE"
45#define FIELD_BEFORE "BEFORE"
46#define FIELD_AFTER "AFTER"
47#define FIELD_PROVIDE "PROVIDE"
48#define FIELD_FAILED "FAILED"
49
50typedef struct {
51 struct list_head node;
52
53 char *filename;
54 time_t mtime;
55 time_t confd_mtime;
56} rcscript_info_t;
57
58struct list_head rcscript_list;
59
60int get_rcscripts(void);
61int check_rcscripts_mtime(char *cachefile);
62size_t generate_stage1(char **data);
63size_t generate_stage2(char **data);
64size_t read_stage2(char **data);
65int write_stage2(FILE *outfile);
66size_t generate_stage3(char **data);
67size_t read_stage3(char **data);
68int write_stage3(FILE *outfile);
69int write_legacy_stage3(FILE *output);
70int parse_cache(const char *data, size_t lenght);
71
72/*
73 * get_rcscripts()
74 * |
75 * V
76 * check_rcscripts_mtime() ------------------------------> read_stage3()
77 * | |
78 * | |
79 * V V
80 * generate_stage1() (Called by generate_stage2()) parse_cache()
81 * | |
82 * | |
83 * V |
84 * generate_stage2() ----> write_stage2() (Debugging) |
85 * | |
86 * | |
87 * | === parse_cache() |
88 * V | | |
89 * generate_stage3() ==| | |
90 * | | | |
91 * | | V |
92 * | === service_resolve_dependencies() |
93 * | |
94 * | |
95 * |-------> write_legacy_stage3() (Proof of Concept |
96 * | or Debugging) |
97 * | |
98 * V |
99 * write_stage3() |
100 * | |
101 * | V
102 * |<-------------------------------------------------------
103 * |
104 * V
105 *
106 */
107
108#endif /* _PARSE_H */
109

Legend:
Removed from v.126  
changed lines
  Added in v.127

  ViewVC Help
Powered by ViewVC 1.1.20