X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=src%2Fheaders%2Ffile_op.h;h=d1b0956108fff66d96cc6cc1d7835372c4267081;hb=3f728675941dc69d4e544d3a880a56240a6e394a;hp=921b46d7310987115db79f769faa2c55a63f359e;hpb=914feba5d54f979cd5d7e69c349c3d01f630042a;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 921b46d..d1b0956 --- a/src/headers/file_op.h +++ b/src/headers/file_op.h @@ -1,57 +1,63 @@ -/* @(#) $Id: file_op.h,v 1.14 2009/06/24 17:06:26 dcid Exp $ */ - /* Copyright (C) 2009 Trend Micro Inc. * All rights reserved. * * This program is a free software; you can redistribute it * and/or modify it under the terms of the GNU General Public - * License (version 3) as published by the FSF - Free Software + * License (version 2) as published by the FSF - Free Software * 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 + +#define OS_PIDFILE "/var/run" -/* Set the program name. Must be done before **anything** else */ -void OS_SetName(char *name); +/* Set the program name - must be done before *anything* else */ +void OS_SetName(const char *name) __attribute__((nonnull)); -int File_DateofChange(char *file); +time_t File_DateofChange(const char *file) __attribute__((nonnull)); -int IsDir(char *file); +int IsDir(const char *file) __attribute__((nonnull)); -int CreatePID(char *name, int pid); +int CreatePID(const char *name, int pid) __attribute__((nonnull)); -int DeletePID(char *name); +char *GetRandomNoise(); -int MergeFiles(char *finalpath, char **files); +int DeletePID(const char *name) __attribute__((nonnull)); -int MergeAppendFile(char *finalpath, char *files); +int MergeFiles(const char *finalpath, char **files) __attribute__((nonnull)); -int UnmergeFiles(char *finalpath, char *optdir); +int MergeAppendFile(const char *finalpath, const char *files) __attribute__((nonnull(1))); -/* daemonize a process */ -void goDaemon(); +int UnmergeFiles(const char *finalpath, const char *optdir) __attribute__((nonnull(1))); -/* daemonize a process without closing stdin/stdou/stderr */ -void goDaemonLight(); +/* Daemonize a process */ +void goDaemon(void); -/* not really a file operation, but returns the uname */ -char *getuname(); +/* Daemonize a process without closing stdin/stdout/stderr */ +void goDaemonLight(void); -/* Checks for vista. */ +/* 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 */