updated documentation

This commit is contained in:
hyung-hwan 2014-10-21 17:58:18 +00:00
parent d363cd2e62
commit 003c637c0f
3 changed files with 606 additions and 326 deletions

File diff suppressed because it is too large Load Diff

View File

@ -765,29 +765,40 @@ typedef int (*qse_awk_fnc_impl_t) (
const qse_awk_fnc_info_t* fi /**< function information */
);
/**
* The qse_awk_fnc_arg_t type defines a structure to describe arguments
* to an implicit function.
*/
struct qse_awk_fnc_arg_t
{
/** numbers of argument for a function */
qse_size_t min;
/** numbers of argument for a function */
qse_size_t max;
/**
* if min is greater than max, spec points to an external module
* name where the function is found. otherwise, spec can be #QSE_NULL
* to indicate all arguments are passed by value or point to a
* argument specification string composed of 'max' characters.
* Each character can be one of:
* - v: value
* - r: reference
* - x: regular expression
*/
const qse_char_t* spec;
};
typedef struct qse_awk_fnc_arg_t qse_awk_fnc_arg_t;
/**
* The qse_awk_fnc_spec_t type defines a structure to hold the specification
* of an intrinsic function or a module function.
*/
struct qse_awk_fnc_spec_t
{
/** parameter specification */
struct
{
qse_size_t min; /**< min. numbers of argument for a function */
qse_size_t max; /**< max. numbers of argument for a function */
const qse_char_t* spec;
/**< argument specifier
* if min is greater than max, spec points to an external module
* name where the function is found. otherwise, spec can be QSE_NULL
* to indicate all arguments are passed by value or point to a
* argument specification string composed of 'max' characters.
* Each character can be one of:
* - v: value
* - r: reference
* - x:regular expression
*/
} arg;
/** argument descriptor */
qse_awk_fnc_arg_t arg;
/** pointer to the function implementing this function */
qse_awk_fnc_impl_t impl;
@ -1081,7 +1092,7 @@ enum qse_awk_trait_t
/** treats a map value more flexibly. a function can return
* a map. you can override a map with a scalar value without
* 'delete' or '@reset'.
* 'delete' or '\@reset'.
*/
QSE_AWK_FLEXMAP = (1 << 11),

View File

@ -385,7 +385,7 @@ qse_task_slice_t* qse_task_create (
* this approach makes this function thread-unsafe.
*/
/* when qse_task_task_create() is called,
/* when qse_task_create() is called,
* setjmp() saves the context and return 0.
*
* subsequently, when longjmp() is made
@ -395,37 +395,37 @@ qse_task_slice_t* qse_task_create (
if (setjmp (((qse_task_slice_t*)tmp)->jmpbuf) != 0)
{
/* longjmp() is made to here. */
#if defined(__WATCOMC__)
#if defined(__WATCOMC__)
tmp = get_slice ();
#elif defined(__GNUC__) && (defined(__x86_64) || defined(__amd64))
#elif defined(__GNUC__) && (defined(__x86_64) || defined(__amd64))
__asm__ volatile (
"movq 0(%%rsp), %0\n" /* tmp = t2 */
: "=r"(tmp)
);
#elif defined(__GNUC__) && (defined(__i386) || defined(i386))
#elif defined(__GNUC__) && (defined(__i386) || defined(i386))
__asm__ volatile (
"movl 0(%%esp), %0\n" /* tmp = t2 */
: "=r"(tmp)
);
#elif defined(__GNUC__) && (defined(__mips) || defined(mips))
#elif defined(__GNUC__) && (defined(__mips) || defined(mips))
__asm__ volatile (
"lw %0, 0($sp)\n" /* tmp = t2 */
: "=r"(tmp)
);
#elif defined(__GNUC__) && defined(__arm__)
#elif defined(__GNUC__) && defined(__arm__)
__asm__ volatile (
"ldr %0, [sp, #0]\n" /* tmp = t2 */
: "=r"(tmp)
);
#endif /* __WATCOMC__ */
#endif /* __WATCOMC__ */
execute_current_slice ((qse_task_slice_t*)tmp);
QSE_ASSERT (!"must never reach here....\n");
}
/* restore the stack pointer once i finish saving the longjmp() context.
* this part is reached only when qse_task_task_create() is invoked. */
* this part is reached only when qse_task_create() is invoked. */
#if defined(__WATCOMC__)
restore_sp ();
@ -518,7 +518,7 @@ done:
}
/* NOTE for __WATCOMC__.
when the number of parameters are more than 2 for qse_task_schedule(),
when the number of parameters is more than 2 for qse_task_schedule(),
this setjmp()/longjmp() based tasking didn't work.
if i change this to