cbf_context.h

Go to the documentation of this file.
00001 
00002 #ifndef CBF_CONTEXT_H
00003 #define CBF_CONTEXT_H
00004 
00005 #ifdef __cplusplus
00006 
00007 extern "C" {
00008 
00009 #endif
00010 
00011 #include "cbf_file.h"
00012 
00013 #include <stdio.h>
00014 
00015 
00016   /* Context structure */
00017 
00018 typedef struct
00019 {
00020   cbf_file *temporary;       /* Temporary file */
00021 
00022   unsigned int connections;  /* Number of pointers to this structure */
00023 }
00024 cbf_context;
00025 
00026 
00027   /* Create and initialise a context */
00028 
00029 int cbf_make_context (cbf_context **context);
00030 
00031 
00032   /* Free a context */
00033 
00034 int cbf_free_context (cbf_context **context);
00035 
00036 
00037   /* Add a context connection */
00038 
00039 int cbf_add_contextconnection (cbf_context **context);
00040 
00041 
00042   /* Remove a context connection */
00043 
00044 int cbf_delete_contextconnection (cbf_context **context);
00045 
00046 
00047   /* Open a temporary file connection */
00048 
00049 int cbf_open_temporary (cbf_context *context, cbf_file **temporary);
00050 
00051 
00052   /* Close a temporary file connection */
00053 
00054 int cbf_close_temporary (cbf_context *context, cbf_file **temporary);
00055 
00056 
00057   /* Copy a string */
00058 
00059 const char *cbf_copy_string (cbf_context *context, const char *string, 
00060                                                          char type);
00061 
00062 
00063   /* Free a string */
00064 
00065 void cbf_free_string (cbf_context *context, const char *string);
00066 
00067 
00068 #ifdef __cplusplus
00069 
00070 }
00071 
00072 #endif
00073 
00074 #endif /* CBF_CONTEXT_H */
00075