thr_data
struct thr_data *thr_data = get_thr_data();
return (defopen_common(fn, thr_data));
struct thr_data *thr_data = lmalloc(sizeof (struct thr_data));
if (defopen_common(fn, thr_data) < 0) {
if (thr_data != NULL)
lfree(thr_data, sizeof (struct thr_data));
return ((void *)thr_data);
defopen_common(const char *fn, struct thr_data *thr_data)
if (thr_data == NULL)
if (thr_data->fp != NULL) {
(void) fclose(thr_data->fp);
thr_data->fp = NULL;
if ((thr_data->fp = fopen(fn, "rF")) == NULL)
if (thr_data->buf == NULL &&
(thr_data->buf = lmalloc(BUFFERSIZE)) == NULL) {
(void) fclose(thr_data->fp);
thr_data->fp = NULL;
thr_data->Dcflags = DC_STD;
struct thr_data *thr_data = get_thr_data();
return (defread_r(cp, thr_data));
struct thr_data *thr_data = (struct thr_data *)ptr;
if (thr_data == NULL || thr_data->fp == NULL)
compare = TSTBITS(thr_data->Dcflags, DC_CASE) ? strncmp : strncasecmp;
if (!TSTBITS(thr_data->Dcflags, DC_NOREWIND))
rewind(thr_data->fp);
while (fgets(thr_data->buf, BUFFERSIZE, thr_data->fp)) {
for (buf_tmp = thr_data->buf; *buf_tmp == ' '; buf_tmp++)
if (TSTBITS(thr_data->Dcflags, DC_STRIP_QUOTES)) {
struct thr_data *thr_data = get_thr_data();
return (defcntl_r(cmd, newflags, thr_data));
struct thr_data *thr_data = (struct thr_data *)ptr;
if (thr_data == NULL)
oldflags = thr_data->Dcflags;
oldflags = thr_data->Dcflags;
thr_data->Dcflags = newflags;
struct thr_data *thr_data = (struct thr_data *)ptr;
(void) fclose(thr_data->fp);
lfree(thr_data->buf, BUFFERSIZE);
lfree(thr_data, sizeof (struct thr_data));
static int defopen_common(const char *, struct thr_data *);
struct thr_data *thr_data = (struct thr_data *)arg;
if (thr_data->fp) {
(void) fclose(thr_data->fp);
thr_data->fp = NULL;
if (thr_data->buf) {
lfree(thr_data->buf, BUFFERSIZE);
thr_data->buf = NULL;
static struct thr_data *
struct thr_data *thr_data =
tsdalloc(_T_DEFREAD, sizeof (*thr_data), free_thr_data);
return (thr_data);