MCPcopy Create free account
hub / github.com/mattn/go-sqlite3 / memfwrite

Function memfwrite

_example/mod_vtable/sqlite3_mod_vtable.cc:37–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35}
36
37size_t
38memfwrite(char* ptr, size_t size, size_t nmemb, void* stream) {
39 MEMFILE* mf = (MEMFILE*) stream;
40 int block = size * nmemb;
41 if (!mf) return block; // through
42 if (!mf->data)
43 mf->data = (char*) malloc(block);
44 else
45 mf->data = (char*) realloc(mf->data, mf->size + block);
46 if (mf->data) {
47 memcpy(mf->data + mf->size, ptr, block);
48 mf->size += block;
49 }
50 return block;
51}
52
53char*
54memfstrdup(MEMFILE* mf) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected