00001
00002
00003
00004
00005 #ifdef __cplusplus
00006 extern "C" {
00007 #endif
00008
00009
00010 #ifndef FILES_HD
00011
00012 #include <unistd.h>
00013 #include <errno.h>
00014 #include <stdlib.h>
00015 #include <stdio.h>
00016 #include <time.h>
00017
00018
00019 #include "flock.h"
00020
00021 int wait_for_file (char* file_name, int period, char* stop_file);
00022 char* wait_for_multiple_file (char **file_names, int period, char* stop_file);
00023 int read_file (char *file_name, char **buff);
00024 int set_timeout_file (char *filename);
00025 int test_timeout_file (char *filename, int timeout);
00026 void basename (char *src, char *dst);
00027
00028
00029
00030
00031 #define FILES_UTIL_INIT_BUFF_SIZE 2048
00032
00033
00034
00035 #define FILES_UTIL_MALLOC_ERR -1
00036
00037
00038
00039 #define FILES_UTIL_READ_ERR -2
00040
00041
00042
00043 #define FILES_UTIL_OPEN_ERR -3
00044
00045
00046
00047 #define SET_TIMEOUT_FILE_OPEN_ERROR -4
00048
00049
00050
00051 #define SET_TIMEOUT_FILE_WRITE_ERROR -5
00052
00053
00054
00055 #define SET_TIMEOUT_FILE_OK -6
00056
00057
00058
00059 #define TEST_TIMEOUT_FILE_TIMEOUT_ELLAPSED -7
00060
00061
00062
00063 #define TEST_TIMEOUT_FILE_READ_ERROR -8
00064
00065
00066
00067 #define TEST_TIMEOUT_FILE_TIMEOUT_NOT_ELLAPSED -9
00068
00069
00070
00071 #define TEST_TIMEOUT_FILE_UNLINK_FAILED -10
00072
00073 #define FILES_HD
00074 #endif
00075
00076 #ifdef __cplusplus
00077 }
00078 #endif
00079