X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Fheaders%2Ffile_op.h;h=d1b0956108fff66d96cc6cc1d7835372c4267081;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hp=7b07c4a98cf097a03f64aaa1700573d3c02fa7ab;hpb=6ef2f786c6c8ead94841b5f93baf9f43421f08c8;p=ossec-hids.git diff --git a/src/headers/file_op.h b/src/headers/file_op.h old mode 100755 new mode 100644 index 7b07c4a..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,49 +7,57 @@ * 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))); -/* not really a file operation, but returns the uname */ -char *getuname(); +/* Daemonize a process */ +void goDaemon(void); -/* Checks for vista. */ +/* Daemonize a process without closing stdin/stdout/stderr */ +void goDaemonLight(void); + +/* Not really a file operation, but returns the uname */ +char *getuname(void); + +/* Return basename of path */ +char *basename_ex(char *path) __attribute__((nonnull)); + +/* Rename file or directory */ +int rename_ex(const char *source, const char *destination) __attribute__((nonnull)); + +/* Create temporary file */ +int mkstemp_ex(char *tmp_path) __attribute__((nonnull)); + +/* Checks for Windows Vista */ #ifdef WIN32 int checkVista(); int isVista; #endif -#endif +int w_ref_parent_folder(const char * path); +#endif /* __FILE_H */