added qse_ubi_t

separated task functions from httpd.c to httpd_task.c
This commit is contained in:
2011-07-21 10:17:16 +00:00
parent 618f8bcf1f
commit b08ebd719c
19 changed files with 627 additions and 467 deletions

View File

@ -1,5 +1,5 @@
/*
* $Id: awk.h 485 2011-05-29 15:15:52Z hyunghwan.chung $
* $Id: awk.h 510 2011-07-20 16:17:16Z hyunghwan.chung $
*
Copyright 2006-2011 Chung, Hyung-Hwan.
This file is part of QSE.
@ -1442,28 +1442,28 @@ int qse_awk_parse (
);
/**
* The qse_awk_alloc() function allocates dynamic memory.
* The qse_awk_allocmem() function allocates dynamic memory.
* @return a pointer to a memory block on success, #QSE_NULL on failure
*/
void* qse_awk_alloc (
void* qse_awk_allocmem (
qse_awk_t* awk, /**< awk */
qse_size_t size /**< size of memory to allocate in bytes */
);
/**
* The qse_awk_realloc() function resizes a dynamic memory block.
* The qse_awk_reallocmem() function resizes a dynamic memory block.
* @return a pointer to a memory block on success, #QSE_NULL on failure
*/
void* qse_awk_realloc (
void* qse_awk_reallocmem (
qse_awk_t* awk, /**< awk */
void* ptr, /**< memory block */
qse_size_t size /**< new block size in bytes */
);
/**
* The qse_awk_free() function frees dynamic memory allocated.
* The qse_awk_freemem() function frees dynamic memory allocated.
*/
void qse_awk_free (
void qse_awk_freemem (
qse_awk_t* awk, /**< awk */
void* ptr /**< memory block to free */
);
@ -2237,32 +2237,32 @@ int qse_awk_rtx_strtonum (
);
/**
* The qse_awk_rtx_alloc() function allocats a memory block of @a size bytes
* The qse_awk_rtx_allocmem() function allocats a memory block of @a size bytes
* using the memory manager associated with a runtime context @a rtx.
* @return the pointer to a memory block on success, #QSE_NULL on failure.
*/
void* qse_awk_rtx_alloc (
void* qse_awk_rtx_allocmem (
qse_awk_rtx_t* rtx, /**< runtime context */
qse_size_t size /**< block size in bytes */
);
/**
* The qse_awk_rtx_realloc() function resizes a memory block pointed to
* The qse_awk_rtx_reallocmem() function resizes a memory block pointed to
* by @a ptr to @a size bytes using the memory manager associated with
* a runtime context @a rtx.
* @return the pointer to a memory block on success, #QSE_NULL on failure.
*/
void* qse_awk_rtx_realloc (
void* qse_awk_rtx_reallocmem (
qse_awk_rtx_t* rtx, /**< runtime context */
void* ptr, /**< memory block */
qse_size_t size /**< block size in bytes */
);
/**
* The qse_awk_rtx_free() function frees a memory block pointed to by @a ptr
* The qse_awk_rtx_freemem() function frees a memory block pointed to by @a ptr
* using the memory manager of a runtime ocntext @a rtx.
*/
void qse_awk_rtx_free (
void qse_awk_rtx_freemem (
qse_awk_rtx_t* rtx, /**< runtime context */
void* ptr /**< memory block pointer */
);

View File

@ -104,7 +104,15 @@ struct qse_xma_t
#endif
};
typedef int (*qse_xma_dumper_t) (void* target, const qse_char_t* fmt,...);
/**
* The qse_xma_dumper_t type defines a printf-like output function
* for qse_xma_dump().
*/
typedef int (*qse_xma_dumper_t) (
void* ctx,
const qse_char_t* fmt,
...
);
#ifdef __cplusplus
extern "C" {
@ -187,13 +195,13 @@ void qse_xma_free (
/**
* The qse_xma_dump() function dumps the contents of the memory zone
* with the output function @a printf provided. The debug build shows
* with the output function @a dumper provided. The debug build shows
* more statistical counters.
*/
void qse_xma_dump (
qse_xma_t* xma, /**< memory allocator */
qse_xma_dumper_t dumper, /**< output function */
void* target /**< first parameter to output function */
void* ctx /**< first parameter to output function */
);
#ifdef __cplusplus

View File

@ -144,6 +144,9 @@
/* Define to 1 if you have the <sys/resource.h> header file. */
#undef HAVE_SYS_RESOURCE_H
/* Define to 1 if you have the <sys/sendfile.h> header file. */
#undef HAVE_SYS_SENDFILE_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H

View File

@ -128,11 +128,35 @@ int qse_httpd_entasksendfmt (
...
);
int qse_httpd_entasksendfile (
qse_httpd_t* httpd,
qse_httpd_client_t* client,
int fd,
qse_foff_t offset,
qse_foff_t size
);
int qse_httpd_entaskdisconnect (
qse_httpd_t* httpd,
qse_httpd_client_t* client
);
void* qse_httpd_allocmem (
qse_httpd_t* httpd,
qse_size_t size
);
void* qse_httpd_reallocmem (
qse_httpd_t* httpd,
void* ptr,
qse_size_t size
);
void qse_httpd_freemem (
qse_httpd_t* httpd,
void* ptr
);
#ifdef __cplusplus
}
#endif

View File

@ -1,5 +1,5 @@
/*
* $Id: types.h 504 2011-07-11 16:31:33Z hyunghwan.chung $
* $Id: types.h 510 2011-07-20 16:17:16Z hyunghwan.chung $
*
Copyright 2006-2011 Chung, Hyung-Hwan.
This file is part of QSE.
@ -336,7 +336,6 @@ typedef qse_int_t qse_intptr_t;
typedef double qse_real_t;
#endif
/**
* The qse_mchar_t type defines a multi-byte character type.
*/
@ -575,4 +574,66 @@ typedef struct qse_mmgr_t qse_mmgr_t;
# error Unsupported platform
#endif
/* The qse_ubi_t type defines a union type that includes most of built-in
* data types and numeric types defined in the library. */
union qse_ubi_t
{
char c;
unsigned char uc;
short s;
unsigned short us;
int i;
unsigned int ui;
long l;
unsigned long ul;
#if defined(QSE_SIZEOF_LONG_LONG) && (QSE_SIZEOF_LONG_LONG > 0)
long long ll;
unsigned long long ull;
#endif
float f;
double d;
#if defined(QSE_SIZEOF_LONG_DOUBLE) && (QSE_SIZEOF_LONG_DOUBLE > 0)
long double ld;
#endif
void* ptr;
qse_byte_t byte;
qse_int_t sint;
qse_uint_t uint;
qse_long_t slong;
qse_ulong_t ulong;
qse_size_t size;
qse_ssize_t ssize;
qse_word_t word;
qse_intptr_t intptr;
qse_uintptr_t uintptr;
qse_real_t real;
qse_char_t cha;
qse_mchar_t mchar;
qse_wchar_t wchar;
qse_cint_t cint;
qse_mcint_t mcint;
qse_wcint_t wcint;
qse_int8_t int8;
qse_uint8_t uint8;
qse_int16_t int16;
qse_uint16_t uint16;
qse_int32_t int32;
qse_uint32_t uint32;
#if defined(QSE_HAVE_INT64_T)
qse_int64_t int64;
qse_uint64_t uint64;
#endif
#if defined(QSE_HAVE_INT128_T)
qse_int128_t int128;
qse_uint128_t uint128;
#endif
qse_foff_t foff;
};
typedef union qse_ubi_t qse_ubi_t;
#endif