-
Notifications
You must be signed in to change notification settings - Fork 0
/
gregg_yjobs.c
77 lines (70 loc) · 2.97 KB
/
gregg_yjobs.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*============================---(source-start)---============================*/
#include "gregg.h"
/*
* metis § ····· § create a binary database for normal use § N33N0F § · §
* metis § ····· § add gather for pulling dictionaries and and making database § N33N0c § · §
*
*
*/
/*====================------------------------------------====================*/
/*===---- main driver ----===*/
/*====================------------------------------------====================*/
static void o___DRIVER__________o () { return; }
char
gregg_yjobs (cchar a_req, cchar *a_data)
{
/*---(locals)-----------+-----+-----+-*/
char rc = 0;
int l = 0;
/*---(header)-------------------------*/
DEBUG_PROG yLOG_enter (__FUNCTION__);
DEBUG_PROG yLOG_char ("a_req" , a_req);
DEBUG_PROG yLOG_info ("a_data" , a_data);
/*---(handle)-------------------------*/
switch (a_req) {
case YJOBS_READ :
DEBUG_PROG yLOG_note ("read database");
if (!yJOBS_ifgather ()) rc = DB_read (NAME_DB);
break;
case YJOBS_STATS :
DEBUG_PROG yLOG_note ("called for stats");
rc = DB_stats (NAME_DB);
break;
case YJOBS_WRITE :
DEBUG_PROG yLOG_note ("write database");
rc = DB_write (NAME_DB);
break;
case YJOBS_PULL :
DEBUG_PROG yLOG_note ("called for pull");
rc = DICT_import (a_data);
break;
case YJOBS_LOCALRPT :
DEBUG_PROG yLOG_note ("called for localrpt");
/*> l = strlen (a_data); <*
*> if (a_data [l - 1] == '/') my.source = DATA_SOURCES; <*
*> else my.source = DATA_FILE; <*
*> my.source = DATA_FILE; <*
*> strlcpy (my.file, a_data, LEN_PATH); <*/
break;
case YJOBS_REPORT :
DEBUG_PROG yLOG_note ("called for report");
/*> rc = metis_inventory (); <*/
/*> rc = metis_rptg_matrix (); <*/
break;
/*> case YJOBS_ONLY : <*
*> DEBUG_PROG yLOG_note ("called for only"); <*
*> break; <*/
case YJOBS_PURGE :
DEBUG_PROG yLOG_note ("called for purge");
rc = WORDS_purge ();
break;
}
/*---(trouble)------------------------*/
if (rc < 0) {
DEBUG_PROG yLOG_exitr (__FUNCTION__, rc);
return rc;
}
/*---(complete)-----------------------*/
DEBUG_PROG yLOG_exit (__FUNCTION__);
return 0;
}