head 1.39;
access;
symbols
OSSP_RC_0_7_3:1.38
OSSP_RC_0_7_2:1.38
OSSP_RC_0_7_1:1.37
OSSP_RC_ALPHA_06:1.29
OSSP_RC_EXBROKEN:1.28;
locks; strict;
comment @ * @;
1.39
date 2003.07.11.14.13.16; author ms; state Exp;
branches;
next 1.38;
1.38
date 2003.07.11.09.38.29; author ms; state Exp;
branches;
next 1.37;
1.37
date 2003.07.07.13.30.51; author ms; state Exp;
branches;
next 1.36;
1.36
date 2003.07.07.12.55.42; author ms; state Exp;
branches;
next 1.35;
1.35
date 2003.06.27.10.15.19; author ms; state Exp;
branches;
next 1.34;
1.34
date 2003.06.26.18.45.14; author ms; state Exp;
branches;
next 1.33;
1.33
date 2003.06.18.14.35.29; author ms; state Exp;
branches;
next 1.32;
1.32
date 2003.06.13.18.33.07; author ms; state Exp;
branches;
next 1.31;
1.31
date 2003.06.13.11.50.37; author ms; state Exp;
branches;
next 1.30;
1.30
date 2003.06.11.16.18.48; author ms; state Exp;
branches;
next 1.29;
1.29
date 2003.05.28.15.09.29; author ms; state Exp;
branches;
next 1.28;
1.28
date 2003.05.21.12.49.21; author ms; state Exp;
branches;
next 1.27;
1.27
date 2003.05.20.15.06.42; author ms; state Exp;
branches;
next 1.26;
1.26
date 2003.05.20.11.46.25; author ms; state Exp;
branches;
next 1.25;
1.25
date 2003.05.16.18.43.30; author ms; state Exp;
branches;
next 1.24;
1.24
date 2003.05.15.22.22.30; author ms; state Exp;
branches;
next 1.23;
1.23
date 2003.05.15.12.49.11; author ms; state Exp;
branches;
next 1.22;
1.22
date 2003.05.14.16.36.28; author ms; state Exp;
branches;
next 1.21;
1.21
date 2003.04.03.12.05.14; author ms; state Exp;
branches;
next 1.20;
1.20
date 2002.08.02.16.38.09; author ms; state Exp;
branches;
next 1.19;
1.19
date 2002.07.30.16.36.41; author ms; state Exp;
branches;
next 1.18;
1.18
date 2002.07.04.16.49.58; author ms; state Exp;
branches;
next 1.17;
1.17
date 2002.06.28.14.20.23; author ms; state Exp;
branches;
next 1.16;
1.16
date 2002.06.27.15.35.58; author ms; state Exp;
branches;
next 1.15;
1.15
date 2002.06.26.14.11.16; author ms; state Exp;
branches;
next 1.14;
1.14
date 2002.05.23.18.03.20; author ms; state Exp;
branches;
next 1.13;
1.13
date 2002.05.22.16.01.49; author ms; state Exp;
branches;
next 1.12;
1.12
date 2002.05.22.13.29.40; author ms; state Exp;
branches;
next 1.11;
1.11
date 2002.04.12.19.15.12; author ms; state Exp;
branches;
next 1.10;
1.10
date 2002.04.11.16.52.45; author ms; state Exp;
branches;
next 1.9;
1.9
date 2002.04.09.17.01.54; author ms; state Exp;
branches;
next 1.8;
1.8
date 2002.04.08.15.37.10; author ms; state Exp;
branches;
next 1.7;
1.7
date 2002.03.26.17.11.06; author ms; state Exp;
branches;
next 1.6;
1.6
date 2002.03.01.22.48.23; author ms; state Exp;
branches;
next 1.5;
1.5
date 2002.02.28.18.24.04; author ms; state Exp;
branches;
next 1.4;
1.4
date 2002.02.28.15.30.04; author ms; state Exp;
branches;
next 1.3;
1.3
date 2002.02.13.19.19.28; author ms; state Exp;
branches;
next 1.2;
1.2
date 2002.02.11.12.34.29; author ms; state Exp;
branches;
next 1.1;
1.1
date 2002.02.07.12.35.25; author ms; state Exp;
branches;
next ;
desc
@@
1.39
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_private.h: Run-Command Processor ISO C private API header file
*/
#ifndef __OSSPRC_PRIVATE_H__
#define __OSSPRC_PRIVATE_H__
#ifdef HAVE_CONFIG_H
#include "ac_config.h"
#endif
/* Assertion and tracing support */
#include
#ifndef DEBUG
#define NDEBUG
#define TRACE(str) ((void)0)
#define TRACEL(num) ((void)0)
#else
#define TRACE(str) fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, str)
#define TRACEL(num) fprintf(stderr, "%s:%d: %ld\n", __FILE__, __LINE__, (long int)num)
#endif
/* Pointer and string manipulation constants */
#define RC_SEC_SUB 1
#define RC_GOOD_MEASURE 8
#define RC_EXEC_MAXARGS 8
#define RC_READ_BUFSIZE 1024
#define RC_WRITE_BUFSIZE 1024
#define RC_STR_ID "OSSP rc" /* APPID for OSSP rc */
#define RC_UID_ID 0xf8a1845c55e6449481176f6e9cea34b /* UUID for OSSP rc */
/* Intentional no operation */
#define RC_NOP ((void)0)
/* Memory debugging support */
#if defined(HAVE_DMALLOC_H) && defined(WITH_DMALLOC)
#include "dmalloc.h"
#endif
/* Define the ability to throw OSSP ex exceptions */
#include "ex.h" /* OSSP ex exception handling library */
#define RC_THROW(rv) \
((rv) != RC_OK && (ex_catching && !ex_shielding) \
? (ex_throw(RC_STR_ID, NULL, (rv)), (rv)) : (rv))
typedef int rc_opt_t; /* For use with RC_XXX_VAL definitions */
/* Cliopt class */
typedef struct {
char **m_pszOptuples;
char *m_szRcfile;
char **m_pszSecs;
} rc_cliopt_t;
/* Configuration class */
typedef struct {
rc_cliopt_t *pCliopts;
} rc_config_t;
/* Script type */
typedef char * rc_script_t;
/* Section type */
typedef struct {
int m_nPri;
int m_nUid;
char *m_szParent;
char *m_szName;
char *m_szLogin;
rc_script_t *m_pData;
} rc_section_t;
/* Rcfile class */
typedef struct {
short m_nSecs;
char *m_szName;
rc_section_t **m_ppSecvec;
} rc_file_t;
/* List class (can be implemented as array) */
typedef struct {
short m_nFiles;
rc_file_t **m_ppFilevec;
} rc_list_t;
/* Processor class */
typedef struct {
rc_script_t *m_pScriptfunc;
rc_script_t *m_pScriptcnf;
rc_list_t *m_pList;
} rc_proc_t;
#endif /* __OSSPRC_PRIVATE_H__ */
@
1.38
log
@Remove hardcoded version, and replace with dynamic shtool generated data.
@
text
@d73 12
@
1.37
log
@More header corrections and improvements.
@
text
@d48 1
a48 4
/* FIXME Tie to shtool generation */
#define RC_VERSION "77.77"
@
1.36
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_private.h: Run-command processor ISO C private API header file
@
1.35
log
@Fix a deallocation name bug, and change common-related names to config to
avoid similar problems.
@
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.34
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
a105 1
rc_script_t *m_pScriptcom;
@
1.33
log
@Removed analyzer class, removed label class, implemented list class,
implemented file class, cleanup and restructure.
@
text
@d83 1
d86 1
a86 1
char *m_szData;
@
1.32
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
@a75 6
/* Analyser type */
typedef struct {
short m_nRcs; /* How many rc files */
char **m_pszRcs; /* Rc file names */
} rc_anal_t;
a85 1
size_t m_Bytes;
d88 1
a88 1
/* Label type */
d93 7
a99 1
} rc_label_t;
d103 1
a103 1
rc_anal_t *m_pAnal;
d105 1
a105 1
rc_label_t **m_ppLabvec;
@
1.31
log
@Strip off unused section label.
@
text
@a78 1
short m_nSecs; /* How many sections */
a79 4
char *m_szTmp; /* Temp file name */
char *m_szFuncs; /* Function file names */
char *m_szLocs; /* Location path names */
char **m_pszSecs; /* Section vector */
d97 1
a97 1
int m_nSecs;
@
1.30
log
@Implement limited verbosity on eval modus, and begin mergin the label object
and the section object.
@
text
@a94 1
char *m_szLabel;
@
1.29
log
@Fix incorrect variable name m_szRcs, bug fix analyzer rc list algorythm.
@
text
@d95 1
@
1.28
log
@Implement eval mode.
@
text
@d80 1
a80 1
char **m_szRcs; /* Rc file names */
@
1.27
log
@Implement rc label ordered command printing and execution.
@
text
@d52 5
a56 4
#define RC_SEC_SUB 1
#define RC_GOOD_MEASURE 8
#define RC_EXEC_MAXARGS 8
#define RC_READ_BUFSIZE 1024
@
1.26
log
@Added label class to represent a run command label (prefixed by rc. in most
cases).
@
text
@d93 1
@
1.25
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
@d98 7
d109 1
a109 1
rc_section_t **m_ppSectvec;
@
1.24
log
@Implement priority scheduling with qsort(3) and priCompare(), adhere to naming
standard, and bugfix.
@
text
@d93 1
@
1.23
log
@Add sectionCopy(), sectionDump(), and vectorCount(), and change the processor
object's script vector to a section vector.
@
text
@d91 4
a94 4
int nPri;
int nUid;
char *szData;
size_t Bytes;
@
1.22
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
@d78 1
d101 1
a101 1
rc_script_t **m_ppScriptvec;
@
1.21
log
@Bring rc back to life, corrected the processor and script object memory
problems, and made small changes to test suite.
@
text
@d99 2
a100 1
rc_script_t *m_pScript;
@
1.20
log
@Newly born section class for use in piecing together script fragments.
@
text
@d93 1
@
1.19
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
@d77 1
d87 7
@
1.18
log
@Implemented limited pattern matching of section labels.
@
text
@d54 1
@
1.17
log
@Fixed memory bound violation and added section parsing logic.
@
text
@d50 1
a50 1
#define RC_VERSION "77.77"
d52 2
d55 1
a55 1
#define RC_STR_ID "OSSP rc" /* APPID for OSSP rc */
@
1.16
log
@Added 'all' wildcard rcfile globbing and removed location hardcoding and
rcfile prefix hardcoding.
@
text
@d91 1
@
1.15
log
@Intermediate committal, lots of additions, compiles and works very limited.
@
text
@d74 1
a74 1
char *m_szRcs; /* Rc file names */
@
1.14
log
@More flush work on analyzer.
@
text
@d49 4
d54 1
a54 1
#define RC_UID_ID f8a1845c55e6449481176f6e9cea34b /* UUID for OSSP rc */
d82 1
a82 4
typedef struct {
rc_anal_t *m_pAnal;
char *m_szText;
} rc_script_t;
d86 1
@
1.13
log
@Addition of configuration analyiser and related adjustments to other sources.
@
text
@d48 3
a50 2
/* The GUID for OSSP rc */
#define RC_STR_ID "OSSP rc"
d70 5
a74 5
char *m_szRcs; /* Rc file names */
char *m_szTmp; /* Temp file name */
char *m_szFuncs; /* Function file names */
char *m_szLocs; /* Location path names */
char *m_szSecs; /* Section names */
@
1.12
log
@Fix the build, comment missing pieces, and synchronize throughout.
@
text
@d44 2
a45 2
#define TRACE(str) fprintf(stderr, "%s:%d: %s", __FILE__, __LINE__, str)
#define TRACEL(num) fprintf(stderr, "%s:%d: %ld", __FILE__, __LINE__, (long int)num)
@
1.11
log
@Flush configuration and parsing work.
@
text
@d67 20
@
1.10
log
@Flush the toilet.
@
text
@d44 2
a45 2
#define TRACE(str) fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, str)
#define TRACEL(num) fprintf(stderr, "%s:%d: %ld\n", __FILE__, __LINE__, (long int)num)
@
1.9
log
@Flush configuration changes.
@
text
@d41 2
a42 2
#define TRACE(str) ((void)0)
#define TRACEL(long) ((void)0)
d45 1
a45 1
#define TRACEL(long) fprintf(stderr, "%s:%d: %ld\n", __FILE__, __LINE__, long)
d51 2
d65 1
a65 4
typedef struct { /* Simple linked list definition */
void *pvData;
void *pvNext;
} rc_list_t;
@
1.8
log
@Bring build back to life and remove val code.
@
text
@d63 4
a66 5
typedef struct { /* Main rc configuration storage */
void *pvFixme; /* Storage of configuration values */
int nLocks; /* Server locks, not thread-safe FIXME */
} rc_config_t;
@
1.7
log
@Vacation flush, mostly build configuration details. Its not building very
clean right now.
@
text
@a62 2
#include "val.h"
d65 2
a66 2
val_t *pOpt; /* Storage of configuration values */
int nLocks; /* Server locks, not thread-safe though */
@
1.6
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.5
log
@Configuration improvements.
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
@
text
@d66 3
a68 4
/* Main rc configuration storage */
typedef struct {
val_t *pVal; /* Storage of configuration values */
int nLocks; /* Server locks, probably not thread-safe */
@
1.4
log
@Cleanup and structuring.
@
text
@d41 2
a42 1
#define TRACE(expr) ((void)0)
d45 1
d48 4
a56 3
/* GUID to use with OSSP ex library */
const char g_szOSSPrc[];
d61 1
a61 1
? (ex_throw(g_szOSSPrc, NULL, (rv)), (rv)) : (rv))
d68 2
a69 2
void *pvCtx;
val_t *pVal;
@
1.3
log
@Small corrections in both logic and build configuration.
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
@
text
@d51 3
d58 1
a58 1
? (ex_throw(ossprc_id, NULL, (rv)), (rv)) : (rv))
@
1.2
log
@Added debugging support and made a few corrections.
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
@
text
@d54 1
a54 1
( (rv) != RC_OK && (ex_catching && !ex_shielding) \
@
1.1
log
@Filename changes.
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
@
text
@d30 2
a31 2
#ifndef __OSSPRC_P_H__
#define __OSSPRC_P_H__
d33 12
a44 1
#include "rc_config.h"
d46 3
a48 2
#ifdef HAVE_SYS_TIME_H /* must come after include rc_config.h */
#include
d51 16
a66 1
#endif /* __OSSPRC_P_H__ */
@