taskrambler  0.1.9
Web server and task management solution.
asset.h
Go to the documentation of this file.
1 /**
2  * \file
3  * Represents an asset (a file on disk)
4  *
5  * \author Georg Hopp
6  *
7  * \copyright
8  * Copyright © 2012 Georg Hopp
9  *
10  * This program is free software: you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation, either version 3 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef __ASSET_H__
25 #define __ASSET_H__
26 
27 #include <sys/types.h>
28 
29 #include "class.h"
30 #include "commons.h"
31 #include "hash.h"
32 
33 
34 CLASS(Asset) {
35  unsigned long hash;
36 
37  char fname[2049];
38  char etag[200];
39  char mtime[200];
40 
41  size_t nfname;
42  size_t netag;
43  size_t nmtime;
44 
45  char * mime_type;
46  size_t nmime_type;
47 
48  int handle;
49  char * data;
50  size_t size;
51 
52  size_t ref_count;
53 };
54 
55 Asset assetPoolGet(const char *, size_t);
56 size_t assetPoolRelease(Asset);
57 void assetPoolCleanup(void);
58 
59 #endif // __ASSET_H__
60 
61 // vim: set ts=4 sw=4:
size_t assetPoolRelease(Asset)
Definition: pool.c:66
Asset assetPoolGet(const char *, size_t)
Definition: pool.c:43
void assetPoolCleanup(void)
Definition: pool.c:88
static size_t size
CLASS(Asset)
Definition: asset.h:34