Coda Distributed File System
Classes | Macros | Typedefs | Enumerations | Functions | Variables
rvmutl.c File Reference
#include <sys/file.h>
#include <errno.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <ctype.h>
#include <stdio.h>
#include <signal.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include "rvm_private.h"
Include dependency graph for rvmutl.c:

Classes

struct  peekpoke_buf_t
 
struct  str_name_entry_t
 

Macros

#define CMD_MAX   2048 /* maximum cmd line length */
 
#define ALL_SIZES
 
#define ALL_FORMATS
 
#define STR_NAME_LEN   31 /* maximum length of string name */
 
#define STICKY   rvm_true
 
#define incr_cur(_i)   cmd_cur = &cmd_cur[_i]
 
#define end_line(c)   (((c) == '\0') || ((c) == '\n'))
 
#define scan_stop(c)   (end_line(c) || ((c) == '>') || ((c) == '#'))
 
#define isoctal(c)   ((isdigit(c) && !(((c) == '8') || ((c) == '9'))))
 
#define LINE_WIDTH   80 /* length of print line */
 
#define MAX_CHARS   255 /* maximum nuber of characters to print */
 
#define DATA_END_STR   "** end of data **"
 
#define EOF_STR   "** end of file **"
 
#define INIT_BUF_STR   "initializing buffer"
 
#define LOG_NAME_PROMPT   "Enter name of log file or device:"
 
#define LOG_SCAN_STR   "scanning log"
 
#define NOT_MEANINGFUL_STR   "not meaningful in this context"
 
#define READ_STATUS_STR   "reading log status"
 
#define WRITE_STATUS_STR   "writing log status"
 
#define KEY_WORD_STR   "key word"
 
#define ZERO   0
 
#define MAX_TYPES   100 /* maximum number of types */
 
#define MAX_SHOW_KEYS   32 /* maximum number of key words */
 
#define MAX_SET_KEYS   20 /* maximum number of key words */
 
#define MAX_SEG_DICT_KEYS   10 /* maximum number of key words */
 
#define MAX_MONITOR_KEYS   20 /* maximum number of key words */
 
#define MAX_OPEN_KEYS   20 /* maximum number of key words */
 
#define MAX_RECOVER_KEYS   20 /* maximum number of key words */
 
#define MAX_REPLAY_KEYS   20 /* maximum number of key words */
 
#define MAX_CMDS   64 /* maximum number of cmds */
 
#define MAX_CMD_SWS   32
 

Typedefs

typedef char * chk_buffer_t()
 
typedef rvm_bool_t cmd_func_t()
 
typedef rvm_bool_t sw_func_t()
 

Enumerations

enum  format_flag_id {
  unknown_flag = -123456789 , byte_sw = 1 , char_sw = 2 , dec_sw = 4 ,
  float_sw = 8 , long_sw = 16 , octal_sw = 32 , offset_sw = 64 ,
  short_sw = 128 , tv_sw = 256 , unsigned_sw = 512 , hex_sw = 1024 ,
  double_sw = 2048
}
 
enum  key_id_t {
  UNKNOWN = -123456789 , ALL_KEY = 1 , CLEAR_KEY , FILE_KEY ,
  PAGE_KEY , NUM_KEY , REC_KEY , TIME_KEY ,
  UNAME_KEY , HEAD_KEY , TAIL_KEY , NO_TAIL_KEY ,
  LOG_START_KEY , LOG_STATUS_KEY , MODS_KEY , MONITOR_KEY ,
  NEXT_KEY , PREV_KEY , NEXT_SUB_KEY , SUB_KEY ,
  PREV_SUB_KEY , PREV_HEAD_KEY , PREV_TAIL_KEY , EARLY_KEY ,
  REMAINING_KEY , REC_END_KEY , REC_HDR_KEY , READ_ONLY_KEY ,
  UPDATE_KEY , NO_UPDATE_KEY , REPLAY_KEY , SEG_DICT_KEY ,
  STATISTICS_KEY , NOT_A_KEY , UNKNOWN = -123456789 , ALL_KEY = 1 ,
  ABORT_KEY , BLOCK_SIZE_KEY , BRK_KEY , CHK_ALLOC_KEY ,
  CHK_SUM_KEY , CYCLES_KEY , DATA_KEY , FLUSH_KEY ,
  FLUSH_BUF_KEY , INCR_KEY , LOG_KEY , MAX_READ_KEY ,
  MOBY_KEY , MOBY_MAX_KEY , MOD_SIZE_KEY , NONE_KEY ,
  OPS_KEY , OPT_KEY , PARMS_KEY , PLUMBER_KEY ,
  PRE_ALLOC_KEY , PRE_ALLOC_TRUNC_KEY , PRIORITY_KEY , QUIT_KEY ,
  RANGES_KEY , REC_BUF_KEY , RESTORE_KEY , RUN_KEY ,
  SEED_KEY , THREADS_KEY , TIME_KEY , TRANS_KEY ,
  TRUNC_KEY , EPOCH_TRUNC_KEY , INCR_TRUNC_TIME_KEY , VM_KEY ,
  CHK_RANGE_KEY , NO_YIELD_KEY , VM_PROT_KEY , VM_MAP_PRIV
}
 

