1
0
Fork 0
mirror of https://github.com/tailix/libclayer.git synced 2024-11-20 11:06:24 -05:00

Rename the library to libclayer

This commit is contained in:
Alex Kotov 2022-12-25 14:14:39 +04:00
parent 05e449ee2c
commit 3cb38d379d
Signed by: kotovalexarian
GPG key ID: 553C0EBBEB5D5F08
18 changed files with 44 additions and 125 deletions

View file

@ -129,12 +129,12 @@ jobs:
- name: dist - name: dist
run: make dist run: make dist
- name: extract - name: extract
run: tar -xzf "libkernaux-$(cat VERSION).tar.gz" run: tar -xzf "libclayer-$(cat VERSION).tar.gz"
- name: configure - name: configure
run: cd "libkernaux-$(cat VERSION)" && ./configure --enable-checks run: cd "libclayer-$(cat VERSION)" && ./configure --enable-checks
- name: make - name: make
run: cd "libkernaux-$(cat VERSION)" && make run: cd "libclayer-$(cat VERSION)" && make
- name: check - name: check
run: cd "libkernaux-$(cat VERSION)" && make check || (./make/test-suite-log && false) run: cd "libclayer-$(cat VERSION)" && make check || (./make/test-suite-log && false)
- name: install - name: install
run: cd "libkernaux-$(cat VERSION)" && sudo make install run: cd "libclayer-$(cat VERSION)" && sudo make install

2
.gitignore vendored
View file

@ -71,4 +71,4 @@
/include/Makefile /include/Makefile
/tests/Makefile /tests/Makefile
/libkernaux.pc /libclayer.pc

View file

@ -4,7 +4,7 @@
image: openbsd/7.2 image: openbsd/7.2
arch: amd64 arch: amd64
sources: sources:
- https://github.com/tailix/libkernaux.git - https://github.com/tailix/libclayer.git
packages: packages:
- autoconf-2.71 - autoconf-2.71
- automake-1.16.5 - automake-1.16.5
@ -23,11 +23,11 @@ tasks:
make make
doas make install doas make install
- build: | - build: |
cd libkernaux cd libclayer
./autogen.sh ./autogen.sh
./configure --enable-checks-all CFLAGS='-O3' ./configure --enable-checks-all CFLAGS='-O3'
make make
doas make install doas make install
- test: | - test: |
cd libkernaux cd libclayer
make check make check

View file

@ -4,7 +4,7 @@ Common
* Add your name to [COPYING](/COPYING). * Add your name to [COPYING](/COPYING).
* Don't add your name to `AUTHORS` - it's for maintainers. * Don't add your name to `AUTHORS` - it's for maintainers.
* Add copyright notice in the beginning of changed files except the headers. * Add copyright notice in the beginning of changed files except the headers.
* If you change the behavior (even just fix a bug) of **libkernaux** (stable), * If you change the behavior (even just fix a bug) of **libclayer** (stable),
add a record to [ChangeLog](/ChangeLog). add a record to [ChangeLog](/ChangeLog).
Prohibitions: Prohibitions:
@ -88,19 +88,6 @@ Use **cppcheck**.
and with the prefix of the type name in Pascal case (example: and with the prefix of the type name in Pascal case (example:
`FooBar_car_cdr`). `FooBar_car_cdr`).
* Name public (*defined in the headers and exported as symbols*) regular
functions (*not methods*) and variables with the prefix `kernaux_` (example:
`kernaux_foo_bar`).
* Name public (*defined in the headers*) macros with the prefix `KERNAUX_`
(example: `KERNAUX_FOO_BAR`).
* Name public (*defined in the headers*) types with the prefix `KernAux_`
(example: `KernAux_FooBar`).
* Name public (*defined in the headers*) with the prefix `KernAux_` and with the
prefix of the surrounding type, separate type names with underscore (example:
`KernAux_FooBar_CarCdr`).
* Name public (*defined in the headers*) methods with the prefix `KernAux_` and
with the prefix of the type name (example: `KernAux_FooBar_car_cdr`).
* Use postfix `size` for a byte size. * Use postfix `size` for a byte size.
* Use postfix `slen` for C string length without terminating `\0` character * Use postfix `slen` for C string length without terminating `\0` character
(size - 1). (size - 1).

View file

