Add packaging/libsqlfs.changes file
[platform/core/base/libsqlfs.git] / sqlfs.h
1 /******************************************************************************
2 Copyright 2006 Palmsource, Inc (an ACCESS company). 
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Lesser General Public
6 License as published by the Free Software Foundation; either
7 version 2.1 of the License, or (at your option) any later version.
8  
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 Lesser General Public License for more details.
13  
14 You should have received a copy of the GNU Lesser General Public
15 License along with this library; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17
18 *****************************************************************************/
19 /*!
20  * @file sqlfs.h
21  *
22  * @brief File public header for file system on top of a SQL database library
23  *  APIs
24  *
25  *****************************************************************************/
26
27
28 #ifndef __SQLFS__H__
29 #define __SQLFS__H__
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35
36 #include <stdint.h>
37 #include <sys/types.h>
38 #include <sys/stat.h>
39 #include <sys/statvfs.h>
40 #include <unistd.h>
41 #include <fcntl.h>
42 #include <errno.h>
43 #include <utime.h>
44
45
46
47 #ifndef FUSE
48
49 /* the following struct derived from the FUSE header file 
50
51     FUSE: Filesystem in Userspace
52     Copyright (C) 2001-2006  Miklos Szeredi <miklos@szeredi.hu>
53
54     This program can be distributed under the terms of the GNU LGPL.
55 */
56
57 /**
58  * Information about open files
59  *
60  * Changed in version 2.5
61  */
62 struct fuse_file_info {
63     /** Open flags.  Available in open() and release() */
64     int flags;
65
66     /** Old file handle, don't use */
67     unsigned long fh_old;
68
69     /** In case of a write operation indicates if this was caused by a
70         writepage */
71     int writepage;
72
73     /** Can be filled in by open, to use direct I/O on this file.
74         Introduced in version 2.4 */
75     unsigned int direct_io : 1;
76
77     /** Can be filled in by open, to indicate, that cached file data
78         need not be invalidated.  Introduced in version 2.4 */
79     unsigned int keep_cache : 1;
80
81     /** Padding.  Do not use*/
82     unsigned int padding : 30;
83
84     /** File handle.  May be filled in by filesystem in open().
85         Available in all other file operations */
86     uint64_t fh;
87 };
88
89
90 /** Function to add an entry in a readdir() operation
91  *
92  * @param buf the buffer passed to the readdir() operation
93  * @param name the file name of the directory entry
94  * @param stat file attributes, can be NULL
95  * @param off offset of the next entry or zero
96  * @return 1 if buffer is full, zero otherwise
97  */
98 typedef int (*fuse_fill_dir_t) (void *buf, const char *name,
99                                 const struct stat *stbuf, off_t off);
100
101
102 #else
103
104 #include "fuse.h"
105
106 #endif
107
108 #include "sqlfs_internal.h"
109
110 int sqlfs_init(const char *);
111
112 #ifdef FUSE
113 int sqlfs_fuse_main(int argc, char **argv);
114 #endif
115
116      
117
118 #ifdef __cplusplus
119 }       // extern "C"
120 #endif
121
122 #endif
123
124                   
125                   
126
127