From 64c5d5aacd60ac07bcbd24655fcec3c96858e6d2 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 6 Dec 2007 10:38:01 +0000 Subject: [PATCH] Copyrights and hexadecmal. --- mapping.h | 5 +++++ sqlite3.h | 5 +++++ stdlib.h | 7 ++++++- string.h | 39 ++++++++++++++++++++++++++++++++++++++- 4 files changed, 54 insertions(+), 2 deletions(-) diff --git a/mapping.h b/mapping.h index 0c9bdde..3b93013 100644 --- a/mapping.h +++ b/mapping.h @@ -35,6 +35,9 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef MINIMAL_MAPPING_H +#define MINIMAL_MAPPING_H + #include #include @@ -63,3 +66,5 @@ void *map(const char *path, size_t offset, size_t size, size_t *psize, bool ro) _syscall(close(fd)); return base; } + +#endif/*MINIMAL_MAPPING_H*/ diff --git a/sqlite3.h b/sqlite3.h index 9a95e94..b721343 100644 --- a/sqlite3.h +++ b/sqlite3.h @@ -35,6 +35,9 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef MINIMAL_SQLITE3_H +#define MINIMAL_SQLITE3_H + #include #include @@ -66,3 +69,5 @@ char *sqlite3_column_string(sqlite3_stmt *stmt, int n) { bool sqlite3_column_boolean(sqlite3_stmt *stmt, int n) { return sqlite3_column_int(stmt, n) != 0; } + +#endif/*MINIMAL_SQLITE3_H*/ diff --git a/stdlib.h b/stdlib.h index 21fd7d7..06709eb 100644 --- a/stdlib.h +++ b/stdlib.h @@ -35,6 +35,9 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#ifndef MINIMAL_STDLIB_H +#define MINIMAL_STDLIB_H + #define _assert(expr) \ do if (!(expr)) { \ fprintf(stderr, "%s(%u): _assert(%u:%s)\n", __FILE__, __LINE__, errno, #expr); \ @@ -63,7 +66,7 @@ #define _breakpoint() \ __asm__ { int 0x3 } -#define _unused \ +#define _disused \ __attribute__((unused)) #include @@ -71,3 +74,5 @@ #include #include #include + +#endif/*MINIMAL_STDLIB_H*/ diff --git a/string.h b/string.h index c259399..b304134 100644 --- a/string.h +++ b/string.h @@ -1,9 +1,46 @@ +/* Minimal - the simplest thing that could possibly work + * Copyright (C) 2007 Jay Freeman (saurik) +*/ + +/* + * Redistribution and use in source and binary + * forms, with or without modification, are permitted + * provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the + * above copyright notice, this list of conditions + * and the following disclaimer. + * 2. Redistributions in binary form must reproduce the + * above copyright notice, this list of conditions + * and the following disclaimer in the documentation + * and/or other materials provided with the + * distribution. + * 3. The name of the author may not be used to endorse + * or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + * TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + #ifndef MINIMAL_STRING_H #define MINIMAL_STRING_H #include -_unused static char *strndup_(const char *src, int len) { +_disused static char *strndup_(const char *src, int len) { char *dst = malloc(len + 1); _assert(dst != NULL); strncpy(dst, src, len); -- 2.45.2