@ -10,36 +10,34 @@ if ENABLE_CHECKS
SUBDIRS += tests SUBDIRS += tests
endif endif
AM_CFLAGS += -DKERNAUX_ACCESS_PRIVATE lib_LTLIBRARIES = libclayer.la
lib_LTLIBRARIES = libkernaux.la
if ENABLE_PKG_CONFIG if ENABLE_PKG_CONFIG
pkgconfigdir = @pkgconfdir@ pkgconfigdir = @pkgconfdir@
pkgconfig_DATA = libkernaux.pc pkgconfig_DATA = libclayer.pc
endif endif
################## ##################
# Required files # # Required files #
################## ##################
libkernaux_la_LDFLAGS = -version-info @PACKAGE_VERSION_SO@ libclayer_la_LDFLAGS = -version-info @PACKAGE_VERSION_SO@
libkernaux_la_SOURCES = \ libclayer_la_SOURCES = \
src/ctype.c \ src/ctype.c \
src/errno.c \ src/errno.c \
src/kernaux.c \ src/clayer.c \
src/stdlib.c \ src/stdlib.c \
src/string.c src/string.c
if ASM_I386 if ASM_I386
libkernaux_la_SOURCES += \ libclayer_la_SOURCES += \
src/asm/i386/longjmp.S \ src/asm/i386/longjmp.S \
src/asm/i386/setjmp.S src/asm/i386/setjmp.S
endif endif
if ASM_X86_64 if ASM_X86_64
libkernaux_la_SOURCES += \ libclayer_la_SOURCES += \
src/asm/x86_64/longjmp.S \ src/asm/x86_64/longjmp.S \
src/asm/x86_64/setjmp.S src/asm/x86_64/setjmp.S
endif endif

View file

