PMDF popstore & MessageStore Manager's Guide


Previous Contents Index


POPSTORE_init

Initialize the popstore API.

format


int POPSTORE_init (init_pmdf, sleep_proc, usage, usage_len) 
      int    init_pmdf; 
      void (*sleep_proc)(); 
      char  *usage; 
      int    usage_len; 


Arguments

init_pmdf

Boolean flag, 0 or 1, indicating whether or not to also call PMDF_initialize. Used for input only.

sleep_proc

Address of a procedure to call to sleep the process or thread. Used for input only.

usage

A short description identifying the usage being made by the popstore API client. Used for input only.

usage_len

Length in bytes of the usage description, usage . Used for input only.

Description

To use the popstore API, you must first initialize the API by calling POPSTORE_init . When through using the popstore API, call POPSTORE_end . When a call to POPSTORE_init fails, POPSTORE_end does not need to be called. However, POPSTORE_end can be called even when a call to POPSTORE_init has failed. If PMDF has not already been initialized via the PMDF API subroutine PMDF_initialize, then you must specify a value of 1 for init_pmdf . Otherwise, specify a value of 0. A brief description of the intended usage can be specified with the usage argument. This information will be passed to any site-supplied logging procedure as part of the POPSTORE_LOG_START logging call. When the popstore API is used by a multi-threaded process, the address of a procedure to sleep a single thread should be supplied with the sleep_proc argument. The procedure takes the form


void sleep (centi_seconds) 
       unsigned long centi_seconds; 
where centi_seconds is the number of hundredths of seconds to sleep the thread for. When a null is passed for the value of sleep_proc , the popstore API will use a default sleep procedure.4


Return Values

POPSTORE_SUCCESS Normal, successful completion.
POPSTORE_BADARG Illegal value specified for the USERNAME_STYLE or USERNAME_CHARSET options; initialization failed.
POPSTORE_LOADERROR Unable to load a site-supplied callable image; initialization failed.
POPSTORE_PMDFINITERR Unable to initialize PMDF; initialization failed.
POPSTORE_READERROR Unable to read the popstore option file; initialization failed.

Note

4 Presently, the sleep procedure is only used in the event that a file cannot be opened or created for some unknown reason. In such situations, the popstore will sleep for a brief period of time and attempt to open or create the file a second time.


Previous Next Contents Index