diff options
author | Simon Rettberg | 2017-04-21 16:48:09 +0200 |
---|---|---|
committer | Simon Rettberg | 2017-04-21 16:48:09 +0200 |
commit | cab08b7e3fcbec061c12b842cf66a8e7d22b11d3 (patch) | |
tree | 82e450cf27b86d6315eaebe76a8dc7c291f12476 /strstorage.c | |
parent | Remove unused string matching helpers (diff) | |
download | ldadp-cab08b7e3fcbec061c12b842cf66a8e7d22b11d3.tar.gz ldadp-cab08b7e3fcbec061c12b842cf66a8e7d22b11d3.tar.xz ldadp-cab08b7e3fcbec061c12b842cf66a8e7d22b11d3.zip |
Delete some more unused files
Diffstat (limited to 'strstorage.c')
-rw-r--r-- | strstorage.c | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/strstorage.c b/strstorage.c deleted file mode 100644 index 3cc98b7..0000000 --- a/strstorage.c +++ /dev/null @@ -1,29 +0,0 @@ -#include <stdlib.h> -#include "byte.h" -#include "strstorage.h" - -#define PAGESIZE 4096 - -const char* strstorage_add(const char* s,size_t n) { - static char* page=0; - static size_t leftonpage=0; - if (leftonpage>=n) { -copyit: - byte_copy(page,n,s); - s=page; - page+=n; - leftonpage-=n; - } else { - if (n>=PAGESIZE/2) { - char* tmp=malloc(n); - if (!tmp) return 0; - byte_copy(tmp,n,s); - s=tmp; - } else { - if (!(page=malloc(PAGESIZE))) return 0; - leftonpage=PAGESIZE; - goto copyit; - } - } - return s; -} |