File pr/properties.c

  $Revision: 1.12 $

Properties module (pr) - this _should_ eventually get merged in with the
Status: NOT REVUED, NOT TESTED
Online References:
  Instructions for use:

To get a property: use the PR_get_property("Property.name") function from your other code.

Included Files


Preprocessor definitions

#define COMMENT_CHARACTER

#define MAX_PROPERTIES 1024


Typedef Property

Each property has a

typedef struct _Property* Property
struct _Property 
   { 
     char* token; Token to be found in properties file.
     char* value; Value to be found in properties file.
   } 


Global Variable Lock

pthread_mutex_t Lock
Included from /home/shane/code/RIP/include/ca_defs.h
Visible in:  aa/aa.c
   ac/access_control.c
   ca/ca_configFns.c
   ca/ca_initFn.c
   ca/ca_sanityCheck.c
   ca/ca_sourceLoader.c
   ca/ca_values.c
   co/constants.c
   df/defs.c
   er/er.c
   er/er_arrays.c
   er/er_macro.c
   er/er_paths.c
   er/er_print.c
   ip/ip.c
   ma/bitmask.c
   mm/mm.c
   nh/nh.c
   pa/gpg.c
   pa/spawn.c
   pc/pc_commands.c
   pc/protocol_config.c
   pm/pm_serials.c
   pm/protocol_mirror.c
   pr/properties.c
Used in: ca_get_adminIntElement()ca/ca_configFns.c
  ca_get_adminStrElement()ca/ca_configFns.c
  ca_get_boolean()ca/ca_configFns.c
  ca_get_dirlist()ca/ca_configFns.c
  ca_get_int()ca/ca_configFns.c
  ca_get_string()ca/ca_configFns.c
  ca_set_boolean()ca/ca_configFns.c
  ca_srchandle2Intelement()ca/ca_configFns.c
  ca_srchandle2Strelement()ca/ca_configFns.c

Global Variable Properties

Array of Properties

Property Properties[1024]
Visible in:  pr/properties.c
Used in: PR_get_property()pr/properties.c
  PR_to_string()pr/properties.c
  add_property()pr/properties.c
  purge_properties()pr/properties.c


Global Variable Prop_count

The number of properties.

int Prop_count
Visible in:  pr/properties.c
Used in: PR_get_property()pr/properties.c
  PR_set()pr/properties.c
  PR_to_string()pr/properties.c
  add_property()pr/properties.c
  purge_properties()pr/properties.c


Global Variable Prop_file_name

The name of properties file.

char* Prop_file_name
Visible in:  pr/properties.c
Used in: PR_load()pr/properties.c
  PR_set()pr/properties.c


Global Function PR_get_property()

  Sets the properties file name.  Then sets the properties with a call to set_properties().

More:
  Authors:
        ottrey
Online References:
char* PR_get_property ( const char* token, const char* default_value )
Prototyped in: /home/shane/code/RIP/include/properties.h
Calls: UT_strdup_real(), strcmp()
Called by: CO_set()co/constants.c
  authenticate_user()pc/protocol_config.c
References Variables: Prop_countpr/properties.c
  Propertiespr/properties.c

Global Function PR_load()

  Sets the properties file name.  Then sets the properties with a call to set_properties().

More:
  Authors:
        ottrey
Online References:
void PR_load ( const char* prop_file_name )
Prototyped in: /home/shane/code/RIP/include/properties.h
Calls: PR_set()pr/properties.c
  UT_free_real(), UT_strdup_real()
References Variables: Prop_file_namepr/properties.c

Global Function PR_set()

  Sets the properties from the properties file.

More:
  Authors:
        ottrey
Online References:
char* PR_set ( void )
Prototyped in: /home/shane/code/RIP/include/properties.h
Calls: add_property()pr/properties.c
  purge_properties()pr/properties.c
  UT_strdup_real(), fdwrap_fclose(), fgets(), fopen(), fprintf(), sprintf(), strcat(), strchr(), strlen(), strncpy(), strrchr()
Called by: PR_load()pr/properties.c
References Variables: Prop_countpr/properties.c
  Prop_file_namepr/properties.c

Global Function PR_to_string()

  Returns the properties as a string.

More:
  Authors:
        ottrey

Pre-Conditions: The properties must be loaded first with load_properties().
Online References:
char* PR_to_string ( void )
Prototyped in: /home/shane/code/RIP/include/properties.h
Calls: UT_strdup_real(), g_string_append_c(), g_string_free(), g_string_new(), g_string_sprintfa()
Called by: show_props()pc/pc_commands.c
References Variables: Prop_countpr/properties.c
  Propertiespr/properties.c

Local Function add_property()

  Adds a new property to the Properties array.

More:
  Authors:
        ottrey
Online References:
static void add_property ( const char* token, const char* value )
Calls: UT_calloc_real(), UT_strdup_real()
Called by: PR_set()pr/properties.c
References Variables: Prop_countpr/properties.c
  Propertiespr/properties.c

Local Function asctime_r()

static char* asctime_r ( const struct tm* __tm, char* __buf )
Included from: /usr/include/time.h
Calls: __posix_asctime_r()

Local Function ctime_r()

static char* ctime_r ( const time_t* __time, char* __buf )
Included from: /usr/include/time.h
Calls: __posix_ctime_r()

Local Function getlogin_r()

static int getlogin_r ( char* __name, int __len )
Included from: /usr/include/unistd.h
Calls: __posix_getlogin_r()

Local Function purge_properties()

  Purges the old properties.

More:
  Authors:
        ottrey
Online References:
static void purge_properties ( void )
Calls: UT_free_real()
Called by: PR_set()pr/properties.c
References Variables: Prop_countpr/properties.c
  Propertiespr/properties.c

Local Function readdir_r()

static int readdir_r ( DIR* __dp, struct dirent* __ent, struct dirent** __res )
Included from: /usr/include/dirent.h
Calls: __posix_readdir_r()

Local Function sigwait()

static int sigwait ( const sigset_t* __setp, int* __signo )
Included from: /usr/include/signal.h
Calls: __posix_sigwait()

Local Function ttyname_r()

static int ttyname_r ( int __fildes, char* __buf, size_t __size )
Included from: /usr/include/unistd.h
Calls: __posix_ttyname_r()