This commit is contained in:
hyung-hwan 2008-03-19 02:26:52 +00:00
parent 79eb5b66fd
commit f9c7b599d4
2 changed files with 7 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/* /*
* $Id: stdio.c 147 2008-03-18 08:10:23Z baconevi $ * $Id: stdio.c 148 2008-03-18 08:26:52Z baconevi $
* *
* {License} * {License}
*/ */
@ -388,8 +388,7 @@ ase_ssize_t ase_getline (ase_char_t **buf, ase_size_t *n, ASE_FILE *fp)
ase_ssize_t ase_getdelim ( ase_ssize_t ase_getdelim (
ase_char_t **buf, ase_size_t *n, ase_char_t **buf, ase_size_t *n,
int (*break_line)(const ase_char_t*,ase_size_t,void*), ase_getdelim_t fn, void* fnarg, ASE_FILE *fp)
void* delim, ASE_FILE *fp)
{ {
ase_char_t* b; ase_char_t* b;
ase_size_t capa; ase_size_t capa;
@ -456,7 +455,7 @@ ase_ssize_t ase_getdelim (
b[len++] = c; b[len++] = c;
x = break_line (b, len, delim); x = fn (b, len, fnarg);
if (x < 0) if (x < 0)
{ {
len = (ase_size_t)-3; len = (ase_size_t)-3;

View File

@ -1,5 +1,5 @@
/* /*
* $Id: stdio.h 147 2008-03-18 08:10:23Z baconevi $ * $Id: stdio.h 148 2008-03-18 08:26:52Z baconevi $
* *
* {License} * {License}
*/ */
@ -49,6 +49,8 @@
#define ASE_STDOUT stdout #define ASE_STDOUT stdout
#define ASE_STDERR stderr #define ASE_STDERR stderr
typedef int (*ase_getdelim_t) (const ase_char_t* ptr,ase_size_t len, void* arg);
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -77,9 +79,7 @@ ase_ssize_t ase_getline (ase_char_t **buf, ase_size_t *n, ASE_FILE *fp);
*/ */
ase_ssize_t ase_getdelim ( ase_ssize_t ase_getdelim (
ase_char_t **buf, ase_size_t *n, ase_char_t **buf, ase_size_t *n,
int (*break_line)(const ase_char_t*,ase_size_t,void*), ase_getdelim_t fn, void* fnarg, ASE_FILE *fp);
void* delim, ASE_FILE *fp);
#ifdef __cplusplus #ifdef __cplusplus
} }