fbeda341c6421a56440e403690339063731363c8
[debian/amanda] / server-src / logfile.h
1 /*
2  * Amanda, The Advanced Maryland Automatic Network Disk Archiver
3  * Copyright (c) 1991-1998 University of Maryland at College Park
4  * All Rights Reserved.
5  *
6  * Permission to use, copy, modify, distribute, and sell this software and its
7  * documentation for any purpose is hereby granted without fee, provided that
8  * the above copyright notice appear in all copies and that both that
9  * copyright notice and this permission notice appear in supporting
10  * documentation, and that the name of U.M. not be used in advertising or
11  * publicity pertaining to distribution of the software without specific,
12  * written prior permission.  U.M. makes no representations about the
13  * suitability of this software for any purpose.  It is provided "as is"
14  * without express or implied warranty.
15  *
16  * U.M. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL U.M.
18  * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
20  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22  *
23  * Author: James da Silva, Systems Design and Analysis Group
24  *                         Computer Science Department
25  *                         University of Maryland at College Park
26  */
27 /*
28  * $Id: logfile.h,v 1.12 2005/11/29 22:19:08 martinea Exp $
29  *
30  * interface to logfile module
31  */
32 #ifndef LOGFILE_H
33 #define LOGFILE_H
34
35 #include "amanda.h"
36
37 /*
38  * L_FAIL is defined on m88k-motorola-sysv4 systems for multiprocessor
39  * support, which we don't need, so it gets undefined here.
40  */
41 #undef L_FAIL
42
43 typedef enum logtype_e {
44     L_BOGUS,
45     L_FATAL,            /* program died for some reason, used by error() */
46     L_ERROR, L_WARNING, L_INFO, L_SUMMARY,       /* information messages */
47     L_START, L_FINISH,                               /* start/end of run */
48     L_DISK,                                                      /* disk */
49     L_SUCCESS, L_PARTIAL, L_FAIL, L_STRANGE,        /* the end of a dump */
50     L_CHUNK, L_CHUNKSUCCESS,                            /* ... continued */
51     L_STATS,                                               /* statistics */
52     L_MARKER,                                     /* marker for reporter */
53     L_CONT                       /* continuation line, used when reading */
54 } logtype_t;
55
56 typedef enum program_e {
57     P_UNKNOWN, P_PLANNER, P_DRIVER, P_REPORTER, P_DUMPER, P_CHUNKER,
58     P_TAPER, P_AMFLUSH
59 } program_t;
60 #define P_LAST P_AMFLUSH
61
62 extern char *logtype_str[];
63
64 extern int curlinenum;
65 extern logtype_t curlog;
66 extern program_t curprog;
67 extern char *curstr;
68 extern char *program_str[];
69
70 void logerror P((char *));
71 void log_add P((logtype_t typ, char * format, ...))
72     __attribute__ ((format (printf, 2, 3)));
73 char* log_genstring P((logtype_t typ, char *pname, char * format, ...));
74 /*    __attribute__ ((format (printf, 3, 4))); */
75 void log_start_multiline P((void));
76 void log_end_multiline P((void));
77 void log_rename P((char *datestamp));
78 int get_logline P((FILE *));
79
80 #endif  /* ! LOGFILE_H */