/civetweb-2.7.6/unittest/ |
D | public_func.c | 49 char *buf; in START_TEST() local 110 buf = (char *)malloc((unsigned)len + 1); in START_TEST() 111 ck_assert(buf != NULL); in START_TEST() 112 ret = mg_get_system_info(buf, len + 1); in START_TEST() 114 ret = (int)strlen(buf); in START_TEST() 116 free(buf); in START_TEST() 122 buf = (char *)malloc((unsigned)len + 100); in START_TEST() 123 ck_assert(buf != NULL); in START_TEST() 124 ret = mg_get_context_info(ctx, buf, len + 100); in START_TEST() 126 len = (int)strlen(buf); in START_TEST() [all …]
|
D | private.c | 53 test_parse_http_response(char *buf, int len, struct mg_response_info *ri) in test_parse_http_response() argument 56 memcpy(tmp_parse_buffer, buf, (size_t)len); in test_parse_http_response() 61 test_parse_http_request(char *buf, int len, struct mg_request_info *ri) in test_parse_http_request() argument 64 memcpy(tmp_parse_buffer, buf, (size_t)len); in test_parse_http_request() 425 alloc_printf(char **buf, size_t size, const char *fmt, ...) in alloc_printf() argument 436 ret = alloc_vprintf(buf, *buf, size, fmt, ap); in alloc_printf() 444 alloc_printf2(char **buf, const char *fmt, ...) in alloc_printf2() argument 453 ret = alloc_vprintf2(buf, fmt, ap); in alloc_printf2() 465 char buf[MG_BUF_LEN], *p = buf; in START_TEST() local 468 ck_assert(alloc_printf(&p, sizeof(buf), "%s", "hi") == 2); in START_TEST() [all …]
|
D | public_server.c | 152 char buf[500]; in START_TEST() local 159 memset(buf, 0, sizeof(buf)); in START_TEST() 172 strcpy(buf, wd); in START_TEST() 173 strcat(buf, "\\"); in START_TEST() 174 strcat(buf, ssl_cert); in START_TEST() 175 f = fopen(buf, "rb"); in START_TEST() 177 strcpy(buf, wd); in START_TEST() 178 strcat(buf, "/"); in START_TEST() 179 strcat(buf, ssl_cert); in START_TEST() 180 f = fopen(buf, "r"); in START_TEST() [all …]
|
/civetweb-2.7.6/src/third_party/duktape-1.8.0/debugger/ |
D | duk_debug_proxy.js | 74 function readCb(buf, err) { argument 78 log.debug('Read callback:', buf.length, err); 83 if (buf.length == 0) { 91 while (data.length - dataOff < buf.length) { 97 data.set(new Uint8Array(buf), dataOff); 98 dataOff += buf.length; 99 fileOff += buf.length; 324 var buf = this.incoming; 330 if (buf[i] == 0x0a) { 331 str = String(plainBufferCopy(buf.subarray(0, i))); [all …]
|
D | duk_debug.js | 140 function bufferToDebugString(buf) { argument 155 for (i = 0, n = buf.length; i < n; i++) { 156 cp[i] = String.fromCharCode(buf[i]); 165 function writeDebugStringToBuffer(str, buf, off) { argument 169 buf[off + i] = str.charCodeAt(i) & 0xff; // truncate higher bits 539 var buf = new Buffer(0); // accumulate data 552 var tmp = new Buffer(buf.length - n); 553 buf.copy(tmp, 0, n); 554 buf = tmp; 574 buf = Buffer.concat([ buf, data ]); [all …]
|
/civetweb-2.7.6/src/third_party/duktape-1.5.2/debugger/ |
D | duk_debug_proxy.js | 74 function readCb(buf, err) { argument 78 log.debug('Read callback:', buf.length, err); 83 if (buf.length == 0) { 91 while (data.length - dataOff < buf.length) { 97 data.set(new Uint8Array(buf), dataOff); 98 dataOff += buf.length; 99 fileOff += buf.length; 324 var buf = this.incoming; 330 if (buf[i] == 0x0a) { 331 str = String(plainBufferCopy(buf.subarray(0, i))); [all …]
|
D | duk_debug.js | 140 function bufferToDebugString(buf) { argument 155 for (i = 0, n = buf.length; i < n; i++) { 156 cp[i] = String.fromCharCode(buf[i]); 165 function writeDebugStringToBuffer(str, buf, off) { argument 169 buf[off + i] = str.charCodeAt(i) & 0xff; // truncate higher bits 539 var buf = new Buffer(0); // accumulate data 552 var tmp = new Buffer(buf.length - n); 553 buf.copy(tmp, 0, n); 554 buf = tmp; 574 buf = Buffer.concat([ buf, data ]); [all …]
|
/civetweb-2.7.6/src/third_party/duktape-1.8.0/src-separate/ |
D | duk_debug_heap.c | 10 DUK_LOCAL void duk__sanitize_snippet(char *buf, duk_size_t buf_size, duk_hstring *str) { 16 DUK_MEMZERO(buf, buf_size); 26 buf[i] = (char) c; 101 char buf[64+1]; 117 duk__sanitize_snippet(buf, sizeof(buf), e); 126 (const char *) buf, 141 (const char *) buf, 159 char buf[64+1]; 169 duk__sanitize_snippet(buf, sizeof(buf), c->h); 171 (long) i, (long) c->bidx, (long) c->cidx, (const char *) buf)); [all …]
|
D | duk_hbuffer_ops.c | 18 DUK_INTERNAL void duk_hbuffer_resize(duk_hthread *thr, duk_hbuffer_dynamic *buf, duk_size_t new_siz… in duk_hbuffer_resize() argument 23 DUK_ASSERT(buf != NULL); in duk_hbuffer_resize() 24 DUK_ASSERT(DUK_HBUFFER_HAS_DYNAMIC(buf)); in duk_hbuffer_resize() 25 DUK_ASSERT(!DUK_HBUFFER_HAS_EXTERNAL(buf)); in duk_hbuffer_resize() 41 res = DUK_REALLOC_INDIRECT(thr->heap, duk_hbuffer_get_dynalloc_ptr, (void *) buf, new_size); in duk_hbuffer_resize() 46 (void *) DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(thr->heap, buf), in duk_hbuffer_resize() 47 (long) DUK_HBUFFER_DYNAMIC_GET_SIZE(buf), in duk_hbuffer_resize() 57 prev_size = DUK_HBUFFER_DYNAMIC_GET_SIZE(buf); in duk_hbuffer_resize() 66 DUK_HBUFFER_DYNAMIC_SET_SIZE(buf, new_size); in duk_hbuffer_resize() 67 DUK_HBUFFER_DYNAMIC_SET_DATA_PTR(thr->heap, buf, res); in duk_hbuffer_resize() [all …]
|
D | duk_bi_date_unix.c | 198 char buf[DUK__STRPTIME_BUF_SIZE]; in duk_bi_date_parse_string_strptime() local 202 DUK_MEMZERO(buf, sizeof(buf)); /* valgrind whine without this */ in duk_bi_date_parse_string_strptime() 203 DUK_SNPRINTF(buf, sizeof(buf), "%s", (const char *) str); in duk_bi_date_parse_string_strptime() 204 buf[sizeof(buf) - 1] = (char) 0; in duk_bi_date_parse_string_strptime() 206 DUK_DDD(DUK_DDDPRINT("parsing: '%s'", (const char *) buf)); in duk_bi_date_parse_string_strptime() 209 if (strptime((const char *) buf, "%c", &tm) != NULL) { in duk_bi_date_parse_string_strptime() 258 char buf[DUK__STRFTIME_BUF_SIZE]; in duk_bi_date_format_parts_strftime() local 291 DUK_MEMZERO(buf, sizeof(buf)); in duk_bi_date_format_parts_strftime() 300 (void) strftime(buf, sizeof(buf) - 1, fmt, &tm); in duk_bi_date_format_parts_strftime() 301 DUK_ASSERT(buf[sizeof(buf) - 1] == 0); in duk_bi_date_format_parts_strftime() [all …]
|
D | duk_hbufferobject.h | 35 if ((h)->buf == NULL) { \ 51 (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ 52 (((duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR((heap), (h)->buf)) + (h)->offset)) 60 (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ 61 ((h)->offset == 0 && (h)->length == DUK_HBUFFER_GET_SIZE((h)->buf))) 67 (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ 68 ((h)->offset + (h)->length <= DUK_HBUFFER_GET_SIZE((h)->buf))) 78 (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ 79 ((h)->offset + (off) < DUK_HBUFFER_GET_SIZE((h)->buf))) 82 (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ [all …]
|
D | duk_bi_global.c | 727 const duk_uint8_t *buf; in duk_bi_global_object_print_helper() local 753 buf = (const duk_uint8_t *) duk_get_buffer(ctx, 0, &sz_buf); in duk_bi_global_object_print_helper() 754 DUK_ASSERT(buf != NULL); in duk_bi_global_object_print_helper() 763 buf = (const duk_uint8_t *) duk_get_lstring(ctx, -1, &sz_buf); in duk_bi_global_object_print_helper() 764 DUK_ASSERT(buf != NULL); in duk_bi_global_object_print_helper() 785 buf = (const duk_uint8_t *) p; in duk_bi_global_object_print_helper() 793 DUK_ASSERT((const duk_uint8_t *) p == buf + sz_buf); in duk_bi_global_object_print_helper() 796 buf = (const duk_uint8_t *) &nl; in duk_bi_global_object_print_helper() 803 DUK_ASSERT(buf != NULL); in duk_bi_global_object_print_helper() 811 DUK_FWRITE((const void *) buf, 1, (size_t) sz_buf, f_out); in duk_bi_global_object_print_helper() [all …]
|
D | duk_bi_buffer.c | 186 DUK_ASSERT(h_bufobj->buf == NULL); /* no need to decref */ in duk__set_bufobj_buffer() 190 h_bufobj->buf = h_val; in duk__set_bufobj_buffer() 548 if (h_bufobj->buf == NULL) { in duk_bi_buffer_constructor() 551 duk_push_hbuffer(ctx, h_bufobj->buf); in duk_bi_buffer_constructor() 615 duk_uint8_t *buf; in duk_bi_nodejs_buffer_constructor() local 620 buf = (duk_uint8_t *) duk_push_fixed_buffer(ctx, (duk_size_t) len); in duk_bi_nodejs_buffer_constructor() 624 buf[i] = (duk_uint8_t) (duk_to_uint32(ctx, -1) & 0xffU); in duk_bi_nodejs_buffer_constructor() 650 h_bufobj->buf = h_buf; in duk_bi_nodejs_buffer_constructor() 863 h_val = h_bufarg->buf; in duk_bi_typedarray_constructor() 867 h_bufobj->buf = h_val; in duk_bi_typedarray_constructor() [all …]
|
/civetweb-2.7.6/src/third_party/duktape-1.5.2/src-separate/ |
D | duk_debug_heap.c | 10 DUK_LOCAL void duk__sanitize_snippet(char *buf, duk_size_t buf_size, duk_hstring *str) { 16 DUK_MEMZERO(buf, buf_size); 26 buf[i] = (char) c; 101 char buf[64+1]; 117 duk__sanitize_snippet(buf, sizeof(buf), e); 126 (const char *) buf, 141 (const char *) buf, 159 char buf[64+1]; 169 duk__sanitize_snippet(buf, sizeof(buf), c->h); 171 (long) i, (long) c->bidx, (long) c->cidx, (const char *) buf)); [all …]
|
D | duk_hbuffer_ops.c | 18 DUK_INTERNAL void duk_hbuffer_resize(duk_hthread *thr, duk_hbuffer_dynamic *buf, duk_size_t new_siz… in duk_hbuffer_resize() argument 23 DUK_ASSERT(buf != NULL); in duk_hbuffer_resize() 24 DUK_ASSERT(DUK_HBUFFER_HAS_DYNAMIC(buf)); in duk_hbuffer_resize() 25 DUK_ASSERT(!DUK_HBUFFER_HAS_EXTERNAL(buf)); in duk_hbuffer_resize() 41 res = DUK_REALLOC_INDIRECT(thr->heap, duk_hbuffer_get_dynalloc_ptr, (void *) buf, new_size); in duk_hbuffer_resize() 46 (void *) DUK_HBUFFER_DYNAMIC_GET_DATA_PTR(thr->heap, buf), in duk_hbuffer_resize() 47 (long) DUK_HBUFFER_DYNAMIC_GET_SIZE(buf), in duk_hbuffer_resize() 57 prev_size = DUK_HBUFFER_DYNAMIC_GET_SIZE(buf); in duk_hbuffer_resize() 66 DUK_HBUFFER_DYNAMIC_SET_SIZE(buf, new_size); in duk_hbuffer_resize() 67 DUK_HBUFFER_DYNAMIC_SET_DATA_PTR(thr->heap, buf, res); in duk_hbuffer_resize() [all …]
|
D | duk_bi_date_unix.c | 198 char buf[DUK__STRPTIME_BUF_SIZE]; in duk_bi_date_parse_string_strptime() local 202 DUK_MEMZERO(buf, sizeof(buf)); /* valgrind whine without this */ in duk_bi_date_parse_string_strptime() 203 DUK_SNPRINTF(buf, sizeof(buf), "%s", (const char *) str); in duk_bi_date_parse_string_strptime() 204 buf[sizeof(buf) - 1] = (char) 0; in duk_bi_date_parse_string_strptime() 206 DUK_DDD(DUK_DDDPRINT("parsing: '%s'", (const char *) buf)); in duk_bi_date_parse_string_strptime() 209 if (strptime((const char *) buf, "%c", &tm) != NULL) { in duk_bi_date_parse_string_strptime() 258 char buf[DUK__STRFTIME_BUF_SIZE]; in duk_bi_date_format_parts_strftime() local 291 DUK_MEMZERO(buf, sizeof(buf)); in duk_bi_date_format_parts_strftime() 300 (void) strftime(buf, sizeof(buf) - 1, fmt, &tm); in duk_bi_date_format_parts_strftime() 301 DUK_ASSERT(buf[sizeof(buf) - 1] == 0); in duk_bi_date_format_parts_strftime() [all …]
|
D | duk_hbufferobject.h | 35 if ((h)->buf == NULL) { \ 51 (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ 52 (((duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR((heap), (h)->buf)) + (h)->offset)) 60 (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ 61 ((h)->offset == 0 && (h)->length == DUK_HBUFFER_GET_SIZE((h)->buf))) 67 (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ 68 ((h)->offset + (h)->length <= DUK_HBUFFER_GET_SIZE((h)->buf))) 78 (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ 79 ((h)->offset + (off) < DUK_HBUFFER_GET_SIZE((h)->buf))) 82 (DUK_ASSERT_EXPR((h) != NULL), DUK_ASSERT_EXPR((h)->buf != NULL), \ [all …]
|
D | duk_bi_global.c | 728 const duk_uint8_t *buf; in duk_bi_global_object_print_helper() local 754 buf = (const duk_uint8_t *) duk_get_buffer(ctx, 0, &sz_buf); in duk_bi_global_object_print_helper() 755 DUK_ASSERT(buf != NULL); in duk_bi_global_object_print_helper() 764 buf = (const duk_uint8_t *) duk_get_lstring(ctx, -1, &sz_buf); in duk_bi_global_object_print_helper() 765 DUK_ASSERT(buf != NULL); in duk_bi_global_object_print_helper() 786 buf = (const duk_uint8_t *) p; in duk_bi_global_object_print_helper() 794 DUK_ASSERT((const duk_uint8_t *) p == buf + sz_buf); in duk_bi_global_object_print_helper() 797 buf = (const duk_uint8_t *) &nl; in duk_bi_global_object_print_helper() 804 DUK_ASSERT(buf != NULL); in duk_bi_global_object_print_helper() 812 DUK_FWRITE((const void *) buf, 1, (size_t) sz_buf, f_out); in duk_bi_global_object_print_helper() [all …]
|
D | duk_bi_buffer.c | 186 DUK_ASSERT(h_bufobj->buf == NULL); /* no need to decref */ in duk__set_bufobj_buffer() 190 h_bufobj->buf = h_val; in duk__set_bufobj_buffer() 548 if (h_bufobj->buf == NULL) { in duk_bi_buffer_constructor() 551 duk_push_hbuffer(ctx, h_bufobj->buf); in duk_bi_buffer_constructor() 615 duk_uint8_t *buf; in duk_bi_nodejs_buffer_constructor() local 620 buf = (duk_uint8_t *) duk_push_fixed_buffer(ctx, (duk_size_t) len); in duk_bi_nodejs_buffer_constructor() 624 buf[i] = (duk_uint8_t) (duk_to_uint32(ctx, -1) & 0xffU); in duk_bi_nodejs_buffer_constructor() 650 h_bufobj->buf = h_buf; in duk_bi_nodejs_buffer_constructor() 863 h_val = h_bufarg->buf; in duk_bi_typedarray_constructor() 867 h_bufobj->buf = h_val; in duk_bi_typedarray_constructor() [all …]
|
/civetweb-2.7.6/examples/embedded_cpp/ |
D | embedded_cpp.cpp | 168 char buf[1024]; in handlePost() local 186 if (rlen > sizeof(buf)) { in handlePost() 187 rlen = sizeof(buf); in handlePost() 189 rlen = mg_read(conn, buf, (size_t)rlen); in handlePost() 193 wlen = mg_write(conn, buf, (size_t)rlen); in handlePost() 217 char buf[1024]; in handlePut() local 221 … _snprintf(buf, sizeof(buf), "D:\\somewhere\\%s\\%s", req_info->remote_user, req_info->local_uri); in handlePut() 222 buf[sizeof(buf)-1] = 0; in handlePut() 223 if (strlen(buf)>255) { in handlePut() 231 f = fopen_recursive(buf, "wb"); in handlePut() [all …]
|
/civetweb-2.7.6/src/third_party/duktape-1.8.0/examples/debug-trans-dvalue/ |
D | duk_trans_dvalue.c | 55 dv->buf = NULL; in duk_dvalue_alloc() 62 free(dv->buf); /* tolerates NULL */ in duk_dvalue_free() 63 dv->buf = NULL; in duk_dvalue_free() 68 static void duk__dvalue_bufesc(duk_dvalue *dv, char *buf, size_t maxbytes, int stresc) { in duk__dvalue_bufesc() argument 71 *buf = (char) 0; in duk__dvalue_bufesc() 74 unsigned char c = dv->buf[i]; in duk__dvalue_bufesc() 77 sprintf(buf, "%c", c); in duk__dvalue_bufesc() 78 buf++; in duk__dvalue_bufesc() 80 sprintf(buf, "\\x%02x", (unsigned int) c); in duk__dvalue_bufesc() 81 buf += 4; in duk__dvalue_bufesc() [all …]
|
/civetweb-2.7.6/src/third_party/duktape-1.5.2/examples/debug-trans-dvalue/ |
D | duk_trans_dvalue.c | 55 dv->buf = NULL; in duk_dvalue_alloc() 62 free(dv->buf); /* tolerates NULL */ in duk_dvalue_free() 63 dv->buf = NULL; in duk_dvalue_free() 68 static void duk__dvalue_bufesc(duk_dvalue *dv, char *buf, size_t maxbytes, int stresc) { in duk__dvalue_bufesc() argument 71 *buf = (char) 0; in duk__dvalue_bufesc() 74 unsigned char c = dv->buf[i]; in duk__dvalue_bufesc() 77 sprintf(buf, "%c", c); in duk__dvalue_bufesc() 78 buf++; in duk__dvalue_bufesc() 80 sprintf(buf, "\\x%02x", (unsigned int) c); in duk__dvalue_bufesc() 81 buf += 4; in duk__dvalue_bufesc() [all …]
|
/civetweb-2.7.6/src/ |
D | handle_form.inl | 152 search_boundary(const char *buf, argument 163 if (!memcmp(buf + i, "\r\n--", 4)) { 164 if (!memcmp(buf + i + 4, boundary, boundary_len)) { 165 return buf + i; 178 char buf[MG_BUF_LEN]; /* Must not be smaller than ~900 */ local 383 if ((size_t)buf_fill < (sizeof(buf) - 1)) { 385 size_t to_read = sizeof(buf) - 1 - (size_t)buf_fill; 386 r = mg_read(conn, buf + (size_t)buf_fill, to_read); 400 buf[buf_fill] = 0; 406 val = strchr(buf, '='); [all …]
|
D | civetweb.c | 769 mg_fgets(char *buf, size_t size, struct mg_file *filep, char **p); 1541 char *buf, 1548 char *buf, 2786 char *buf; /* Buffer for received data */ member 3129 const char *buf = NULL; in open_file_in_memory() local 3139 buf = conn->phys_ctx->callbacks.open_file(conn, path, &size); in open_file_in_memory() 3140 if (buf != NULL) { in open_file_in_memory() 3152 filep->access.membuf = buf; in open_file_in_memory() 3167 return (buf != NULL); in open_file_in_memory() 3415 char *buf, in mg_vsnprintf() argument [all …]
|
/civetweb-2.7.6/src/third_party/duktape-1.8.0/examples/cmdline/ |
D | duk_cmdline.c | 422 static void linenoise_completion(const char *buf, linenoiseCompletions *lc) { in linenoise_completion() argument 429 if (!buf) { in linenoise_completion() 437 p_start = (const unsigned char *) buf; in linenoise_completion() 438 p_end = (const unsigned char *) (buf + strlen(buf)); in linenoise_completion() 477 duk_push_string(ctx, (const char *) buf); in linenoise_completion() 494 char *buf = NULL; in handle_fh() local 501 buf = (char *) malloc(1024); in handle_fh() 502 if (!buf) { in handle_fh() 520 buf_new = (char *) realloc(buf, newsz); in handle_fh() 524 buf = buf_new; in handle_fh() [all …]
|