Lines Matching refs:file_buf
110 if (dict->file_buf == 0) in dict_file_to_buf()
111 dict->file_buf = vstring_alloc(100); in dict_file_to_buf()
121 vstring_sprintf(dict->file_buf, "empty pathname list: >>%s<<'", in dict_file_to_buf()
125 VSTRING_RESET(dict->file_buf); in dict_file_to_buf()
129 vstring_sprintf(dict->file_buf, "open %s: %m", *cpp); in dict_file_to_buf()
132 if (st.st_size > SSIZE_T_MAX - LEN(dict->file_buf)) { in dict_file_to_buf()
133 vstring_sprintf(dict->file_buf, "file too large: %s", pathnames); in dict_file_to_buf()
136 if (vstream_fread_app(fp, dict->file_buf, st.st_size) != st.st_size) { in dict_file_to_buf()
137 vstring_sprintf(dict->file_buf, "read %s: %m", *cpp); in dict_file_to_buf()
143 VSTRING_ADDCH(dict->file_buf, '\n'); in dict_file_to_buf()
145 VSTRING_TERMINATE(dict->file_buf); in dict_file_to_buf()
146 DICT_FILE_RETURN(dict->file_buf); in dict_file_to_buf()
159 helper = (LEN(dict->file_buf) + 2) / 3; in dict_file_to_b64()
161 vstring_sprintf(dict->file_buf, "file too large: %s", pathnames); in dict_file_to_b64()
166 return (base64_encode(dict->file_b64, STR(dict->file_buf), in dict_file_to_b64()
167 LEN(dict->file_buf))); in dict_file_to_b64()
177 if (dict->file_buf == 0) in dict_file_from_b64()
178 dict->file_buf = vstring_alloc(100); in dict_file_from_b64()
180 VSTRING_RESET(dict->file_buf); in dict_file_from_b64()
181 VSTRING_SPACE(dict->file_buf, helper * 3); in dict_file_from_b64()
182 result = base64_decode(dict->file_buf, value, strlen(value)); in dict_file_from_b64()
184 vstring_sprintf(dict->file_buf, "malformed BASE64 value: %.30s", value); in dict_file_from_b64()
192 if (dict->file_buf == 0) in dict_file_get_error()
194 return (mystrdup(STR(dict->file_buf))); in dict_file_get_error()
201 if (dict->file_buf) { in dict_file_purge_buffers()
202 vstring_free(dict->file_buf); in dict_file_purge_buffers()
203 dict->file_buf = 0; in dict_file_purge_buffers()