Functions

int main (int argc, char *argv[])
 

Variables

rvm_bool_t rvm_inited
 
rvm_bool_t rvm_utlsw
 
device_trvm_errdev
 
log_tdefault_log
 
rvm_length_t page_size
 
rvm_length_t page_mask
 
char * rvm_errmsg
 
chk_vec_trvm_chk_vec
 
rvm_length_t rvm_chk_len
 
rvm_monitor_call_trvm_monitor
 
rvm_signal_call_trvm_chk_sigint
 
rvm_bool_t rvm_no_update
 
rvm_bool_t rvm_replay
 
char rvm_version
 
char rvm_log_version
 
char rvm_statistics_version
 

Macro Definition Documentation

◆ ALL_FORMATS

#define ALL_FORMATS
Value:
((unsigned long)(char_sw | dec_sw | octal_sw | hex_sw | unsigned_sw | \
@ hex_sw
Definition: rvmutl.c:136
@ tv_sw
Definition: rvmutl.c:134
@ char_sw
Definition: rvmutl.c:127
@ double_sw
Definition: rvmutl.c:137
@ octal_sw
Definition: rvmutl.c:131
@ unsigned_sw
Definition: rvmutl.c:135
@ dec_sw
Definition: rvmutl.c:128
@ offset_sw
Definition: rvmutl.c:132
@ float_sw
Definition: rvmutl.c:129

◆ ALL_SIZES

#define ALL_SIZES
Value:
((unsigned long)(byte_sw | long_sw | short_sw | offset_sw | float_sw | \
@ byte_sw
Definition: rvmutl.c:126
@ short_sw
Definition: rvmutl.c:133
@ long_sw
Definition: rvmutl.c:130

◆ CMD_MAX

#define CMD_MAX   2048 /* maximum cmd line length */

◆ DATA_END_STR

#define DATA_END_STR   "** end of data **"

◆ end_line

#define end_line (   c)    (((c) == '\0') || ((c) == '\n'))

◆ EOF_STR

#define EOF_STR   "** end of file **"

◆ incr_cur

#define incr_cur (   _i)    cmd_cur = &cmd_cur[_i]

◆ INIT_BUF_STR

#define INIT_BUF_STR   "initializing buffer"

◆ isoctal

#define isoctal (   c)    ((isdigit(c) && !(((c) == '8') || ((c) == '9'))))

◆ KEY_WORD_STR

#define KEY_WORD_STR   "key word"

◆ LINE_WIDTH

#define LINE_WIDTH   80 /* length of print line */

◆ LOG_NAME_PROMPT

#define LOG_NAME_PROMPT   "Enter name of log file or device:"

◆ LOG_SCAN_STR

#define LOG_SCAN_STR   "scanning log"

◆ MAX_CHARS

#define MAX_CHARS   255 /* maximum nuber of characters to print */

◆ MAX_CMD_SWS

#define MAX_CMD_SWS   32

◆ MAX_CMDS

#define MAX_CMDS   64 /* maximum number of cmds */

◆ MAX_MONITOR_KEYS

#define MAX_MONITOR_KEYS   20 /* maximum number of key words */

◆ MAX_OPEN_KEYS

#define MAX_OPEN_KEYS   20 /* maximum number of key words */

◆ MAX_RECOVER_KEYS

#define MAX_RECOVER_KEYS   20 /* maximum number of key words */

◆ MAX_REPLAY_KEYS

#define MAX_REPLAY_KEYS   20 /* maximum number of key words */

◆ MAX_SEG_DICT_KEYS

#define MAX_SEG_DICT_KEYS   10 /* maximum number of key words */

◆ MAX_SET_KEYS

#define MAX_SET_KEYS   20 /* maximum number of key words */

◆ MAX_SHOW_KEYS

#define MAX_SHOW_KEYS   32 /* maximum number of key words */

◆ MAX_TYPES

#define MAX_TYPES   100 /* maximum number of types */

◆ NOT_MEANINGFUL_STR

#define NOT_MEANINGFUL_STR   "not meaningful in this context"

◆ READ_STATUS_STR

#define READ_STATUS_STR   "reading log status"

◆ scan_stop

#define scan_stop (   c)    (end_line(c) || ((c) == '>') || ((c) == '#'))

◆ STICKY

#define STICKY   rvm_true

◆ STR_NAME_LEN

#define STR_NAME_LEN   31 /* maximum length of string name */

◆ WRITE_STATUS_STR

#define WRITE_STATUS_STR   "writing log status"

◆ ZERO

#define ZERO   0

Typedef Documentation

◆ chk_buffer_t

typedef char * chk_buffer_t()

◆ cmd_func_t

typedef rvm_bool_t cmd_func_t()

◆ sw_func_t

typedef rvm_bool_t sw_func_t()

Enumeration Type Documentation

◆ format_flag_id

Enumerator
unknown_flag 
byte_sw 
char_sw 
dec_sw 
float_sw 
long_sw 
octal_sw 
offset_sw 
short_sw 
tv_sw 
unsigned_sw 
hex_sw 
double_sw 

◆ key_id_t

enum key_id_t
Enumerator
UNKNOWN 
ALL_KEY 
CLEAR_KEY 
FILE_KEY 
PAGE_KEY 
NUM_KEY 
REC_KEY 
TIME_KEY 
UNAME_KEY 
HEAD_KEY 
TAIL_KEY 
NO_TAIL_KEY 
LOG_START_KEY 
LOG_STATUS_KEY 
MODS_KEY 
MONITOR_KEY 
NEXT_KEY 
PREV_KEY 
NEXT_SUB_KEY 
SUB_KEY 
PREV_SUB_KEY 
PREV_HEAD_KEY 
PREV_TAIL_KEY 
EARLY_KEY 
REMAINING_KEY 
REC_END_KEY 
REC_HDR_KEY 
READ_ONLY_KEY 
UPDATE_KEY 
NO_UPDATE_KEY 
REPLAY_KEY 
SEG_DICT_KEY 
STATISTICS_KEY 
NOT_A_KEY 
UNKNOWN 
ALL_KEY 
ABORT_KEY 
BLOCK_SIZE_KEY 
BRK_KEY 
CHK_ALLOC_KEY 
CHK_SUM_KEY 
CYCLES_KEY 
DATA_KEY 
FLUSH_KEY 
FLUSH_BUF_KEY 
INCR_KEY 
LOG_KEY 
MAX_READ_KEY 
MOBY_KEY 
MOBY_MAX_KEY 
MOD_SIZE_KEY 
NONE_KEY 
OPS_KEY 
OPT_KEY 
PARMS_KEY 
PLUMBER_KEY 
PRE_ALLOC_KEY 
PRE_ALLOC_TRUNC_KEY 
PRIORITY_KEY 
QUIT_KEY 
RANGES_KEY 
REC_BUF_KEY 
RESTORE_KEY 
RUN_KEY 
SEED_KEY 
THREADS_KEY 
TIME_KEY 
TRANS_KEY 
TRUNC_KEY 
EPOCH_TRUNC_KEY 
INCR_TRUNC_TIME_KEY 
VM_KEY 
CHK_RANGE_KEY 
NO_YIELD_KEY 
VM_PROT_KEY 
VM_MAP_PRIV 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Variable Documentation

◆ default_log

log_t* default_log
extern

◆ page_mask

rvm_length_t page_mask
extern

◆ page_size

rvm_length_t page_size
extern

◆ rvm_chk_len

rvm_length_t rvm_chk_len
extern

◆ rvm_chk_sigint

rvm_signal_call_t* rvm_chk_sigint
extern

◆ rvm_chk_vec

chk_vec_t* rvm_chk_vec
extern

◆ rvm_errdev

device_t* rvm_errdev
extern

◆ rvm_errmsg

char* rvm_errmsg
extern

◆ rvm_inited

rvm_bool_t rvm_inited
extern

◆ rvm_log_version

char rvm_log_version
extern

◆ rvm_monitor

rvm_monitor_call_t* rvm_monitor
extern

◆ rvm_no_update

rvm_bool_t rvm_no_update
extern

◆ rvm_replay

rvm_bool_t rvm_replay
extern

◆ rvm_statistics_version

char rvm_statistics_version
extern

◆ rvm_utlsw

rvm_bool_t rvm_utlsw
extern

◆ rvm_version

char rvm_version
extern