Lines Matching refs:ea

63   struct ext_array *ea = xmalloc (sizeof *ea);
64 ea->file = create_temp_file ();
65 if (ea->file == NULL)
67 ea->position = 0;
68 ea->op = OP_WRITE;
69 return ea;
75 ext_array_destroy (struct ext_array *ea)
78 if (ea != NULL)
80 ok = !ext_array_error (ea);
81 if (ea->file != NULL)
82 close_temp_file (ea->file);
83 free (ea);
95 struct ext_array *ea = CONST_CAST (struct ext_array *, ea_); in operator ()()
96 if (!ext_array_error (ea)) in operator ()()
98 if (ea->position == offset && ea->op == op) in operator ()()
100 else if (fseeko (ea->file, offset, SEEK_SET) == 0) in operator ()()
102 ea->position = offset; in operator ()()
119 struct ext_array *ea = CONST_CAST (struct ext_array *, ea_); in operator ()()
121 assert (!ext_array_error (ea)); in operator ()()
122 if (bytes > 0 && fread (buffer, bytes, 1, ea->file) != 1) in operator ()()
124 if (ferror (ea->file)) in operator ()()
126 else if (feof (ea->file)) in operator ()()
132 ea->position += bytes; in operator ()()
133 ea->op = OP_READ; in operator ()()
142 do_write (struct ext_array *ea, const void *buffer, size_t bytes) in operator ()()
144 assert (!ext_array_error (ea)); in operator ()()
145 if (bytes > 0 && fwrite (buffer, bytes, 1, ea->file) != 1) in operator ()()
150 ea->position += bytes; in operator ()()
151 ea->op = OP_WRITE; in operator ()()
158 ext_array_read (const struct ext_array *ea, off_t offset, size_t n, void *data)
160 return do_seek (ea, offset, OP_READ) && do_read (ea, data, n);
167 ext_array_write (struct ext_array *ea, off_t offset, size_t n, in operator ()()
170 return do_seek (ea, offset, OP_WRITE) && do_write (ea, data, n); in operator ()()
176 ext_array_error (const struct ext_array *ea)
178 return ea->file == NULL || ferror (ea->file) || feof (ea->file);