Changeset 353 in MondoRescue for branches/stable/monitas/structs.h


Ignore:
Timestamp:
Jan 28, 2006, 6:42:59 PM (18 years ago)
Author:
bcornec
Message:

monitas latest version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/monitas/structs.h

    r352 r353  
    11/* structs.h
    22
     307/17
     4- add central global struct
    35
    4606/16
    5 - added CLIENT_RCFILE
     7- added CLIENT_RCFILE [moved to common.c on 07/17]
    68- added .bodyAux to msg record structure
    79
    81006/14
    9 - added SERVER_COMDEV and CLIENT_COMDEV
     11- added SERVER_COMDEV and CLIENT_COMDEV [moved to common.c on 07/17]
    1012
    111306/11
     
    4547
    4648
    47 #define log_it(x,y) { log_it_SUB(g_logfile,x,y); }
     49/* moved to common.c :
    4850#define CLIENT_RCFILE "/root/.monitas-client.rc"
    4951#define CLIENT_COMDEV "/var/spool/monitas/client-input.dev"
    5052#define SERVER_COMDEV "/var/spool/monitas/server-input.dev"
    5153#define SERVER_STATUS_FILE "/var/spool/monitas/server-status.txt"
     54*/
    5255#define MAX_STR_LEN 510
    5356#define MAX_PENDING 8 /* silently limited to 5 by BSD, says a Linux manual */
     
    5659#define XFER_BUF_SIZE 16384 /* for sending archives between client and server */
    5760                            /* NB: 32768 doesn't work; don't ask me why */
     61
    5862typedef enum { false=0, true=1} bool;
    5963typedef enum { unused=0, login, logout, ping, pong, login_ok, logout_ok,
     
    6367                begin_stream, end_stream, user_req, progress_rpt } t_msg;
    6468typedef enum { debug, info, warn, error, fatal } t_loglevel;
     69
     70
     71//#define log_it(x,y) { log_it_SUB(g_logfile,x,y); }
     72#ifndef __XSTR
     73#   define __XSTR(x) _XSTR(x)
     74#   define _XSTR(x) #x
     75#endif
     76#define log_it(lvl,msg,args...) { logToFile(g->logfile,lvl,__FILE__,__XSTR(__LINE__),__FUNCTION__,msg , ## args); }
     77extern void logToFile(char *logfile, t_loglevel level, char *filename, char *lineno, char *funcname, char *sz_message, ...);
     78
     79
     80/*
     81 * Global structure for all data that doesn't change at runtime.
     82 * The data may be modified at program start via command line options,
     83 * or -not implemented yet- via environment variables or server-client
     84 * communication.
     85 */
     86struct s_globaldata
     87{
     88    char *client_rcfile;        // path+name of client's rc file
     89    char *client_comdev;        // path+name of client's
     90    char *server_comdev;        // path+name of server's
     91    char *server_status_file;   // path+name of server's
     92
     93    char *logfile;              // path+name of logfile
     94    t_loglevel loglevel;        // lowest level of msg written in the logfile
     95};
     96/*
     97 * there is one (1) global instance of above struct [defined in common.c] and
     98 * one global pointer [also in common.c] to address the struct inside all functions.
     99 * The pointer is declared here as external to permit the global access.
     100 */
     101extern struct s_globaldata *g;
     102
     103
    65104
    66105
Note: See TracChangeset for help on using the changeset viewer.