Author | Jamozed <[email protected]> |
Date | 2021-09-03 12:26:09 |
Commit | 406a4fab376d0a53435fadcf564b6ccd1ff37b7d |
Parent | 3b606bcced02e7a8b4d7a6ec04577f1e75a0f88b |
meta: Rename project to libcll
Diffstat
M | CMakeLists.txt | | | 8 | ++++---- |
M | README.md | | | 30 | +++++++++++++++++++++--------- |
M | man/error.3 | | | 2 | +- |
M | man/optget.3 | | | 2 | +- |
M | src/base32.c | | | 2 | +- |
M | src/base32.h | | | 8 | ++++---- |
M | src/base64.c | | | 2 | +- |
M | src/base64.h | | | 8 | ++++---- |
M | src/crypt.h | | | 8 | ++++---- |
M | src/endian.h | | | 8 | ++++---- |
M | src/error.c | | | 2 | +- |
M | src/error.h | | | 8 | ++++---- |
M | src/mode.c | | | 2 | +- |
M | src/mode.h | | | 8 | ++++---- |
M | src/optget.c | | | 2 | +- |
M | src/optget.h | | | 8 | ++++---- |
M | src/rc2.c | | | 2 | +- |
M | src/rc2.h | | | 8 | ++++---- |
M | src/strconv.h | | | 8 | ++++---- |
M | src/strtoi.c | | | 2 | +- |
M | src/strtou.c | | | 2 | +- |
M | src/test/test_base32.c | | | 2 | +- |
M | src/test/test_base64.c | | | 2 | +- |
M | src/test/test_crypt.c | | | 2 | +- |
M | src/test/test_endian.c | | | 2 | +- |
M | src/test/test_error.c | | | 2 | +- |
M | src/test/test_optget.c | | | 2 | +- |
M | src/test/test_rc2.c | | | 2 | +- |
M | src/test/test_strtou.c | | | 2 | +- |
29 files changed, 79 insertions, 67 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3485d98..096c3ca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.12) -PROJECT(lib LANGUAGES C) +PROJECT(libcll LANGUAGES C) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib) @@ -9,10 +9,10 @@ SET(CMAKE_SHARED_LIBRARY_PREFIX "") FILE(GLOB SRC ${PROJECT_SOURCE_DIR}/src/*) -ADD_LIBRARY(lib_static STATIC ${SRC}) -ADD_LIBRARY(lib_shared SHARED ${SRC}) +ADD_LIBRARY(libcll_static STATIC ${SRC}) +ADD_LIBRARY(libcll_shared SHARED ${SRC}) -LINK_LIBRARIES(lib_static) +LINK_LIBRARIES(libcll_static) ADD_EXECUTABLE(test_base32 ${PROJECT_SOURCE_DIR}/src/test/test_base32.c) ADD_EXECUTABLE(test_base64 ${PROJECT_SOURCE_DIR}/src/test/test_base64.c) diff --git a/README.md b/README.md index 9fa20da..d78971c 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# OMKOV lib +# libcll -> OMKOV local library +> C local library -OMKOV lib is a lightweight generic library to be included locally in projects. +**libcll** is a lightweight library to be included locally in projects. ## Components @@ -18,20 +18,32 @@ OMKOV lib is a lightweight generic library to be included locally in projects. | rc2 | RC2 encryption algorithm | RFC 2268 | | strconv | String conversion functions | | -## Build Instructions +## Usage -OMKOV lib uses CMake to build. -Binaries will be located in the `bin` directory. -Libraries will be located in the `lib` directory. +**libcll** is being developed on x86-64 Linux, and some components may depend on +POSIX provided functionality. + +**libcll** source files are intended to be built directly into your project. + +### Dependencies + +- CMake >= 3.12, to build -### UNIX Build +### Building -Run `BuildUNIX.sh`, or +> To build **libcll** on UNIX, run `BuildUNIX.sh` or ```sh cmake -S . -B build && cmake --build build ``` +Binaries will be located in the `bin` directory. +Libraries will be located in the `lib` directory. + +### Testing + +> To run **libcll** unit tests on UNIX, run TestUNIX.sh once built + ## Meta Copyright (C) 2020, Jakob Wakeling diff --git a/man/error.3 b/man/error.3 index f047b04..606841f 100644 --- a/man/error.3 +++ b/man/error.3 @@ -1,4 +1,4 @@ -.TH ERROR 3 2020-11-01 "OMKOV lib" "OMKOV lib Programmer's Manual" +.TH ERROR 3 2020-11-01 "libcll" "libcll Programmer's Manual" .SH NAME error, warn, serr \(em error reporting functions .SH SYNOPSYS diff --git a/man/optget.3 b/man/optget.3 index 7de1590..ee3332a 100644 --- a/man/optget.3 +++ b/man/optget.3 @@ -1,4 +1,4 @@ -.TH OPTGET 3 2020-11-01 "OMKOV lib" "OMKOV lib Programmer's Manual" +.TH OPTGET 3 2020-11-01 "libcll" "libcll Programmer's Manual" .SH NAME optget \(em parse command line options .SH SYNOPSYS diff --git a/src/base32.c b/src/base32.c index 76ed533..a339be4 100644 --- a/src/base32.c +++ b/src/base32.c @@ -1,5 +1,5 @@ // base32.c, version 1.0.2 -// Base32 source file for OMKOV lib +// Base32 source file for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. diff --git a/src/base32.h b/src/base32.h index 3cc2f08..7d445bf 100644 --- a/src/base32.h +++ b/src/base32.h @@ -1,5 +1,5 @@ // base32.h, version 1.0.2 -// Base32 header file for OMKOV lib +// Base32 header file for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. @@ -30,8 +30,8 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */ -#ifndef OMKOV_LIB_BASE32_H_2PSMZTB0 -#define OMKOV_LIB_BASE32_H_2PSMZTB0 +#ifndef OMKOV_LIBCLL_BASE32_H_2PSMZTB0 +#define OMKOV_LIBCLL_BASE32_H_2PSMZTB0 #include <stdint.h> #include <stdlib.h> @@ -42,4 +42,4 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. extern size_t b32encode(uint8_t *dst, uint8_t *src, size_t len); extern size_t b32decode(uint8_t *dst, uint8_t *src, size_t len); -#endif // OMKOV_LIB_BASE32_H_2PSMZTB0 +#endif // OMKOV_LIBCLL_BASE32_H_2PSMZTB0 diff --git a/src/base64.c b/src/base64.c index 6f26d9b..90025f3 100644 --- a/src/base64.c +++ b/src/base64.c @@ -1,5 +1,5 @@ // base64.c, version 1.1.3 -// Base64 source file for OMKOV lib +// Base64 source file for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. diff --git a/src/base64.h b/src/base64.h index 6ddb4a8..bd3ab87 100644 --- a/src/base64.h +++ b/src/base64.h @@ -1,5 +1,5 @@ // base64.h, version 1.1.3 -// Base64 header file for OMKOV lib +// Base64 header file for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. @@ -30,8 +30,8 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */ -#ifndef OMKOV_LIB_BASE64_H_5YQ80JRV -#define OMKOV_LIB_BASE64_H_5YQ80JRV +#ifndef OMKOV_LIBCLL_BASE64_H_5YQ80JRV +#define OMKOV_LIBCLL_BASE64_H_5YQ80JRV #include <stdint.h> #include <stdlib.h> @@ -42,4 +42,4 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. extern size_t b64encode(uint8_t *dst, uint8_t *src, size_t len); extern size_t b64decode(uint8_t *dst, uint8_t *src, size_t len); -#endif // OMKOV_LIB_BASE64_H_5YQ80JRV +#endif // OMKOV_LIBCLL_BASE64_H_5YQ80JRV diff --git a/src/crypt.h b/src/crypt.h index 3869e68..3d6e96a 100644 --- a/src/crypt.h +++ b/src/crypt.h @@ -1,5 +1,5 @@ // crypt.h, version 0.1.0 -// Crypt header file for OMKOV lib +// Crypt header file for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. @@ -30,8 +30,8 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */ -#ifndef OMKOV_LIB_CRYPT_H_RDY6J5JV -#define OMKOV_LIB_CRYPT_H_RDY6J5JV +#ifndef OMKOV_LIBCLL_CRYPT_H_RDY6J5JV +#define OMKOV_LIBCLL_CRYPT_H_RDY6J5JV #include <stdint.h> @@ -47,4 +47,4 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. #define ROR32(x, n) (uint32_t)(((x) >> (n)) | ((x) << (32 - (n)))) #define ROR64(x, n) (uint64_t)(((x) >> (n)) | ((x) << (64 - (n)))) -#endif // OMKOV_LIB_CRYPT_H_RDY6J5JV +#endif // OMKOV_LIBCLL_CRYPT_H_RDY6J5JV diff --git a/src/endian.h b/src/endian.h index d7b7044..3097498 100644 --- a/src/endian.h +++ b/src/endian.h @@ -1,5 +1,5 @@ // endian.h, version 1.0.0 -// Endian header file for OMKOV lib +// Endian header file for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. @@ -30,8 +30,8 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */ -#ifndef OMKOV_LIB_ENDIAN_H_G7AID2RQ -#define OMKOV_LIB_ENDIAN_H_G7AID2RQ +#ifndef OMKOV_LIBCLL_ENDIAN_H_G7AID2RQ +#define OMKOV_LIBCLL_ENDIAN_H_G7AID2RQ #include <stdint.h> @@ -150,4 +150,4 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. ((uint8_t *)(p))[6] = ((uint64_t)(x) >> 8) & 0xFFu; \ ((uint8_t *)(p))[7] = ((uint64_t)(x) >> 0) & 0xFFu -#endif // OMKOV_LIB_ENDIAN_H_G7AID2RQ +#endif // OMKOV_LIBCLL_ENDIAN_H_G7AID2RQ diff --git a/src/error.c b/src/error.c index e0c80d3..4af4ae5 100644 --- a/src/error.c +++ b/src/error.c @@ -1,5 +1,5 @@ // error.c, version 1.0.2 -// Error source file for OMKOV lib +// Error source file for libcll // Copyright (C) 2020, Jakob Wakeling // All rights reserved. diff --git a/src/error.h b/src/error.h index 16db9cf..0d95d25 100644 --- a/src/error.h +++ b/src/error.h @@ -1,5 +1,5 @@ // error.h, version 1.0.2 -// Error header file for OMKOV lib +// Error header file for libcll // Copyright (C) 2020, Jakob Wakeling // All rights reserved. @@ -30,8 +30,8 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */ -#ifndef OMKOV_LIB_ERROR_H_38W06M3W -#define OMKOV_LIB_ERROR_H_38W06M3W +#ifndef OMKOV_LIBCLL_ERROR_H_38W06M3W +#define OMKOV_LIBCLL_ERROR_H_38W06M3W #include <stdbool.h> #include <stdnoreturn.h> @@ -44,4 +44,4 @@ extern void warn(const char *format, ...); extern char *serr(void); -#endif // OMKOV_LIB_ERROR_H_38W06M3W +#endif // OMKOV_LIBCLL_ERROR_H_38W06M3W diff --git a/src/mode.c b/src/mode.c index 5714c8f..424a8df 100644 --- a/src/mode.c +++ b/src/mode.c @@ -1,5 +1,5 @@ // mode.c, version 1.0.1 -// Mode source file for OMKOV lib +// Mode source file for libcll // Copyright (C) 2020, Jakob Wakeling // All rights reserved. diff --git a/src/mode.h b/src/mode.h index 407dcd4..d8d9f75 100644 --- a/src/mode.h +++ b/src/mode.h @@ -1,5 +1,5 @@ // mode.h, version 1.0.1 -// Mode header file for OMKOV lib +// Mode header file for libcll // Copyright (C) 2020, Jakob Wakeling // All rights reserved. @@ -30,8 +30,8 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */ -#ifndef OMKOV_LIB_MODE_H_0C99POMA -#define OMKOV_LIB_MODE_H_0C99POMA +#ifndef OMKOV_LIBCLL_MODE_H_0C99POMA +#define OMKOV_LIBCLL_MODE_H_0C99POMA #include <sys/types.h> @@ -51,4 +51,4 @@ enum { MF_NULL, MF_NORM, MF_XIFX, MF_COPY }; extern chmod_t *strmode(char *str); -#endif // OMKOV_LIB_MODE_H_0C99POMA +#endif // OMKOV_LIBCLL_MODE_H_0C99POMA diff --git a/src/optget.c b/src/optget.c index da61ebd..a466580 100644 --- a/src/optget.c +++ b/src/optget.c @@ -1,5 +1,5 @@ // optget.h, version 1.6.0 -// optget source file for OMKOV lib +// optget source file for libcll // Copyright (C) 2020, Jakob Wakeling // All rights reserved. diff --git a/src/optget.h b/src/optget.h index f83d132..4f7716a 100644 --- a/src/optget.h +++ b/src/optget.h @@ -1,5 +1,5 @@ // optget.h, version 1.6.0 -// optget header file for OMKOV lib +// optget header file for libcll // Copyright (C) 2020, Jakob Wakeling // All rights reserved. @@ -30,8 +30,8 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */ -#ifndef OMKOV_LIB_OPTGET_H_W3LIZK1S -#define OMKOV_LIB_OPTGET_H_W3LIZK1S +#ifndef OMKOV_LIBCLL_OPTGET_H_W3LIZK1S +#define OMKOV_LIBCLL_OPTGET_H_W3LIZK1S #define ARG_NUL 0 #define ARG_REQ 1 @@ -52,4 +52,4 @@ extern const struct opt OPTGET_INIT; extern int optget(struct opt *opt, char *av[], int flags); -#endif // OMKOV_LIB_OPTGET_H_W3LIZK1S +#endif // OMKOV_LIBCLL_OPTGET_H_W3LIZK1S diff --git a/src/rc2.c b/src/rc2.c index 7ce26ed..e43bc8b 100644 --- a/src/rc2.c +++ b/src/rc2.c @@ -1,5 +1,5 @@ // rc2.c -// RC2 source file for OMKOV libcrypt +// RC2 source file for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. diff --git a/src/rc2.h b/src/rc2.h index 9818117..e729ac7 100644 --- a/src/rc2.h +++ b/src/rc2.h @@ -1,5 +1,5 @@ // rc2.h -// RC2 header file for OMKOV libcrypt +// RC2 header file for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. @@ -30,8 +30,8 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */ -#ifndef OMKOV_LIBCRYPT_RC2_H_PMXL29JH -#define OMKOV_LIBCRYPT_RC2_H_PMXL29JH +#ifndef OMKOV_LIBCLL_RC2_H_PMXL29JH +#define OMKOV_LIBCLL_RC2_H_PMXL29JH #include <stdint.h> #include <stdlib.h> @@ -42,4 +42,4 @@ extern void rc2expand(struct rc2 *ctx, const uint8_t *key, int len, int ekl); extern void rc2encrypt(struct rc2 *ctx, uint8_t *in, uint8_t *out); extern void rc2decrypt(struct rc2 *ctx, uint8_t *in, uint8_t *out); -#endif // OMKOV_LIBCRYPT_RC2_H_PMXL29JH +#endif // OMKOV_LIBCLL_RC2_H_PMXL29JH diff --git a/src/strconv.h b/src/strconv.h index e93c101..a6a0b2b 100644 --- a/src/strconv.h +++ b/src/strconv.h @@ -1,5 +1,5 @@ // strconv.h, version 1.1.0 -// String conversion header file for OMKOV lib +// String conversion header file for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. @@ -30,8 +30,8 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. */ -#ifndef OMKOV_LIB_STRCONV_H_3EQMSZZK -#define OMKOV_LIB_STRCONV_H_3EQMSZZK +#ifndef OMKOV_LIBCLL_STRCONV_H_3EQMSZZK +#define OMKOV_LIBCLL_STRCONV_H_3EQMSZZK #include <stdint.h> @@ -45,4 +45,4 @@ uint16_t strtou16(const char *nptr, char **endptr, register int base); uint32_t strtou32(const char *nptr, char **endptr, register int base); uint64_t strtou64(const char *nptr, char **endptr, register int base); -#endif // OMKOV_LIB_STRCONV_H_3EQMSZZK +#endif // OMKOV_LIBCLL_STRCONV_H_3EQMSZZK diff --git a/src/strtoi.c b/src/strtoi.c index 7951000..3cd3ef3 100644 --- a/src/strtoi.c +++ b/src/strtoi.c @@ -1,5 +1,5 @@ // strtoi.c, version 1.1.0 -// String conversion source file for OMKOV lib +// String conversion source file for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. diff --git a/src/strtou.c b/src/strtou.c index 2584dce..ef52d2f 100644 --- a/src/strtou.c +++ b/src/strtou.c @@ -1,5 +1,5 @@ // strtou.c, version 1.1.0 -// String conversion source file for OMKOV lib +// String conversion source file for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. diff --git a/src/test/test_base32.c b/src/test/test_base32.c index 72feac3..b6991ad 100644 --- a/src/test/test_base32.c +++ b/src/test/test_base32.c @@ -1,5 +1,5 @@ // test_base32.c -// Base32 unit test for OMKOV lib +// Base32 unit test for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. diff --git a/src/test/test_base64.c b/src/test/test_base64.c index eecc712..731e8e5 100644 --- a/src/test/test_base64.c +++ b/src/test/test_base64.c @@ -1,5 +1,5 @@ // test_base64.c -// Base64 unit test for OMKOV lib +// Base64 unit test for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. diff --git a/src/test/test_crypt.c b/src/test/test_crypt.c index 8d476cb..b0d3e47 100644 --- a/src/test/test_crypt.c +++ b/src/test/test_crypt.c @@ -1,5 +1,5 @@ // test_crypt.c -// Crypt unit test for OMKOV lib +// Crypt unit test for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. diff --git a/src/test/test_endian.c b/src/test/test_endian.c index d26476b..c831e04 100644 --- a/src/test/test_endian.c +++ b/src/test/test_endian.c @@ -1,5 +1,5 @@ // test_endian.c -// Endian unit test for OMKOV lib +// Endian unit test for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. diff --git a/src/test/test_error.c b/src/test/test_error.c index a204048..193f09e 100644 --- a/src/test/test_error.c +++ b/src/test/test_error.c @@ -1,5 +1,5 @@ // test_error.c -// Error unit test for OMKOV lib +// Error unit test for libcll // Copyright (C) 2020, Jakob Wakeling // All rights reserved. diff --git a/src/test/test_optget.c b/src/test/test_optget.c index 5b6c276..ee287b7 100644 --- a/src/test/test_optget.c +++ b/src/test/test_optget.c @@ -1,5 +1,5 @@ // test_optget.c -// optget unit test for OMKOV lib +// optget unit test for libcll // Copyright (C) 2020, Jakob Wakeling // All rights reserved. diff --git a/src/test/test_rc2.c b/src/test/test_rc2.c index ebd1560..e7c8e9a 100644 --- a/src/test/test_rc2.c +++ b/src/test/test_rc2.c @@ -1,5 +1,5 @@ // test_crypt.c -// Crypt unit test for OMKOV lib +// Crypt unit test for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved. diff --git a/src/test/test_strtou.c b/src/test/test_strtou.c index eb9609f..2f7f05e 100644 --- a/src/test/test_strtou.c +++ b/src/test/test_strtou.c @@ -1,5 +1,5 @@ // test_strtou.c -// String conversion unit test for OMKOV lib +// String conversion unit test for libcll // Copyright (C) 2021, Jakob Wakeling // All rights reserved.