Barracuda Application Server C/C++ Reference
Native APIs, integration guides, and platform interfaces
VirDir.h
1/*
2 * ____ _________ __ _
3 * / __ \___ ____ _/ /_ __(_)___ ___ ___ / / ____ ____ _(_)____
4 * / /_/ / _ \/ __ `/ / / / / / __ `__ \/ _ \/ / / __ \/ __ `/ / ___/
5 * / _, _/ __/ /_/ / / / / / / / / / / / __/ /___/ /_/ / /_/ / / /__
6 * /_/ |_|\___/\__,_/_/ /_/ /_/_/ /_/ /_/\___/_____/\____/\__, /_/\___/
7 * /____/
8 *
9 * Barracuda Embedded Web-Server
10 *
11 ****************************************************************************
12 * HEADER
13 *
14 * $Id: VirDir.h 4915 2021-12-01 18:26:55Z wini $
15 *
16 * COPYRIGHT: Real Time Logic, 2006
17 *
18 * This software is copyrighted by and is the sole property of Real
19 * Time Logic LLC. All rights, title, ownership, or other interests in
20 * the software remain the property of Real Time Logic LLC. This
21 * software may only be used in accordance with the terms and
22 * conditions stipulated in the corresponding license agreement under
23 * which the software has been supplied. Any unauthorized use,
24 * duplication, transmission, distribution, or disclosure of this
25 * software is expressly forbidden.
26 *
27 * This Copyright notice may not be removed or modified without prior
28 * written consent of Real Time Logic LLC.
29 *
30 * Real Time Logic LLC. reserves the right to modify this software
31 * without notice.
32 *
33 * http://www.realtimelogic.com
34 ****************************************************************************
35 *
36 *
37 */
38
39#ifndef __VirDir_h
40#define __VirDir_h
41
42#include <BaServerLib.h>
43
44struct VirFileNode;
45
46typedef struct VirDirNode
47{
48 struct VirDirNode* next;
49 struct VirDirNode* subDir;
50 struct VirFileNode* firstFile;
51 char name[1];
52} VirDirNode;
53
54
55typedef struct VirFileNode
56{
57 struct VirFileNode* next;
58 const char* name;
59} VirFileNode;
60
61
62typedef enum { VirDir_NotFound=0, VirDir_IsDir, VirDir_IsFile } VirDir_Type;
63typedef void (*VirFileNode_Free)(VirFileNode* o, AllocatorIntf* alloc);
64void VirFileNode_constructor(VirFileNode* o, const char* name);
65void VirDirNode_constructor(VirDirNode* o, const char* name, size_t len);
66VirDir_Type VirDirNode_find(VirDirNode* o, const char* relPath, void** retVal);
67VirDirNode* VirDirNode_findSubDir(VirDirNode* o, const char* name, size_t len);
68VirFileNode* VirDirNode_findFile(VirDirNode* o, const char* name);
69VirDirNode* VirDirNode_makeDir(VirDirNode* o, const char* pathName,
70 AllocatorIntf* alloc);
71int VirDirNode_mkDirInsertFile(VirDirNode* o, const char* pathName,
72 VirFileNode* vfn, AllocatorIntf* alloc);
73
74void VirDirNode_free(
75 VirDirNode* o,AllocatorIntf* alloc,VirFileNode_Free freeNode);
76
77#endif
Memory allocation and deallocation Interface class.
Definition: AllocatorIntf.h:98