src/server/public/nsapi.h

changeset 59
ab25c0a231d0
parent 58
66c22e54aa90
child 61
c858850f3d3a
--- a/src/server/public/nsapi.h	Tue Mar 19 17:38:32 2013 +0100
+++ b/src/server/public/nsapi.h	Mon May 06 13:44:27 2013 +0200
@@ -1001,6 +1001,8 @@
     uint32_t aclreqaccess; /* new - required access rights */
     
     VFS *vfs; /* new - virtual file system */
+    
+    void *davCollection;
 
     int request_is_cacheable;   /* */
     int directive_is_cacheable; /* set by SAFs with no external side effects that make decisions based solely on URI and path */
@@ -1083,6 +1085,11 @@
 #define ISMOPTIONS(r)   ((r)->method_num == METHOD_OPTIONS)
 
 
+// new type
+typedef struct _thread_pool       threadpool_t;
+typedef struct  _threadpool_job   threadpool_job;
+typedef void*(*job_callback_f)(void *data);
+
 /* --- End type definitions --- */
 
 /* --- Begin dispatch vector table definition --- */
@@ -1259,6 +1266,42 @@
 #define pblock_fr INTpblock_fr
 #define pblock_replace INTpblock_replace
 
+
+// pool
+NSAPI_PUBLIC pool_handle_t *INTpool_create(void);
+
+NSAPI_PUBLIC void *INTpool_mark(pool_handle_t *pool_handle);
+
+NSAPI_PUBLIC void INTpool_recycle(pool_handle_t *pool_handle, void *mark);
+
+NSAPI_PUBLIC void INTpool_destroy(pool_handle_t *pool_handle);
+
+NSAPI_PUBLIC int INTpool_enabled(void);
+
+NSAPI_PUBLIC void *INTpool_malloc(pool_handle_t *pool_handle, size_t size );
+
+NSAPI_PUBLIC void INTpool_free(pool_handle_t *pool_handle, void *ptr );
+
+NSAPI_PUBLIC 
+void *INTpool_calloc(pool_handle_t *pool_handle, size_t nelem, size_t elsize);
+
+NSAPI_PUBLIC 
+void *INTpool_realloc(pool_handle_t *pool_handle, void *ptr, size_t size );
+
+NSAPI_PUBLIC
+char *INTpool_strdup(pool_handle_t *pool_handle, const char *orig_str );
+
+#define pool_create INTpool_create
+#define pool_mark INTpool_mark
+#define pool_recycle INTpool_recycle
+#define pool_destroy INTpool_destroy
+#define pool_enabled INTpool_enabled
+#define pool_malloc INTpool_malloc
+#define pool_free INTpool_free
+#define pool_calloc INTpool_calloc
+#define pool_realloc INTpool_realloc
+#define pool_strdup INTpool_strdup
+
 // func util functions
 FuncStruct* func_resolve(pblock *pb, Session *sn, Request *rq);
 int func_exec (pblock *pb, Session *sn, Request *rq);
@@ -1324,6 +1367,12 @@
 #define util_errno2status util_errno2status
 
 
+// threadpool
+threadpool_t* threadpool_new(int n);
+void* threadpool_func(void *data);
+threadpool_job* threadpool_get_job(threadpool_t *pool);
+void threadpool_run(threadpool_t *pool, job_callback_f func, void *data);
+
 /* end new macro and function definitions */
 
 #define SYS_STDERR STDERR_FILENO

mercurial