Imported Upstream version 2.7
[ossec-hids.git] / src / headers / file_op.h
1 /* @(#) $Id: ./src/headers/file_op.h, 2011/09/08 dcid Exp $
2  */
3
4 /* Copyright (C) 2009 Trend Micro Inc.
5  * All rights reserved.
6  *
7  * This program is a free software; you can redistribute it
8  * and/or modify it under the terms of the GNU General Public
9  * License (version 2) as published by the FSF - Free Software
10  * Foundation
11  */
12
13 /* Part of the OSSEC HIDS
14  * Available at http://www.ossec.net/hids/
15  */
16
17 /* Functions to handle operation with files
18  */
19
20 #ifndef __FILE_H
21
22 #define __FILE_H
23
24 #define OS_PIDFILE      "/var/run"
25
26 /* Set the program name. Must be done before **anything** else */
27 void OS_SetName(char *name);
28
29 int File_DateofChange(char *file);
30
31 int IsDir(char *file);
32
33 int CreatePID(char *name, int pid);
34
35 int DeletePID(char *name);
36
37 int MergeFiles(char *finalpath, char **files);
38
39 int MergeAppendFile(char *finalpath, char *files);
40
41 int UnmergeFiles(char *finalpath, char *optdir);
42
43 /* daemonize a process */
44 void goDaemon();
45
46 /* daemonize a process without closing stdin/stdou/stderr */
47 void goDaemonLight();
48
49 /* not really a file operation, but returns the uname */
50 char *getuname();
51
52 /* Checks for vista. */
53 #ifdef WIN32
54 int checkVista();
55 int isVista;
56 #endif
57
58 #endif