updated documentation
This commit is contained in:
		
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -766,28 +766,39 @@ typedef int (*qse_awk_fnc_impl_t) ( | |||||||
| ); | ); | ||||||
|  |  | ||||||
| /** | /** | ||||||
|  * The qse_awk_fnc_spec_t type defines a structure to hold the specification |  * The qse_awk_fnc_arg_t type defines a structure to describe arguments | ||||||
|  * of an intrinsic function or a module function. |  * to an implicit function. | ||||||
|  */ |  */ | ||||||
| struct qse_awk_fnc_spec_t | struct qse_awk_fnc_arg_t | ||||||
| { | { | ||||||
| 	/** parameter specification */ | 	/** numbers of argument for a function */ | ||||||
| 	struct | 	qse_size_t min;  | ||||||
| 	{ |  | ||||||
| 		qse_size_t min; /**< min. numbers of argument for a function */ | 	/** numbers of argument for a function */ | ||||||
| 		qse_size_t max; /**< max. numbers of argument for a function */ | 	qse_size_t max;  | ||||||
| 		const qse_char_t* spec; |  | ||||||
| 		/**< argument specifier  | 	/**  | ||||||
| 	 * if min is greater than max, spec points to an external module | 	 * if min is greater than max, spec points to an external module | ||||||
| 		 * name where the function is found. otherwise, spec can be QSE_NULL | 	 * name where the function is found. otherwise, spec can be #QSE_NULL | ||||||
| 	 * to indicate all arguments are passed by value or point to a | 	 * to indicate all arguments are passed by value or point to a | ||||||
| 	 * argument specification string composed of 'max' characters. | 	 * argument specification string composed of 'max' characters. | ||||||
| 	 * Each character can be one of: | 	 * Each character can be one of: | ||||||
| 	 *  - v: value | 	 *  - v: value | ||||||
| 	 *  - r: reference | 	 *  - r: reference | ||||||
| 		 *  - x:regular expression | 	 *  - x: regular expression | ||||||
| 	 */ | 	 */ | ||||||
| 	} arg; | 	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 | ||||||
|  | { | ||||||
|  | 	/** argument descriptor */ | ||||||
|  | 	qse_awk_fnc_arg_t arg; | ||||||
|  |  | ||||||
| 	/** pointer to the function implementing this function */ | 	/** pointer to the function implementing this function */ | ||||||
| 	qse_awk_fnc_impl_t impl; | 	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 | 	/** treats a map value more flexibly. a function can return | ||||||
| 	 *  a map. you can override a map with a scalar value without  | 	 *  a map. you can override a map with a scalar value without  | ||||||
| 	 *  'delete' or '@reset'.  | 	 *  'delete' or '\@reset'.  | ||||||
| 	 */ | 	 */ | ||||||
| 	QSE_AWK_FLEXMAP = (1 << 11), | 	QSE_AWK_FLEXMAP = (1 << 11), | ||||||
|  |  | ||||||
|  | |||||||
| @ -385,7 +385,7 @@ qse_task_slice_t* qse_task_create ( | |||||||
| 	 * this approach makes this function thread-unsafe. | 	 * 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. | 	 * setjmp() saves the context and return 0. | ||||||
| 	 * | 	 * | ||||||
| 	 * subsequently, when longjmp() is made | 	 * 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) | 	if (setjmp (((qse_task_slice_t*)tmp)->jmpbuf) != 0) | ||||||
| 	{ | 	{ | ||||||
| 		/* longjmp() is made to here. */ | 		/* longjmp() is made to here. */ | ||||||
| #if defined(__WATCOMC__) | 	#if defined(__WATCOMC__) | ||||||
| 		tmp = get_slice (); | 		tmp = get_slice (); | ||||||
|  |  | ||||||
| #elif defined(__GNUC__) && (defined(__x86_64) || defined(__amd64)) | 	#elif defined(__GNUC__) && (defined(__x86_64) || defined(__amd64)) | ||||||
| 		__asm__ volatile ( | 		__asm__ volatile ( | ||||||
| 			"movq 0(%%rsp), %0\n"  /* tmp = t2 */ | 			"movq 0(%%rsp), %0\n"  /* tmp = t2 */ | ||||||
| 			: "=r"(tmp) | 			: "=r"(tmp) | ||||||
| 		); | 		); | ||||||
| #elif defined(__GNUC__) && (defined(__i386) || defined(i386)) | 	#elif defined(__GNUC__) && (defined(__i386) || defined(i386)) | ||||||
| 		__asm__ volatile ( | 		__asm__ volatile ( | ||||||
| 			"movl 0(%%esp), %0\n"  /* tmp = t2 */ | 			"movl 0(%%esp), %0\n"  /* tmp = t2 */ | ||||||
| 			: "=r"(tmp) | 			: "=r"(tmp) | ||||||
| 		); | 		); | ||||||
| #elif defined(__GNUC__) && (defined(__mips) || defined(mips)) | 	#elif defined(__GNUC__) && (defined(__mips) || defined(mips)) | ||||||
| 		__asm__ volatile ( | 		__asm__ volatile ( | ||||||
| 			"lw %0, 0($sp)\n"    /* tmp = t2 */ | 			"lw %0, 0($sp)\n"    /* tmp = t2 */ | ||||||
| 			: "=r"(tmp) | 			: "=r"(tmp) | ||||||
| 		); | 		); | ||||||
| #elif defined(__GNUC__) && defined(__arm__) | 	#elif defined(__GNUC__) && defined(__arm__) | ||||||
| 		__asm__ volatile ( | 		__asm__ volatile ( | ||||||
| 			"ldr %0, [sp, #0]\n"    /* tmp = t2 */ | 			"ldr %0, [sp, #0]\n"    /* tmp = t2 */ | ||||||
| 			: "=r"(tmp) | 			: "=r"(tmp) | ||||||
| 		); | 		); | ||||||
| #endif /* __WATCOMC__ */ | 	#endif /* __WATCOMC__ */ | ||||||
|  |  | ||||||
| 		execute_current_slice ((qse_task_slice_t*)tmp); | 		execute_current_slice ((qse_task_slice_t*)tmp); | ||||||
| 		QSE_ASSERT (!"must never reach here....\n"); | 		QSE_ASSERT (!"must never reach here....\n"); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	/* restore the stack pointer once i finish saving the longjmp() context. | 	/* 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__) | #if defined(__WATCOMC__) | ||||||
|  |  | ||||||
| 	restore_sp (); | 	restore_sp (); | ||||||
| @ -518,7 +518,7 @@ done: | |||||||
| } | } | ||||||
|  |  | ||||||
| /* NOTE for __WATCOMC__. | /* 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. |    this setjmp()/longjmp() based tasking didn't work. | ||||||
|  |  | ||||||
|    if i change this to |    if i change this to | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user