Lines Matching defs:buf
223 int alloc_file(struct lws_context *context, const char *filename, uint8_t **buf,
235 *buf = lws_malloc(s + 1, "alloc_file");
236 if (!*buf) {
240 if (nvs_get_blob(nvh, filename, (char *)*buf, &s) != ESP_OK) {
241 lws_free(*buf);
247 (*buf)[s] = '\0';
257 int alloc_file(struct lws_context *context, const char *filename, uint8_t **buf,
288 *buf = lws_malloc(s + 1, "alloc_file");
289 if (!*buf) {
294 if (fread(*buf, s, 1, f) != 1) {
295 lws_free(*buf);
318 * Contents may be PEM or DER: returns with buf pointing to DER and amount
325 uint8_t **buf, lws_filepos_t *amount)
354 *buf = pem;
413 *buf = (uint8_t *)pem;
434 char buf[1];
441 n = read(fd, buf, 1);
485 char buf[256];
487 lws_snprintf(buf, sizeof(buf) - 1, "%s.upd", name);
488 if (!lws_tls_extant(buf)) {
493 lws_snprintf(buf, sizeof(buf) - 1,
495 if (!rename(name, buf))
503 lws_snprintf(buf, sizeof(buf) - 1, "%s.upd", name);
506 if (rename(buf, name)) {
507 lwsl_notice("unable to rename %s to %s\n", buf, name);