Commit f0b16569 authored by jdelange's avatar jdelange

* po-hi-c/include/po_hi_storage.h

   po-hi-c/src/po_hi_storage.c
   - Start implementation of the file storage service


git-svn-id: https://tecsw.estec.esa.int/svn/taste/trunk/po-hi-c@3533 129961e7-ef38-4bb5-a8f7-c9a525a55882
parent 7f56e13f
...@@ -49,17 +49,26 @@ ...@@ -49,17 +49,26 @@
#define __PO_HI_STORAGE_MAX_PACKET_STORES 100 #define __PO_HI_STORAGE_MAX_PACKET_STORES 100
#endif #endif
#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#endif
typedef struct typedef struct
{ {
int file_id; int file_id;
char filename[__PO_HI_STORAGE_FILENAME_MAXLENGTH]; char filename[__PO_HI_STORAGE_FILENAME_MAXLENGTH];
#if defined (POSIX) || defined (RTEMS_POSIX) || defined (XENO_POSIX)
int fd;
#endif
} __po_hi_storage_file_t; } __po_hi_storage_file_t;
typedef struct typedef struct
{ {
int dir_id; int dir_id;
char dirname[__PO_HI_STORAGE_FILENAME_MAXLENGTH];
char filename[__PO_HI_STORAGE_DIRECTORY_MAXFILES][__PO_HI_STORAGE_FILENAME_MAXLENGTH]; char filename[__PO_HI_STORAGE_DIRECTORY_MAXFILES][__PO_HI_STORAGE_FILENAME_MAXLENGTH];
} __po_hi_storage_dir_t; } __po_hi_storage_dir_t;
...@@ -105,7 +114,7 @@ typedef struct ...@@ -105,7 +114,7 @@ typedef struct
* It returns the following potential values: * It returns the following potential values:
* - __PO_HI_SUCCESS: successful operation * - __PO_HI_SUCCESS: successful operation
* - __PO_HI_TOOMANY: too may files are open at this time, cannot open more. * - __PO_HI_TOOMANY: too may files are open at this time, cannot open more.
* - __PO_HI_INVALID: supplied filename is invalid * - __PO_HI_INVALID: supplied filename is invalid (invalid characters or too long)
*/ */
int __po_hi_storage_file_open (const char* filename, __po_hi_storage_file_t*); int __po_hi_storage_file_open (const char* filename, __po_hi_storage_file_t*);
...@@ -122,7 +131,7 @@ int __po_hi_storage_file_open (const char* filename, __po_hi_storage_file_t*); ...@@ -122,7 +131,7 @@ int __po_hi_storage_file_open (const char* filename, __po_hi_storage_file_t*);
* - __PO_HI_ERROR_EXISTS : File already exists * - __PO_HI_ERROR_EXISTS : File already exists
* - __PO_HI_INVALID : Invalid file * - __PO_HI_INVALID : Invalid file
*/ */
int __po_hi_storage_file_create (const __po_hi_storage_file_t* file); int __po_hi_storage_file_create (__po_hi_storage_file_t* file);
/** /**
* \fn __po_hi_storage_file_read * \fn __po_hi_storage_file_read
...@@ -190,7 +199,7 @@ int __po_hi_storage_file_delete (const __po_hi_storage_file_t* file); ...@@ -190,7 +199,7 @@ int __po_hi_storage_file_delete (const __po_hi_storage_file_t* file);
* - __PO_HI_ERROR_EXISTS : The destination file (second argument) already * - __PO_HI_ERROR_EXISTS : The destination file (second argument) already
* exists. * exists.
*/ */
int __po_hi_storage_file_rename (const __po_hi_storage_file_t* oldfile,const __po_hi_storage_file_t* newfile); int __po_hi_storage_file_rename (const __po_hi_storage_file_t* oldfile, __po_hi_storage_file_t* newfile);
/** /**
* \fn __po_hi_storage_file_append * \fn __po_hi_storage_file_append
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment