xref: /nrf52832-nimble/rt-thread/components/dfs/filesystems/uffs/src/inc/uffs/uffs_find.h (revision 104654410c56c573564690304ae786df310c91fc)
1 /*
2   This file is part of UFFS, the Ultra-low-cost Flash File System.
3 
4   Copyright (C) 2005-2009 Ricky Zheng <[email protected]>
5 
6   UFFS is free software; you can redistribute it and/or modify it under
7   the GNU Library General Public License as published by the Free Software
8   Foundation; either version 2 of the License, or (at your option) any
9   later version.
10 
11   UFFS is distributed in the hope that it will be useful, but WITHOUT
12   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14   or GNU Library General Public License, as applicable, for more details.
15 
16   You should have received a copy of the GNU General Public License
17   and GNU Library General Public License along with UFFS; if not, write
18   to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19   Boston, MA  02110-1301, USA.
20 
21   As a special exception, if other files instantiate templates or use
22   macros or inline functions from this file, or you compile this file
23   and link it with other works to produce a work based on this file,
24   this file does not by itself cause the resulting work to be covered
25   by the GNU General Public License. However the source code for this
26   file must still be made available in accordance with section (3) of
27   the GNU General Public License v2.
28 
29   This exception does not invalidate any other reasons why a work based
30   on this file might be covered by the GNU General Public License.
31 */
32 
33 /**
34  * \file uffs_find.h
35  * \brief find objects under dir
36  * \author Ricky Zheng
37  */
38 
39 #ifndef _UFFS_FIND_H_
40 #define _UFFS_FIND_H_
41 
42 #include "uffs/uffs_fs.h"
43 
44 #ifdef __cplusplus
45 extern "C"{
46 #endif
47 
48 typedef struct uffs_FindInfoSt {
49 	uffs_Device *dev;				//!< the device to be searched
50 	u16 serial;						//!< the dir serial number
51 	int step;						//!< step:	0 - working on dir entries,
52 									//			1 - working on file entries,
53 									//			2 - stoped.
54 	int hash;						//!< hash entry, internal used
55 	TreeNode *work;					//!< working node, internal used.
56 	int pos;						//!< current position
57 } uffs_FindInfo;
58 
59 
60 URET uffs_GetObjectInfo(uffs_Object *obj, uffs_ObjectInfo *info, int *err);
61 URET uffs_FindObjectOpen(uffs_FindInfo *find_handle, uffs_Object *dir);
62 URET uffs_FindObjectOpenEx(uffs_FindInfo *f, uffs_Device *dev, int dir);
63 URET uffs_FindObjectFirst(uffs_ObjectInfo *info, uffs_FindInfo *find_handle);
64 URET uffs_FindObjectNext(uffs_ObjectInfo *info, uffs_FindInfo *find_handle);
65 URET uffs_FindObjectRewind(uffs_FindInfo *find_handle);
66 URET uffs_FindObjectClose(uffs_FindInfo * find_handle);
67 
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
73 
74 #endif
75 
76 
77