scdata.h File Reference

#include <stdio.h>
#include <string.h>
#include <time.h>
#include "md5.h"
#include "wlcstdc.h"

Include dependency graph for scdata.h:

This graph shows which files directly or indirectly include this file:


Data Structures

struct  SCs_data
struct  SCr_errno

Defines

#define SCR_MAX_NOCHECK   5
#define TIMELEN   9
#define DATELEN   11
#define MD5LEN   16

Enumerations

enum  SCr_error_type {
  SCr_err_startup = 0, SCr_err_nocheck = 1, SCr_err_file_format = 2, SCr_err_sys_disk = 3,
  SCr_err_transfer = 4, SCr_err_unloged = 5, SCr_err_types = 6
}
enum  SCt_error_type {
  SCt_err_argc = 1, SCt_err_no_twlset = 3, SCt_err_no_owlset = 5, SCt_err_no_wlset = 7,
  SCt_err_no_terr = 11, SCt_err_pre_sh = 13, SCt_err_post_sh = 15, SCt_err_over = 17
}

Functions

const char * SCr_err_to_str (int type)
void scode_time (char *give, time_t timer)
void scode_date (char *give, time_t timer)
void SCr_err_fwrite (FILE *dst, const struct SCr_errno *err)
void SCr_err_fread (FILE *src, struct SCr_errno *err)
int SCs_data_fwrite (FILE *dst, const struct SCs_data *data)
int SCs_data_fread (FILE *src, struct SCs_data *data)
int md5file (FILE *fp, unsigned char *digest)

Variables

const char * SC_wlset_name
const char * SC_worklogs_dir
const char * SC_errorlog_name

Detailed Description

Functions and structures used to manipulate data in the whole SC system.

Define Documentation

#define DATELEN   11

The length of a string with a date in ISO format

#define MD5LEN   16

The lenght of a string with the MD5 checksum

#define SCR_MAX_NOCHECK   5

The number of maximum unsuccessful communication tray's with SCslave module

#define TIMELEN   9

The length of a string with time in format HH:MM:SS


Enumeration Type Documentation

enum SCr_error_type

Error types codes returned and logged in errorlog file by the SCrunner program. See the "Selection Check Developers Manual" for more detail.

Enumerator:
SCr_err_startup  initialization error
SCr_err_nocheck  raised when the maximum number of unsuccessful communication tray's with SCslave module have occurred
SCr_err_file_format  wrong file format
SCr_err_sys_disk 
SCr_err_transfer  transfer error
SCr_err_unloged  multiple unsuccessful data logs
SCr_err_types  number of error types

enum SCt_error_type

Transfer type error codes

Enumerator:
SCt_err_argc  wrong number of arguments
SCt_err_no_twlset  couldn't create a wlset file in the transfer directory
SCt_err_no_owlset  couldn't open the old wlset file
SCt_err_no_wlset  couldn't open the new wlset file
SCt_err_no_terr  couldn't create a terror file in the transfer directory
SCt_err_pre_sh  pre-trans.sh error
SCt_err_post_sh  post-trans.sh error
SCt_err_over  tried to override an old transfer


Function Documentation

int md5file ( FILE *  fp,
unsigned char *  digest 
)

Generates a MD5 checksum for a file. This is a modification of a function from md5sum source.

Parameters:
fp file for witch the checksum will be generated
digest byte array in witch the checksume will be stored, must be at least MD5LEN big
Returns:
0 if successful else -1

void scode_date ( char *  give,
time_t  timer 
)

Generates a string with the date from 'timer' in ISO format.

Parameters:
give generated string
timer source date

void scode_time ( char *  give,
time_t  timer 
)

Generates a string with time 'timer' in format HH:MM:SS.

Parameters:
give generated string
timer source time

void SCr_err_fread ( FILE *  src,
struct SCr_errno err 
)

Reads an error from the error log file

Parameters:
src source file
err the error

void SCr_err_fwrite ( FILE *  dst,
const struct SCr_errno err 
)

Writes an error to the errorlog file

Parameters:
dst destination file
err the error

const char* SCr_err_to_str ( int  type  ) 

Converts code of an error type to its name.

Parameters:
type error type from SCr_error_type
Returns:
a pointer to a string with the name of the error type

int SCs_data_fread ( FILE *  src,
struct SCs_data data 
)

Reades a SCslave data record from worklog file.

Parameters:
src source file
data SCslave data record
Returns:
0 if successful else -1

int SCs_data_fwrite ( FILE *  dst,
const struct SCs_data data 
)

Writes a data record from SCslave to a worklog file.

Parameters:
dst destination file
data data record from SCslave
Returns:
0 if successful else -1


Variable Documentation

const char * SC_errorlog_name

the name of the error log file

const char* SC_wlset_name

the name of a wlset type file

const char * SC_worklogs_dir

the name of the directory that holds worklog files


Generated on Wed Jan 23 16:21:25 2008 for Selection Check Librarys by  doxygen 1.5.1