X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=ossec-hids.git;a=blobdiff_plain;f=src%2Fheaders%2Ffile_op.h;h=d1b0956108fff66d96cc6cc1d7835372c4267081;hp=9dc3045ae86fea1d924eb59b4bc02787b31726ac;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hpb=927951d1c1ad45ba9e7325f07d996154a91c911b diff --git a/src/headers/file_op.h b/src/headers/file_op.h old mode 100755 new mode 100644 index 9dc3045..d1b0956 --- a/src/headers/file_op.h +++ b/src/headers/file_op.h @@ -1,6 +1,3 @@ -/* @(#) $Id: ./src/headers/file_op.h, 2011/09/08 dcid Exp $ - */ - /* Copyright (C) 2009 Trend Micro Inc. * All rights reserved. * @@ -10,44 +7,43 @@ * Foundation */ -/* Part of the OSSEC HIDS - * Available at http://www.ossec.net/hids/ - */ - -/* Functions to handle operation with files - */ +/* Functions to handle operation with files */ #ifndef __FILE_H - #define __FILE_H -#define OS_PIDFILE "/var/run" +#include -/* Set the program name. Must be done before **anything** else */ -void OS_SetName(char *name); +#define OS_PIDFILE "/var/run" -int File_DateofChange(char *file); +/* Set the program name - must be done before *anything* else */ +void OS_SetName(const char *name) __attribute__((nonnull)); -int IsDir(char *file); +time_t File_DateofChange(const char *file) __attribute__((nonnull)); -int CreatePID(char *name, int pid); +int IsDir(const char *file) __attribute__((nonnull)); -int DeletePID(char *name); +int CreatePID(const char *name, int pid) __attribute__((nonnull)); -int MergeFiles(char *finalpath, char **files); +char *GetRandomNoise(); -int MergeAppendFile(char *finalpath, char *files); +int DeletePID(const char *name) __attribute__((nonnull)); -int UnmergeFiles(char *finalpath, char *optdir); +int MergeFiles(const char *finalpath, char **files) __attribute__((nonnull)); -/* daemonize a process */ -void goDaemon(); +int MergeAppendFile(const char *finalpath, const char *files) __attribute__((nonnull(1))); -/* daemonize a process without closing stdin/stdou/stderr */ -void goDaemonLight(); +int UnmergeFiles(const char *finalpath, const char *optdir) __attribute__((nonnull(1))); + +/* Daemonize a process */ +void goDaemon(void); + +/* Daemonize a process without closing stdin/stdout/stderr */ +void goDaemonLight(void); + +/* Not really a file operation, but returns the uname */ +char *getuname(void); -/* not really a file operation, but returns the uname */ -char *getuname(); /* Return basename of path */ char *basename_ex(char *path) __attribute__((nonnull)); @@ -57,11 +53,11 @@ int rename_ex(const char *source, const char *destination) __attribute__((nonnul /* Create temporary file */ int mkstemp_ex(char *tmp_path) __attribute__((nonnull)); - -/* Checks for vista. */ +/* Checks for Windows Vista */ #ifdef WIN32 int checkVista(); int isVista; #endif -#endif +int w_ref_parent_folder(const char * path); +#endif /* __FILE_H */