Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Examples  

files.h

Go to the documentation of this file.
00001 /*! \file files.h
00002     Header file for file.c.
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 /*! \brief This value is used by various functions that need to allocate buffers. This represents the initial size of the
00029            buffer (in bytes).
00030  */
00031 #define FILES_UTIL_INIT_BUFF_SIZE   2048
00032 
00033 /*! \brief Return value for the function read_file(). The function can not allocate memory.
00034  */
00035 #define FILES_UTIL_MALLOC_ERR       -1
00036 
00037 /*! \brief Return value for the function read_file(). An error occured while reading the input file.
00038  */
00039 #define FILES_UTIL_READ_ERR         -2
00040 
00041 /*! \brief Return value for the function read_file(). Can not open the input file.
00042  */
00043 #define FILES_UTIL_OPEN_ERR         -3
00044 
00045 /*! \brief Return value for the function set_timeout_file(). Can not open target file.
00046  */
00047 #define SET_TIMEOUT_FILE_OPEN_ERROR   -4
00048 
00049 /*! \brief Return value for the function set_timeout_file(). An error occured while writing into the target file.
00050  */
00051 #define SET_TIMEOUT_FILE_WRITE_ERROR  -5 
00052 
00053 /*! \brief Return value for the function set_timeout_file(). Timeout file set correctly.
00054  */
00055 #define SET_TIMEOUT_FILE_OK           -6
00056 
00057 /*! \brief Return value for the function test_timeout_file(). The timeout is passed.
00058  */ 
00059 #define TEST_TIMEOUT_FILE_TIMEOUT_ELLAPSED  -7
00060 
00061 /*! \brief Return value for the function test_timeout_file(). An error occured while reading the timeout file.
00062  */
00063 #define TEST_TIMEOUT_FILE_READ_ERROR  -8
00064 
00065 /*! \brief Return value for the function test_timeout_file(). The timeout is not passed (you may have to wait).
00066  */
00067 #define TEST_TIMEOUT_FILE_TIMEOUT_NOT_ELLAPSED  -9
00068 
00069 /*! \brief Return value for the function test_timeout_file(). The function could not delete the timeout file.
00070  */
00071 #define TEST_TIMEOUT_FILE_UNLINK_FAILED -10
00072 
00073 #define FILES_HD
00074 #endif 
00075 
00076 #ifdef __cplusplus
00077 }
00078 #endif
00079 

Generated on Thu Apr 3 16:23:43 2003 for Common_C_libraries by doxygen1.3-rc1