|
|
|
@ -1,5 +1,5 @@ |
|
|
|
/*
|
|
|
|
* Copyright (c) 1990 The Regents of the University of California. |
|
|
|
* Copyright (c) 1990, 2007 The Regents of the University of California. |
|
|
|
* All rights reserved. |
|
|
|
* |
|
|
|
* Redistribution and use in source and binary forms are permitted |
|
|
|
@ -41,7 +41,7 @@ extern int _EXFUN(__sclose,(_PTR)); |
|
|
|
extern int _EXFUN(__stextmode,(int)); |
|
|
|
extern _VOID _EXFUN(__sinit,(struct _reent *)); |
|
|
|
extern _VOID _EXFUN(_cleanup_r,(struct _reent *)); |
|
|
|
extern _VOID _EXFUN(__smakebuf,(FILE *)); |
|
|
|
extern _VOID _EXFUN(__smakebuf_r,(struct _reent *, FILE *)); |
|
|
|
extern int _EXFUN(_fwalk,(struct _reent *, int (*)(FILE *))); |
|
|
|
extern int _EXFUN(_fwalk_reent,(struct _reent *, int (*)(struct _reent *, FILE *))); |
|
|
|
struct _glue * _EXFUN(__sfmoreglue,(struct _reent *,int n)); |
|
|
|
@ -82,24 +82,25 @@ struct _glue * _EXFUN(__sfmoreglue,(struct _reent *,int n)); |
|
|
|
|
|
|
|
/* Return true iff the given FILE cannot be written now. */ |
|
|
|
|
|
|
|
#define cantwrite(fp) \ |
|
|
|
#define cantwrite(ptr, fp) \ |
|
|
|
((((fp)->_flags & __SWR) == 0 || (fp)->_bf._base == NULL) && \ |
|
|
|
__swsetup(fp)) |
|
|
|
__swsetup_r(ptr, fp)) |
|
|
|
|
|
|
|
/* Test whether the given stdio file has an active ungetc buffer;
|
|
|
|
release such a buffer, without restoring ordinary unread data. */ |
|
|
|
|
|
|
|
#define HASUB(fp) ((fp)->_ub._base != NULL) |
|
|
|
#define FREEUB(fp) { \ |
|
|
|
#define FREEUB(ptr, fp) { \ |
|
|
|
if ((fp)->_ub._base != (fp)->_ubuf) \ |
|
|
|
_free_r(_REENT, (char *)(fp)->_ub._base); \ |
|
|
|
_free_r(ptr, (char *)(fp)->_ub._base); \ |
|
|
|
(fp)->_ub._base = NULL; \ |
|
|
|
} |
|
|
|
|
|
|
|
/* Test for an fgetline() buffer. */ |
|
|
|
|
|
|
|
#define HASLB(fp) ((fp)->_lb._base != NULL) |
|
|
|
#define FREELB(fp) { _free_r(_REENT,(char *)(fp)->_lb._base); (fp)->_lb._base = NULL; } |
|
|
|
#define FREELB(ptr, fp) { _free_r(ptr,(char *)(fp)->_lb._base); \ |
|
|
|
(fp)->_lb._base = NULL; } |
|
|
|
|
|
|
|
/* WARNING: _dcvt is defined in the stdlib directory, not here! */ |
|
|
|
|
|
|
|
|