head 1.60;
access;
symbols
OSSP_RC_0_7_3:1.59
OSSP_RC_0_7_2:1.59
OSSP_RC_0_7_1:1.59
OSSP_RC_ALPHA_06:1.46
OSSP_RC_EXBROKEN:1.46
OSSP_RC_SPEC:1.3;
locks; strict;
comment @ * @;
1.60
date 2003.07.11.14.13.16; author ms; state Exp;
branches;
next 1.59;
1.59
date 2003.07.07.13.30.51; author ms; state Exp;
branches;
next 1.58;
1.58
date 2003.07.07.12.55.42; author ms; state Exp;
branches;
next 1.57;
1.57
date 2003.07.02.15.31.38; author ms; state Exp;
branches;
next 1.56;
1.56
date 2003.07.01.13.26.25; author ms; state Exp;
branches;
next 1.55;
1.55
date 2003.06.30.15.27.38; author ms; state Exp;
branches;
next 1.54;
1.54
date 2003.06.30.15.09.46; author ms; state Exp;
branches;
next 1.53;
1.53
date 2003.06.30.14.43.36; author ms; state Exp;
branches;
next 1.52;
1.52
date 2003.06.27.14.26.13; author ms; state Exp;
branches;
next 1.51;
1.51
date 2003.06.26.18.45.14; author ms; state Exp;
branches;
next 1.50;
1.50
date 2003.06.23.16.09.47; author ms; state Exp;
branches;
next 1.49;
1.49
date 2003.06.18.14.35.29; author ms; state Exp;
branches;
next 1.48;
1.48
date 2003.06.13.18.33.07; author ms; state Exp;
branches;
next 1.47;
1.47
date 2003.06.11.16.18.48; author ms; state Exp;
branches;
next 1.46;
1.46
date 2003.05.21.12.49.20; author ms; state Exp;
branches;
next 1.45;
1.45
date 2003.05.20.15.06.41; author ms; state Exp;
branches;
next 1.44;
1.44
date 2003.05.20.11.46.25; author ms; state Exp;
branches;
next 1.43;
1.43
date 2003.05.16.18.43.30; author ms; state Exp;
branches;
next 1.42;
1.42
date 2003.05.15.22.22.30; author ms; state Exp;
branches;
next 1.41;
1.41
date 2003.05.15.12.49.11; author ms; state Exp;
branches;
next 1.40;
1.40
date 2003.05.14.16.36.28; author ms; state Exp;
branches;
next 1.39;
1.39
date 2003.04.03.12.05.14; author ms; state Exp;
branches;
next 1.38;
1.38
date 2002.08.02.16.38.09; author ms; state Exp;
branches;
next 1.37;
1.37
date 2002.07.30.16.36.41; author ms; state Exp;
branches;
next 1.36;
1.36
date 2002.07.29.16.34.58; author ms; state Exp;
branches;
next 1.35;
1.35
date 2002.07.04.16.49.58; author ms; state Exp;
branches;
next 1.34;
1.34
date 2002.07.01.15.03.32; author ms; state Exp;
branches;
next 1.33;
1.33
date 2002.06.28.17.43.23; author ms; state Exp;
branches;
next 1.32;
1.32
date 2002.06.28.14.20.23; author ms; state Exp;
branches;
next 1.31;
1.31
date 2002.06.27.15.35.58; author ms; state Exp;
branches;
next 1.30;
1.30
date 2002.06.26.14.42.53; author ms; state Exp;
branches;
next 1.29;
1.29
date 2002.06.26.14.11.16; author ms; state Exp;
branches;
next 1.28;
1.28
date 2002.05.23.18.03.20; author ms; state Exp;
branches;
next 1.27;
1.27
date 2002.05.22.16.01.49; author ms; state Exp;
branches;
next 1.26;
1.26
date 2002.05.22.13.29.40; author ms; state Exp;
branches;
next 1.25;
1.25
date 2002.05.13.16.57.00; author ms; state Exp;
branches;
next 1.24;
1.24
date 2002.04.25.16.17.57; author ms; state Exp;
branches;
next 1.23;
1.23
date 2002.04.25.09.51.29; author ms; state Exp;
branches;
next 1.22;
1.22
date 2002.04.24.16.47.07; author ms; state Exp;
branches;
next 1.21;
1.21
date 2002.04.23.12.30.29; author ms; state Exp;
branches;
next 1.20;
1.20
date 2002.04.22.15.22.39; author ms; state Exp;
branches;
next 1.19;
1.19
date 2002.04.22.12.16.39; author ms; state Exp;
branches;
next 1.18;
1.18
date 2002.04.12.19.15.12; author ms; state Exp;
branches;
next 1.17;
1.17
date 2002.04.11.16.52.45; author ms; state Exp;
branches;
next 1.16;
1.16
date 2002.04.09.17.06.17; author ms; state Exp;
branches;
next 1.15;
1.15
date 2002.04.09.17.01.54; author ms; state Exp;
branches;
next 1.14;
1.14
date 2002.03.26.17.11.06; author ms; state Exp;
branches;
next 1.13;
1.13
date 2002.03.01.22.48.23; author ms; state Exp;
branches;
next 1.12;
1.12
date 2002.02.28.18.24.04; author ms; state Exp;
branches;
next 1.11;
1.11
date 2002.02.28.15.30.04; author ms; state Exp;
branches;
next 1.10;
1.10
date 2002.02.08.18.36.40; author ms; state Exp;
branches;
next 1.9;
1.9
date 2002.02.07.12.38.32; author ms; state Exp;
branches;
next 1.8;
1.8
date 2002.02.06.18.16.40; author ms; state Exp;
branches;
next 1.7;
1.7
date 2002.02.05.20.37.34; author ms; state Exp;
branches;
next 1.6;
1.6
date 2002.02.05.17.29.17; author ms; state Exp;
branches;
next 1.5;
1.5
date 2002.02.04.22.35.20; author ms; state Exp;
branches;
next 1.4;
1.4
date 2002.02.04.21.48.22; author ms; state Exp;
branches;
next 1.3;
1.3
date 2002.01.22.22.53.47; author ms; state Exp;
branches;
next 1.2;
1.2
date 2002.01.08.15.49.02; author ms; state Exp;
branches;
next 1.1;
1.1
date 2002.01.04.17.14.45; author openpkg-cvs; state Exp;
branches;
next ;
desc
@@
1.60
log
@Flush of configuration changes before upcoming configuration structure is
completed.
@
text
@/* OSSP rc - Run-Command Processor
** Copyright (c) 2002-2003 Ralf S. Engelschall
** Copyright (c) 2002-2003 Cable & Wireless Deutschland GmbH
** Copyright (c) 2002-2003 The OSSP Project
**
** This file is part of OSSP rc, a portable run-command processor
** which can be found at http://www.ossp.org/pkg/lib/rc/
**
** Permission to use, copy, modify, and distribute this software for
** any purpose with or without fee is hereby granted, provided that
** the above copyright notice and this permission notice appear in all
** copies.
**
** THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
** WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
** IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
** CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
** USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
** OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
** SUCH DAMAGE.
**
** rc.h: Run-Command Processor ISO C public header file
*/
#ifndef __OSSPRC_H__
#define __OSSPRC_H__
/* compensate for poor standard environments */
#ifndef NULL
#define NULL (void *)0
#endif
#ifndef FALSE
#define FALSE (0)
#endif
#ifndef TRUE
#define TRUE (!FALSE)
#endif
/* Return and error code macro helpers */
#define WARNING(scode) (scode >= RC_WRN_0)
#define FAILED(scode) ((scode >= RC_ERR_0) && !WARNING(scode))
#define SUCCEEDED(scode) ((scode == RC_OK) || WARNING(scode))
#include "rc_private.h"
/* Rc return codes */
typedef enum {
RC_OK = 0, /* Success */
RC_ERR_0 = 1, /* Error base */
RC_ERR_USE = 2, /* Usage error */
RC_ERR_MEM = 3, /* Memory error */
RC_ERR_SYS = 4, /* System error (see errno) */
RC_ERR_IO = 5, /* Input/output error */
RC_ERR_INT = 6, /* Internal error */
RC_ERR_FNC = 7, /* Func file not found */
RC_ERR_LOC = 8, /* Location dir not found */
RC_ERR_TMP = 9, /* Temporary dir not found */
RC_ERR_RCF = 10, /* Rc file not found */
RC_ERR_TRM = 11, /* Request to terminate app */
RC_ERR_CFG = 12, /* Config or option failure */
RC_ERR_ROOT = 13, /* Process must run as root */
RC_WRN_0 = 14, /* Warning base */
RC_WRN_OWR = 15, /* Overwrite warning */
RC_WRN_NUL = 16 /* NULL pointer warning */
} rc_return_t;
/* Config function prototypes */
rc_return_t configNew(void);
rc_return_t configLoad(int, const char **);
rc_return_t configInfo(void);
rc_return_t configVerify(void);
rc_return_t configDefaults(void);
rc_return_t configDelete(void);
/* Config accessor prototypes */
const char *configGetval(rc_opt_t);
const char *configGetname(rc_opt_t);
const char *configGetrcfile(void);
const char **configGetsecs(void);
/* Command line function prototypes */
rc_cliopt_t *clioptNew(void);
rc_return_t clioptPrintusage(rc_cliopt_t *);
rc_return_t clioptProcess(rc_cliopt_t *, int, const char *);
rc_return_t clioptParseopts(rc_cliopt_t *, int, const char **);
rc_return_t clioptParseargs(rc_cliopt_t *);
rc_return_t clioptDelete(rc_cliopt_t *);
/* Command line accessor prototypes */
const char *clioptGetval(rc_cliopt_t *, rc_opt_t);
const char *clioptGetrcfile(rc_cliopt_t *);
const char **clioptGetsecs(rc_cliopt_t *);
rc_return_t clioptSetval(rc_cliopt_t *, rc_opt_t, const char *);
rc_return_t clioptSetrcfile(rc_cliopt_t *, const char *);
rc_return_t clioptSetsecs(rc_cliopt_t *, const char **);
/* List function prototypes */
rc_list_t *listNew(void);
rc_return_t listDelete(rc_list_t *);
rc_file_t *listGetrcfile(rc_list_t *, const char *);
rc_return_t listPopulate(rc_list_t *, const char *);
/* Script function prototypes */
rc_script_t *scriptNew(void);
rc_script_t *scriptCopy(rc_script_t *);
rc_return_t scriptAdd(rc_script_t *, rc_script_t *);
rc_return_t scriptnAppend(rc_script_t *, const char *, size_t);
rc_section_t *scriptSection(rc_script_t *, const char *);
rc_return_t scriptDump(rc_script_t *);
rc_return_t scriptWrite(rc_script_t *, const char *);
const char *scriptGetdata(rc_script_t *);
rc_return_t scriptSetdata(rc_script_t *, const char *);
rc_return_t scriptDelete(rc_script_t *);
/* Rcfile function prototypes */
rc_file_t *rcfileNew(const char *);
rc_return_t rcfileParse(rc_file_t *);
rc_section_t *rcfileGetsec(rc_file_t *, const char *);
rc_return_t rcfileAppendsec(rc_file_t *, rc_section_t *);
const char *rcfileGetname(rc_file_t *);
rc_return_t rcfileSetname(rc_file_t *, const char *);
short rcfileExists(rc_file_t *);
rc_return_t rcfileDelete(rc_file_t *);
/* Section function prototypes */
rc_section_t *sectionNew(const char *);
rc_section_t *sectionCopy(rc_section_t *);
const int sectionGetpri(rc_section_t *);
const int sectionGetuid(rc_section_t *);
const char *sectionGetname(rc_section_t *);
const char *sectionGetparent(rc_section_t *);
const char *sectionGetlabel(rc_section_t *);
const char *sectionGetlogin(rc_section_t *);
rc_script_t *sectionGetscript(rc_section_t *);
const char *sectionGetdata(rc_section_t *);
size_t sectionGetlen(rc_section_t *);
rc_return_t sectionSetpri(rc_section_t *, long);
rc_return_t sectionSetuid(rc_section_t *, long);
rc_return_t sectionSetname(rc_section_t *, const char *);
rc_return_t sectionSetparent(rc_section_t *, const char *);
rc_return_t sectionSetlabel(rc_section_t *, const char *);
rc_return_t sectionSetlogin(rc_section_t *, const char *);
rc_return_t sectionSetdata(rc_section_t *, const char *);
rc_return_t sectionSetndata(rc_section_t *, const char *, size_t);
rc_return_t sectionDump(rc_section_t *);
rc_return_t sectionWrite(rc_section_t *, const char *);
rc_return_t sectionDelete(rc_section_t *);
/* Processor function prototypes */
rc_proc_t *procNew(void);
rc_return_t procDelete(rc_proc_t *);
rc_return_t procPopulate(rc_proc_t *);
rc_return_t procRun(rc_proc_t *);
rc_return_t procEval(rc_proc_t *);
rc_return_t procExec(rc_proc_t *);
rc_return_t procPrint(rc_proc_t *);
rc_return_t procParse(rc_proc_t *);
/* Utility (nonbounded) function prototypes */
char *strErr(rc_return_t);
char **vectorCopy(const char **);
short vectorCount(const char **);
rc_return_t vectorDel(char **);
int priCompare(const void *, const void *);
/* Other function prototypes */
void rcError(ex_t);
/*rc_result_t rc_Err (void);
rc_result_t rc_Warn (void);
rc_result_t rc_PathAppend (int bExists, char **pszPaths);
rc_result_t rc_PathPrepend (int bExists, char **pszPaths);
rc_result_t rc_EnvDel (char *szVar, char **pszVals);
rc_result_t rc_QueryVar (char *szVar, char **pszVal);
rc_result_t rc_ServiceState (char *szService, char **pszServState);
rc_result_t rc_TmpDirGen (char *szProgram);
rc_result_t rc_TmpDirFile (char *szProgram, char *szFilename, *szVar);
rc_result_t rc_TmpDirDel (char *szProgram);*/
#endif /* __OSSPRC_H__ */
@
1.59
log
@More header corrections and improvements.
@
text
@d89 6
a94 6
rc_return_t clioptNew(void);
rc_return_t clioptPrintusage(void);
rc_return_t clioptProcess(int, const char *);
rc_return_t clioptParseopts(int, const char **);
rc_return_t clioptParseargs(void);
rc_return_t clioptDelete(void);
d97 6
a102 6
const char *clioptGetval(rc_opt_t);
const char *clioptGetrcfile(void);
const char **clioptGetsecs(void);
rc_return_t clioptSetval(rc_opt_t, const char *);
rc_return_t clioptSetrcfile(const char *);
rc_return_t clioptSetsecs(const char **);
@
1.58
log
@Correct and update copyrights and source headers.
@
text
@d1 1
a1 1
/* OSSP rc - Run-command processor
d6 1
a6 1
** This file is part of OSSP rc, a portable Run-command processor
d27 1
a27 1
** rc.h: Run-command processor ISO C public header file
@
1.57
log
@Add temporary directory option error logic.
@
text
@d2 3
a4 3
** Copyright (c) 2002 Ralf S. Engelschall
** Copyright (c) 2002 Cable & Wireless Deutschland GmbH
** Copyright (c) 2002 The OSSP Project
@
1.56
log
@Processor separation, removing logic from generic procRun method and
implementing procEval, procExec, procPrint, and procParse methods.
@
text
@d63 9
a71 8
RC_ERR_DIR = 8, /* Location dir not found */
RC_ERR_RCF = 9, /* Rc file not found */
RC_ERR_TRM = 10, /* Request to terminate app */
RC_ERR_CFG = 11, /* Config or option failure */
RC_ERR_ROOT = 12, /* Process must run as root */
RC_WRN_0 = 13, /* Warning base */
RC_WRN_OWR = 14, /* Overwrite warning */
RC_WRN_NUL = 15 /* NULL pointer warning */
@
1.55
log
@Add RC_ERR_ROOT error, and improve error handling during forked child op
failures.
@
text
@d160 4
@
1.54
log
@Fix some verbose mode print run definitions, and fix error handling by using
correct value 0 for RC_OK.
@
text
@d55 16
a70 15
RC_OK = 0, /* Success */
RC_ERR_0 = 1, /* Error base */
RC_ERR_USE = 2, /* Usage error */
RC_ERR_MEM = 3, /* Memory error */
RC_ERR_SYS = 4, /* System error (see errno) */
RC_ERR_IO = 5, /* Input/output error */
RC_ERR_INT = 6, /* Internal error */
RC_ERR_FNC = 7, /* Func file not found */
RC_ERR_DIR = 8, /* Location dir not found */
RC_ERR_RCF = 9, /* Rc file not found */
RC_ERR_TRM = 10, /* Request to terminate app */
RC_ERR_CFG = 11, /* Config or option failure */
RC_WRN_0 = 12, /* Warning base */
RC_WRN_OWR = 13, /* Overwrite warning */
RC_WRN_NUL = 14 /* NULL pointer warning */
@
1.53
log
@Replace references to scriptAppend with scriptAdd, and change name of
scriptAppend to scriptnAppend to avoid surprises. Also, debug minimal memory
overallocation in scriptnAppend.
@
text
@d55 15
a69 15
RC_OK = 1, /* Success */
RC_ERR_0 = 2, /* Error base */
RC_ERR_USE = 3, /* Usage error */
RC_ERR_MEM = 4, /* Memory error */
RC_ERR_SYS = 5, /* System error (see errno) */
RC_ERR_IO = 6, /* Input/output error */
RC_ERR_INT = 7, /* Internal error */
RC_ERR_FNC = 8, /* Func file not found */
RC_ERR_DIR = 9, /* Location dir not found */
RC_ERR_RCF = 10, /* Rc file not found */
RC_ERR_TRM = 11, /* Request to terminate app */
RC_ERR_CFG = 12, /* Config or option failure */
RC_WRN_0 = 13, /* Warning base */
RC_WRN_OWR = 14, /* Overwrite warning */
RC_WRN_NUL = 15 /* NULL pointer warning */
@
1.52
log
@Implement common section parsing and running on execution mode.
@
text
@d112 1
a112 1
rc_return_t scriptAppend(rc_script_t *, const char *, size_t);
d139 1
@
1.51
log
@Break off before fully implementing common section run ops, but after
reorganization of class data, and additional member functions for section and
script manipulation.
@
text
@d105 1
@
1.50
log
@Complete error handling method according to all defined error values.
@
text
@d110 1
d115 2
a116 1
const char *scriptTostring(rc_script_t *);
d121 2
d135 1
d143 1
@
1.49
log
@Removed analyzer class, removed label class, implemented list class,
implemented file class, cleanup and restructure.
@
text
@d66 4
a69 3
RC_WRN_0 = 12, /* Warning base */
RC_WRN_OWR = 13, /* Overwrite warning */
RC_WRN_NUL = 14 /* NULL pointer warning */
@
1.48
log
@Sweeping cleanups. Reduced the analyzer to almost nothing. Removed unused
method prototypes. Added 'parse' mode option that doesn't work yet. Removed
procReadtmp. Change the way we build path names from the locations directory.
@
text
@d101 4
a104 5
/* Analyser function prototypes */
rc_anal_t *analNew(void);
rc_return_t analDelete(rc_anal_t *);
rc_return_t analRcs(rc_anal_t *, const char *);
rc_return_t analGloblocs(rc_anal_t *);
d116 7
a122 6
/* Label function prototypes */
rc_label_t *labelNew(const char *);
rc_return_t labelAppendsec(rc_label_t *, rc_section_t *);
rc_return_t labelDelete(rc_label_t *);
const char *labelGetname(rc_label_t *);
rc_return_t labelSetname(rc_label_t *, const char *);
@
1.47
log
@Implement limited verbosity on eval modus, and begin mergin the label object
and the section object.
@
text
@d104 2
a105 7
rc_return_t analRcs(rc_anal_t **, const char *);
rc_return_t analTmp(rc_anal_t **, const char *);
rc_return_t analFuncs(rc_anal_t **, const char *);
rc_return_t analLocs(rc_anal_t **, const char *);
rc_return_t analSecs(rc_anal_t **, const char **);
rc_return_t analGloblocs(rc_anal_t **);
rc_return_t analParse(rc_anal_t *);
a147 5
rc_return_t procReadfuncs(rc_proc_t *, const char *);
rc_return_t procReadtmp(rc_proc_t *, const char *);
rc_return_t procReadrc(rc_proc_t *, const char *);
rc_return_t procSection(rc_proc_t *, const char *);
rc_return_t procParse(rc_proc_t *);
@
1.46
log
@Implement eval mode.
@
text
@d126 2
d134 2
d141 2
@
1.45
log
@Implement rc label ordered command printing and execution.
@
text
@d114 1
d118 1
d141 1
@
1.44
log
@Added label class to represent a run command label (prefixed by rc. in most
cases).
@
text
@d126 1
a126 1
rc_section_t *sectionNew(void);
@
1.43
log
@Added section login accessors for user name handling during print op,
implemented user id and user name parsing in section and script objects.
@
text
@d120 5
@
1.42
log
@Implement priority scheduling with qsort(3) and priCompare(), adhere to naming
standard, and bugfix.
@
text
@d125 1
d130 1
@
1.41
log
@Add sectionCopy(), sectionDump(), and vectorCount(), and change the processor
object's script vector to a section vector.
@
text
@d150 1
@
1.40
log
@Correctly use section accessors, split script to common and section vector
objects, add sectionSetndata (with n length sections), and wrap script dump
logic for NULL pointer safety.
@
text
@d122 1
d131 1
d148 1
@
1.39
log
@Bring rc back to life, corrected the processor and script object memory
problems, and made small changes to test suite.
@
text
@d126 2
a127 2
rc_return_t sectionSetpri(rc_section_t *, int);
rc_return_t sectionSetuid(rc_section_t *, int);
d129 1
@
1.38
log
@Newly born section class for use in piecing together script fragments.
@
text
@d114 1
a114 1
rc_return_t scriptAppend(rc_script_t *, char *, size_t);
d125 1
@
1.37
log
@Implemented command execution mode, and now OSSP rc is dangerous to use
because it will actually execute code. Test suite is adjusted accordingly.
@
text
@d115 1
a115 1
char *scriptSection(rc_script_t *, const char *);
d119 10
@
1.36
log
@Implement about half of the necessary default configuration members.
@
text
@d117 1
@
1.35
log
@Implemented limited pattern matching of section labels.
@
text
@d76 1
@
1.34
log
@Wrote configInfo, removed config debugging, prepared procRun for
eval/exec/print logic, and improved test conditions.
@
text
@d135 1
@
1.33
log
@Improved section parsing and added back most error condition logic. All
combinations of wildcard globbing, multiple section parsing, and error
handling now work (except for a problem relating to or using ex).
@
text
@d65 4
a68 4
RC_WRN_0 = 11, /* Warning base */
RC_WRN_OWR = 12, /* Overwrite warning */
RC_WRN_NUL = 13, /* NULL pointer warning */
RC_WRN_TRM = 14 /* Request to terminate app */
d74 1
a76 2
const char *configSummarize(void);
void configDebug(void); /* FIXME Remove */
@
1.32
log
@Fixed memory bound violation and added section parsing logic.
@
text
@d62 7
a68 4
RC_WRN_0 = 8, /* Warning base */
RC_WRN_OWR = 9, /* Overwrite warning */
RC_WRN_NUL = 10, /* NULL pointer warning */
RC_WRN_TRM = 11 /* Request to terminate app */
d115 1
a115 1
const char *scriptSection(rc_script_t *, const char *);
@
1.31
log
@Added 'all' wildcard rcfile globbing and removed location hardcoding and
rcfile prefix hardcoding.
@
text
@d112 1
@
1.30
log
@Relocate debug config dumping logic and clean up terminal option handling.
@
text
@d106 1
@
1.29
log
@Intermediate committal, lots of additions, compiles and works very limited.
@
text
@d55 11
a65 10
RC_OK = 1, /* Success */
RC_ERR_0 = 2, /* Error base */
RC_ERR_USE = 3, /* Usage error */
RC_ERR_MEM = 4, /* Memory error */
RC_ERR_SYS = 5, /* System error (see errno) */
RC_ERR_IO = 6, /* Input/output error */
RC_ERR_INT = 7, /* Internal error */
RC_WRN_0 = 8, /* Warning base */
RC_WRN_OWR = 9, /* Overwrite warning */
RC_WRN_NUL = 10 /* NULL pointer warning */
@
1.28
log
@More flush work on analyzer.
@
text
@d107 6
d121 1
@
1.27
log
@Addition of configuration analyiser and related adjustments to other sources.
@
text
@d63 2
a64 1
RC_WRN_OWR = 9 /* Overwrite warning */
d100 5
a104 5
rc_return_t analRcs(rc_anal_t *, const char *);
rc_return_t analTmp(rc_anal_t *, const char *);
rc_return_t analFuncs(rc_anal_t *, const char *);
rc_return_t analLocs(rc_anal_t *, const char *);
rc_return_t analSecs(rc_anal_t *, const char **);
d119 2
@
1.26
log
@Fix the build, comment missing pieces, and synchronize throughout.
@
text
@d96 10
@
1.25
log
@Flush minor work. Building successfuly again.
@
text
@d46 5
d55 9
a63 6
RC_OK, /* Success */
RC_ERR_USE, /* Usage error */
RC_ERR_MEM, /* Memory error */
RC_ERR_SYS, /* System error (see errno) */
RC_ERR_IO, /* Input/output error */
RC_ERR_INT /* Internal error */
a65 12
/* Processor class */
typedef struct {
int nTmpfile; /* Temp file descriptor */
} rc_proc_t;
/* Rc script type */
typedef char *rc_script_t;
/* Option function prototypes */
/*rc_return_t optionProcess(void);
rc_return_t optionProcess(void);*/
d68 1
a68 1
rc_return_t configLoad(int, char **);
d72 1
a72 1
void configDebug(void); /* FIXME Remove */
d78 1
a78 1
const char *configGetsec(int);
a82 4
/*FIXME rc_return_t clioptRemnode(rc_bintup_t **);
rc_return_t clioptRemallimp(rc_bintup_t **);
rc_return_t clioptRemall(void);
rc_return_t clioptAppnode(const char *, const char *);*/
d84 2
a85 3
rc_return_t clioptParseopt(int, char **);
rc_return_t clioptParserc(void);
rc_return_t clioptParsesec(void);
d91 1
a91 2
const char **clioptGetsec(void);
int clioptGetseclen(void);
d94 1
a94 1
rc_return_t clioptSetsec(const char **);
a104 10
/* Option function prototypes */
/*FIXME rc_return_t optNew(rc_opt_t **);
rc_return_t optDelete(rc_opt_t **);*/
/* Option accessor prototypes */
/*FIXME rc_return_t optGetname(rc_opt_t *, char **);
rc_return_t optGetval(rc_opt_t *, char **);
rc_return_t optSetname(rc_opt_t *, const char *);
rc_return_t optSetval(rc_opt_t *, const char *);*/
@
1.24
log
@Begin processor pieces.
@
text
@d58 1
a58 1
/* Rc class */
d61 1
a61 1
} rc_t;
d107 8
a114 8
rc_t *procNew(void);
rc_return_t procDelete(rc_t *);
rc_return_t procReadfuncs(rc_t *, char *);
rc_return_t procReadtmp(rc_t *, char *);
rc_return_t procReadrc(rc_t *, char *);
rc_return_t procSection(rc_t *, char *);
rc_return_t procParse(rc_t *);
rc_return_t procRun(rc_t *);
@
1.23
log
@Moved early option verify from main to config.
@
text
@d59 3
a61 1
typedef void *rc_t;
d105 10
@
1.22
log
@Command line option configuration and some processor operations.
@
text
@a63 3
/* Main function prototypes */
rc_return_t rcIntro(void);
d71 1
@
1.21
log
@Added OSSP str back to build configuration, and used it for output formatting.
Added pieces of rc file and section command line parsing logic.
@
text
@d48 1
a48 1
/* RC return codes */
a50 1
RC_CNF_VRS, /* User requested version */
d58 9
d68 2
a69 2
rc_return_t optionProcess(void);
rc_return_t optionProcess(void);
d72 1
a72 1
rc_return_t configConstruct(void);
d74 3
a76 1
rc_return_t configDestruct(void);
d81 2
a82 1
const char *configSummarize(void);
d85 2
a86 1
rc_return_t clioptConstruct(void);
d92 4
a95 2
rc_return_t clioptParse(int, char **);
rc_return_t clioptDestruct(void);
d100 5
a104 1
const char *clioptGetsec(void);
d107 2
a108 2
/*FIXME rc_return_t optConstruct(rc_opt_t **);
rc_return_t optDestruct(rc_opt_t **);*/
@
1.20
log
@Remove obsolete specs and implementations.
@
text
@d85 2
@
1.19
log
@Configuration string parsing logic.
@
text
@d71 1
a84 1
const char *clioptSummarize(void);
@
1.18
log
@Flush configuration and parsing work.
@
text
@d78 1
a78 1
rc_return_t clioptProcess(int);
@
1.17
log
@Flush the toilet.
@
text
@d69 2
a70 1
const char *configGetoptval(rc_opt_t);
@
1.16
log
@Remove cut and paste crap.
@
text
@d51 1
a62 12
/* File option function prototypes */
rc_return_t foptParse(void);
rc_return_t foptProcess(void);
/* Environment option function prototypes */
rc_return_t eoptParse(void);
rc_return_t eoptProcess(void);
/* Command line option function prototypes */
rc_return_t coptParse(int, char **);
rc_return_t coptProcess(int);
d69 1
a69 1
short configGetvers(void);
d73 6
d82 2
a83 1
short clioptGetvers(void);
d85 9
a93 2
/* Option accessor prototypes */
short optGetvers(void);
@
1.15
log
@Flush configuration changes.
@
text
@d89 3
@
1.14
log
@Vacation flush, mostly build configuration details. Its not building very
clean right now.
@
text
@d82 7
@
1.13
log
@Fixed the build, improved the design, improved the configuration and option
processing.
@
text
@d1 2
a2 1
/* rc - OSSP Run-command processor
a4 1
** Copyright (c) 2002 Ralf S. Engelschall
d7 1
a7 1
** which can be found at http://www.ossp.org/pkg/rc/
@
1.12
log
@Configuration improvements.
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
@
text
@d71 2
a72 2
rc_return_t coptParse(int);
rc_return_t coptProcess(char, char *);
@
1.11
log
@Cleanup and structuring.
@
text
@d75 6
a80 3
rc_return_t configConstruct(rc_config_t **);
rc_return_t configLoad(rc_config_t *, int, char **);
rc_return_t configDestruct(rc_config_t *);
@
1.10
log
@Further abstraction and building in of the configuration logic. We now store
configuration variables using OSSP val, also.
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
@
text
@a47 3
/* Unique identifier to use with OSSP ex library */
extern const char ossprc_id[];
d59 14
a72 2
rc_return_t parseOpts(int, char **);
rc_return_t procOpts(char, char *);
d75 2
a76 2
rc_return_t configInit(rc_config_t **);
rc_return_t configFill(rc_config_t *, int, char **);
d79 1
a79 1
/* Util function prototypes */
d82 1
a82 1
/* Other function prototypes */
@
1.9
log
@Abstract rc's config according to design.
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
@
text
@d46 1
a57 1
RC_ERR_FMT, /* Formatting error */
d61 13
a73 2
/* Function prototypes */
rc_return_t parseopts(int, char **);
@
1.8
log
@Add exception handling.
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
@
text
@a52 1
RC_ERR_ARG, /* Argument error */
d62 1
a62 1
static void die(rc_return_t);
@
1.7
log
@Fixed copyright and updated the todo list.
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
@
text
@a45 1
#include "popt.h"
d47 2
a63 1
void usage(popt_context, rc_return_t, char *);
@
1.6
log
@Transition flush.
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
@
text
@d27 1
a27 1
** rc.h: Run-command processor ANSI C public header file
@
1.5
log
@Fixed copyright.
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
@
text
@d46 3
d58 1
a58 1
RC_ERR_INT, /* Internal error */
d60 4
@
1.4
log
@First cut at a popt enabled configuration.
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
@
text
@d1 1
a1 1
/* rc - OSSP Runcommand processor
d6 1
a6 1
** This file is part of OSSP rc, a portable Runcommand processor
d27 1
a27 1
** rc.h: Runcommand processor ANSI C public header file
@
1.3
log
@Some possible interface methods, taken from the OpenPKG implementation.
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
@
text
@d46 11
d58 1
a58 1
rc_result_t rc_Err (void);
d67 1
a67 1
rc_result_t rc_TmpDirDel (char *szProgram);
@
1.2
log
@Final move from OpenPKG project hierarchy to OSSP project hierarchy.
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
@
text
@d46 12
@
1.1
log
@First cut at bourne script to ANSI C (+improvements) of rc run-command
processor
@
text
@d1 4
a4 5
/*
** OpenPKG rc - Run-Command Handling for OpenPKG
** Copyright (c) 2000-2001 Ralf S. Engelschall
** Copyright (c) 2001-2002 The OpenPKG Project (http://www.openpkg.org/)
** Copyright (c) 2001-2002 Cable & Wireless Deutschland (http://www.cw.com/de/)
d6 2
a7 2
** This file is part of OpenPKG, a packaging facility which can be
** found at http://www.openpkg.org/
d27 1
a27 1
** rc.h: run-command processor ANSI C header file
d30 2
a31 2
#ifndef __OPENPKGRC_H__
#define __OPENPKGRC_H__
d46 1
a46 1
#endif /* __OPENPKGRC_H__ */
@