@ -1,19 +1,17 @@
libkernaux libclayer
========== =========
[![Build status](https://github.com/tailix/libkernaux/actions/workflows/main.yml/badge.svg)](https://github.com/tailix/libkernaux/actions/workflows/main.yml) [![Build status](https://github.com/tailix/libclayer/actions/workflows/main.yml/badge.svg)](https://github.com/tailix/libclayer/actions/workflows/main.yml)
[![Build status (FreeBSD)](https://api.cirrus-ci.com/github/tailix/libkernaux.svg?task=Main%20(FreeBSD))](https://cirrus-ci.com/github/tailix/libkernaux) [![Build status (FreeBSD)](https://api.cirrus-ci.com/github/tailix/libclayer.svg?task=Main%20(FreeBSD))](https://cirrus-ci.com/github/tailix/libclayer)
Auxiliary library for kernel development. libc for both hosted and freestanding environments.
[Topic on OSDev.org forum](https://forum.osdev.org/viewtopic.php?f=1&t=37958).
Table of contents Table of contents
----------------- -----------------
* [Overview](#libkernaux) * [Overview](#libclayer)
* [Table of contents](#table-of-contents) * [Table of contents](#table-of-contents)
* [API](#api) * [API](#api)
* [Headers](#headers) * [Headers](#headers)

View file

@ -11,11 +11,11 @@ LT_PREREQ([2.4.6])
# Initialize Autoconf & Automake # # Initialize Autoconf & Automake #
################################## ##################################
AC_INIT([libkernaux], AC_INIT([libclayer],
m4_normalize(m4_include([VERSION])), m4_normalize(m4_include([VERSION])),
[https://github.com/tailix/libkernaux/issues], [https://github.com/tailix/libclayer/issues],
[libkernaux], [libclayer],
[https://github.com/tailix/libkernaux]) [https://github.com/tailix/libclayer])
AC_CANONICAL_BUILD AC_CANONICAL_BUILD
AC_CANONICAL_HOST AC_CANONICAL_HOST
@ -25,14 +25,14 @@ AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/xxxxx.c]) AC_CONFIG_SRCDIR([src/xxxxx.c])
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile
libkernaux.pc libclayer.pc
include/Makefile include/Makefile
tests/Makefile tests/Makefile
]) ])
AM_INIT_AUTOMAKE([1.16 subdir-objects]) AM_INIT_AUTOMAKE([1.16 subdir-objects])
AC_SUBST([PACKAGE_DESCR], ['Auxiliary library for kernel development']) AC_SUBST([PACKAGE_DESCR], ['libc for both hosted and freestanding environments'])
AC_SUBST([PACKAGE_VERSION_SO], m4_normalize(m4_include([VERSION_SO]))) AC_SUBST([PACKAGE_VERSION_SO], m4_normalize(m4_include([VERSION_SO])))

View file

@ -1,8 +1,8 @@
nobase_include_HEADERS = \ nobase_include_HEADERS = \
kernaux/libc.h \
ctype.h \ ctype.h \
errno.h \ errno.h \
inttypes.h \ inttypes.h \
libclayer.h \
setjmp.h \ setjmp.h \
stdlib.h \ stdlib.h \
string.h \ string.h \

View file

@ -1,5 +1,5 @@
#ifndef KERNAUX_INCLUDED_LIBC #ifndef _LIBCLAYER_H
#define KERNAUX_INCLUDED_LIBC #define _LIBCLAYER_H 1
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -7,7 +7,7 @@ extern "C" {
#include <stddef.h> #include <stddef.h>
struct KernAux_Libc { struct Libclayer {
void (*abort)() __attribute__((noreturn)); void (*abort)() __attribute__((noreturn));
void (*exit)(int status) __attribute__((noreturn)); void (*exit)(int status) __attribute__((noreturn));
@ -17,7 +17,7 @@ struct KernAux_Libc {
void *(*realloc)(void *ptr, size_t size); void *(*realloc)(void *ptr, size_t size);
}; };
extern struct KernAux_Libc kernaux_libc; extern struct Libclayer libclayer;
#ifdef __cplusplus #ifdef __cplusplus
} }

View file

@ -7,5 +7,5 @@ Name: @PACKAGE_NAME@
Description: @PACKAGE_DESCR@ Description: @PACKAGE_DESCR@
URL: @PACKAGE_URL@ URL: @PACKAGE_URL@
Version: @PACKAGE_VERSION@ Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lkernaux Libs: -L${libdir} -lclayer
Cflags: -I${includedir} Cflags: -I${includedir}

View file

@ -1 +0,0 @@
/devel/libkernaux/work/

View file

@ -1,19 +0,0 @@
PORTNAME= libkernaux
DISTVERSION= 0.7.0
CATEGORIES= devel
MASTER_SITES= https://github.com/tailix/libkernaux/releases/download/v${DISTVERSION}/
MAINTAINER= kotovalexarian@gmail.com
COMMENT= Auxiliary library for kernel development
WWW= https://github.com/tailix/libkernaux
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING
USES= libtool
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --enable-pkg-config=${PREFIX}/libdata/pkgconfig
.include <bsd.port.mk>

View file

@ -1,3 +0,0 @@
TIMESTAMP = 1671787519
SHA256 (libkernaux-0.7.0.tar.gz) = 19bbfe5d38731175fd762547fc169adffde6350cf30c9238f931909b26decd85
SIZE (libkernaux-0.7.0.tar.gz) = 500752

View file

@ -1,3 +0,0 @@
Auxiliary library for kernel development.
It's in the early stage of the development so there is no detailed description.

View file

@ -1,5 +0,0 @@
lib/libkernaux.a
lib/libkernaux.so
lib/libkernaux.so.0
lib/libkernaux.so.0.0.0
libdata/pkgconfig/libkernaux.pc

View file

@ -1,33 +0,0 @@
19bbfe5d38731175fd762547fc169adffde6350cf30c9238f931909b26decd85 libkernaux-0.7.0.tar.gz
ab54d7ed92e37ac9ae4982e297c4dcc49f9ae18e1be59631d175a33596d6cfcc kernaux-0.7.0.crate
15d41c87e270fa34a482df5cc243cdc87171ac513eb779f329fd4003d6df693a kernaux-sys-0.7.0.crate
0f3f97ad8244cbe2a0cdb8f8092f4f20d704281d91f0b41955270808f66aead4 kernaux-0.7.0.gem
#
16fc83a36826cad527ec0a232032b7b131b5be0468ccff9163df12e3e3986b9f libkernaux-0.6.1.tar.gz
e330f19d04d392e5c5979f3f4b88029b10ffe23fdf34f6d801947b20c8d0ba88 kernaux-0.6.1.crate
f21520d8d84558408ea444f0029dfca871fd3622513537837f86a97fc3c60648 kernaux-sys-0.6.1.crate
bfa7c9412830917526a563ac6a4402a579e5dba1a51666430069b8c9b5b8b428 kernaux-0.6.1.gem
#
6f32427f7cffdf11c0a11c26605b93e4bc2bdc6b02dd308d75d1e4aed88c6055 libkernaux-0.6.0.tar.gz
2734241f544ae5f5cceb72e9b61ac01b84013e6455c4adb4c0a74c4ac68f477c kernaux-0.6.0.crate
4cd9e098209d1f81cf9efeb334d8b5b9814d875e3ca7ea2e83741acf40d21477 kernaux-sys-0.6.0.crate
56b78efbb4714719c151c6b63dc708db28a5eed8c6ea60e7f96f8c9f355c65ef kernaux-0.6.0.gem
#
e18d88baa68295e57a05348f059bed105b14d6c6b52904db8c04c84cd70629ee libkernaux-0.5.0.tar.gz
c0bc0ed3c396893797912356366068ad04054ade23e293bbf61c72975165a3fc kernaux-0.5.0.crate
986b2f1b0befb8e1e1a6f97e67a64ab52974524eaa3f3948deef2dff28be946a kernaux-sys-0.5.0.crate
da5fbc5ad8d0d1f3c7a9c8627b59bb9c670893eed800f7b2190c81767f8bb70f kernaux-0.5.0.gem
#
893292882e0b658d92e104dc0d2974d61daca60efdf9fdf80996c3db54b0cab2 libkernaux-0.4.0.tar.gz
eb27d72d658f87638998cdb0056018edd49cc8f1144e23a1e00f7921a6bbd5b2 kernaux-0.4.0.crate
ee0d63d1f86113f3f652427b908da27fda7be496b5bdbba9947977891b2e50ef kernaux-sys-0.4.0.crate
2c765894b10830abc5945b003d465515fb28b964f1e2f7cdd5594bbf1cdbce97 kernaux-0.4.0.gem
#
6887939c01b65a4e864d47f103a06a6ad1639f4bffaa5582c95252c4646c8d2a libkernaux-0.3.0.tar.gz
564e5a58a854dd6b2b4e212ebac9c76a099971a2fa95324916de07b67f46934c kernaux-0.3.0.crate
1fddd0383dcce818273f305fffd0c7153d3772fcaf78dae38c30dae4f0960a25 kernaux-sys-0.3.0.crate
986b84827466d4ba7244c2e3ba41502a7984156346613af545946423f913d520 kernaux-0.3.0.gem
#
# Yanked:
00b22e28ecddde5beca8b7d425d91eaf3634ee1d9df0bcf9565938d02353cd49 libkernaux-0.2.0.tar.gz
b80c1d94519a43bd92c2b1a7626bdb5af5aa98dd993b2332d56449b0be7dbc8f libkernaux-0.1.0.tar.gz

View file

@ -2,11 +2,11 @@
#include "config.h" #include "config.h"
#endif #endif
#include <kernaux/libc.h> #include <libclayer.h>
#include <stddef.h> #include <stddef.h>
struct KernAux_Libc kernaux_libc = { struct Libclayer libclayer = {
.abort = NULL, .abort = NULL,
.exit = NULL, .exit = NULL,

View file

@ -2,7 +2,7 @@
#include "config.h" #include "config.h"
#endif #endif
#include <kernaux/libc.h> #include <libclayer.h>
#include <ctype.h> #include <ctype.h>
#include <stdbool.h> #include <stdbool.h>
@ -12,13 +12,13 @@
void exit(const int status) void exit(const int status)
{ {
// Custom implementation // Custom implementation
kernaux_libc.exit(status); libclayer.exit(status);
} }
void abort() void abort()
{ {
// Custom implementation // Custom implementation
if (kernaux_libc.abort) kernaux_libc.abort(); if (libclayer.abort) libclayer.abort();
// Default implementation // Default implementation
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
@ -27,7 +27,7 @@ void abort()
void *calloc(const size_t nmemb, const size_t size) void *calloc(const size_t nmemb, const size_t size)
{ {
// Custom implementation // Custom implementation
if (kernaux_libc.calloc) return kernaux_libc.calloc(nmemb, size); if (libclayer.calloc) return libclayer.calloc(nmemb, size);
// Default implementation // Default implementation
const size_t total_size = nmemb * size; const size_t total_size = nmemb * size;
@ -41,19 +41,19 @@ void *calloc(const size_t nmemb, const size_t size)
void free(void *const ptr) void free(void *const ptr)
{ {
// Custom implementation // Custom implementation
kernaux_libc.free(ptr); libclayer.free(ptr);
} }
void *malloc(const size_t size) void *malloc(const size_t size)
{ {
// Custom implementation // Custom implementation
return kernaux_libc.malloc(size); return libclayer.malloc(size);
} }
void *realloc(void *const ptr, const size_t size) void *realloc(void *const ptr, const size_t size)
{ {
// Custom implementation // Custom implementation
return kernaux_libc.realloc(ptr, size); return libclayer.realloc(ptr, size);
} }
int atoi(const char *str) int atoi(const char *str)