File src/loginfo.c

This file contains functions called by the UBS shell for displaying logs and queues.


Included Files


Global Variable PROCNAME

char PROCNAME[128]
Included from include/ubs.h

Global Variable CUR_TIME

struct tm* CUR_TIME
Included from include/ubs.h

Global Variable GLOBAL

ubs_table GLOBAL
Included from include/ubs.h

Global Variable LOGLEVEL

int LOGLEVEL
Included from include/ubs.h

Global Function get_log()

This function displays the end part of a logfile, with the number of lines being an arbitrary integer. This is very similar to the "tail" command in unix.

int get_log ( char* log, int num_lines, int mode )

int get_log
Returns OK on success, NO_FILE if the logfile cannot be opened, NO_MEM if memory allocation fails
char* log
The name of the logfile to open
int num_lines
Number of lines to display
int mode
The output mode
Prototyped in: include/ubs-main.h
Calls: log_error_msg()lib/logging.c
  print_log()lib/logging.c
  read_log()lib/logging.c
  bzero(), fclose(), fgetc(), fgets(), fopen(), free(), fseek(), ftell(), malloc()
Called by: cmd_log()src/cmd_log.c

Global Function show_queue()

Prints the contents of the queue to standard output

int show_queue ( int format )

int show_queue
Returns OK on success, NO_FILE if the queue cannot be opened
int format
Output format
Prototyped in: include/ubs-main.h
Calls: chomp_line()lib/parse_line.c
  log_error_msg()lib/logging.c
  ubs_table_data()lib/table.c
  fclose(), fgets(), fopen(), printf()
Called by: cmd_queue()src/cmd_queue.c