RSA Security logo

RSA BSAFE Cert-C
API Reference

filelog.h File Reference

This file defines the public interface to the file-based error-log service provider.

#include "service.h"

Go to the source code of this file.

Data Structures

struct  FILE_LOG_PARAMS
 Passes initialization parameters to the Cert-C Status Log service provider's initialization functions. More...


Functions

int S_InitializeFileLog (CERTC_CTX ctx, POINTER params, SERVICE_FUNCS *funcs, POINTER *handle)
 Never call the S_InitializeFileLog() function directly; instead, to initialize or register the Cert-C Status Log service provider, call the C_InitializeCertC() or C_RegisterService() function. More...


Function Documentation

int S_InitializeFileLog CERTC_CTX    ctx,
POINTER    params,
SERVICE_FUNCS   funcs,
POINTER *    handle
;
 

Never call the S_InitializeFileLog() function directly; instead, to initialize or register the Cert-C Status Log service provider, call the C_InitializeCertC() or C_RegisterService() function. Both functions take SERVICE_HANDLER and a POINTER to a parameters structure as parameters. SERVICE_HANDLER's Initialize parameter points to the S_InitializeFileLog() function, and the corresponding POINTER should point to a FILE_LOG_PARAMS structure, or you should set it to (FILE_LOG_PARAMS *)0.

Cert-C uses S_InitializeFileLog() to initialize the Cert-C Status Log service provider's functions. S_InitializeFileLog() stores pointers to the Cert-C Status Log service provider's functions in func's log member, which is a LOG_FUNCS structure. S_InitializeFileLog() uses the Cert-C Status Log service provider's initialization parameters in params, which points to the FILE_LOG_PARAMS structure.

When you register this service provider, S_InitializeFileLog() opens the log file and message-format file. The message-format strings are read into memory, and the message-format file is closed. Each line of the message-format file is a text string that should conform to the following format.

The line begins with the characters 0x, followed by the status value in hexadecimal. Then there should be a space, followed by a single character (either E, W, or I). These characters correspond to the status type values ST_ERROR, ST_WARNING, or ST_INFO, respectively. Then there should be a space, followed by the message-format control string, which continues to the end of the line. The line should be terminated by the newline character (or newline character sequence) appropriate for the local operating system.

Parameters:
ctx This input parameter points to an initialized Cert-C context handle.
params This input parameter should point to a structure of type FILE_LOG_PARAMS. If this parameter is set to (FILE_LOG_PARAMS *)0, the service provider prints log entries to the standard C error stream. It also assumes that log-message format strings are stored in the certc.msg file, which is in the current working directory.
funcs This is both an input and output parameter. As an input parameter, it points to an allocated but uninitialized SERVICE_FUNCS union. As an output parameter, it points to the initialized Cert-C Status Log service-provider-specific functions in SERVICE_FUNCS's log member, which is a LOG_FUNCS structure.
handle This output parameter points to an allocated private log structure returned by this function.
Returns:
If successful, returns 0 (zero). If not, returns a Cert-C error code.



RSA BSAFE® Cert-C 2.7 API Reference