-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfspy.h
85 lines (75 loc) · 3.34 KB
/
fspy.h
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
78
79
80
81
82
83
84
85
/************************************************************************
* fspy - experimental POC linux filesystem activity monitor *
* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *
* it's based on the new linux kernel inotify interface (merged into *
* the 2.6.13 linux kernel) *
* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ *
* this code was tested on 2.6.18.4 and newer kernels *
************************************************************************
* Copyright (C) 2007 Richard Sammet (e-axe) *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* http://www.gnu.org/licenses/gpl.txt *
************************************************************************
* Contact, Bugs & Infos: *
************************************************************************
* Some infos: *
* - tabstop size: *
* set ts=2 *
************************************************************************/
#ifndef _FSPY_H
#define _FSPY_H
#include <sys/stat.h> /* required -> struct stat */
#include "enumdirs.h" /* needed -> ELEMENT_SIZE */
#define WEBSITE "http://mytty.org/fspy/"
#define TRUE 1
#define FALSE 0
/* how long could a regex be? */
#define MAXREGEXLEN 128
/* how long could a typestring be? */
#define MAXTYPELEN 128
/* how long could a output string be? */
#define MAXOUTSTRLEN 128
/* how long could a diff string be? */
#define MAXDIFFSTRLEN MAXOUTSTRLEN
/* how deep you wanna look into your folder hirachie? */
#define MINRECURDEPTH 1
#define MAXRECURDEPTH 99
/* size of the event structure, not counting name */
#define EVENT_SIZE (sizeof(struct inotify_event))
/* reasonable guess as to size of 1024 events */
#define BUF_LEN (1024 * (EVENT_SIZE + 16))
typedef int boolean_t;
struct felement {
unsigned int id;
unsigned int wd;
char path[ELEMENT_SIZE];
};
struct festat {
unsigned int id;
char path[ELEMENT_SIZE];
struct stat statdat;
};
struct diffprint {
unsigned int s;
unsigned int A;
unsigned int M;
unsigned int S;
unsigned int O;
unsigned int U;
unsigned int G;
unsigned int I;
unsigned int D;
};
#endif