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
run: make dist
- name: extract
run: tar -xzf "libkernaux-$(cat VERSION).tar.gz"
run: tar -xzf "libclayer-$(cat VERSION).tar.gz"
- name: configure
run: cd "libkernaux-$(cat VERSION)" && ./configure --enable-checks
run: cd "libclayer-$(cat VERSION)" && ./configure --enable-checks
- name: make
run: cd "libkernaux-$(cat VERSION)" && make
run: cd "libclayer-$(cat VERSION)" && make
- 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
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
/tests/Makefile
/libkernaux.pc
/libclayer.pc

View File

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

View File

@ -4,7 +4,7 @@ Common
* Add your name to [COPYING](/COPYING).
* Don't add your name to `AUTHORS` - it's for maintainers.
* 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).
Prohibitions:
@ -88,19 +88,6 @@ Use **cppcheck**.
and with the prefix of the type name in Pascal case (example:
`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 `slen` for C string length without terminating `\0` character
(size - 1).

View File

@ -10,36 +10,34 @@ if ENABLE_CHECKS
SUBDIRS += tests
endif
AM_CFLAGS += -DKERNAUX_ACCESS_PRIVATE
lib_LTLIBRARIES = libkernaux.la
lib_LTLIBRARIES = libclayer.la
if ENABLE_PKG_CONFIG
pkgconfigdir = @pkgconfdir@
pkgconfig_DATA = libkernaux.pc
pkgconfig_DATA = libclayer.pc
endif
##################
# 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/errno.c \
src/kernaux.c \
src/clayer.c \
src/stdlib.c \
src/string.c
if ASM_I386
libkernaux_la_SOURCES += \
libclayer_la_SOURCES += \
src/asm/i386/longjmp.S \
src/asm/i386/setjmp.S
endif
if ASM_X86_64
libkernaux_la_SOURCES += \
libclayer_la_SOURCES += \
src/asm/x86_64/longjmp.S \
src/asm/x86_64/setjmp.S
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 (FreeBSD)](https://api.cirrus-ci.com/github/tailix/libkernaux.svg?task=Main%20(FreeBSD))](https://cirrus-ci.com/github/tailix/libkernaux)
[![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/libclayer.svg?task=Main%20(FreeBSD))](https://cirrus-ci.com/github/tailix/libclayer)
Auxiliary library for kernel development.
[Topic on OSDev.org forum](https://forum.osdev.org/viewtopic.php?f=1&t=37958).
libc for both hosted and freestanding environments.
Table of contents
-----------------
* [Overview](#libkernaux)
* [Overview](#libclayer)
* [Table of contents](#table-of-contents)
* [API](#api)
* [Headers](#headers)

View File

@ -11,11 +11,11 @@ LT_PREREQ([2.4.6])
# Initialize Autoconf & Automake #
##################################
AC_INIT([libkernaux],
AC_INIT([libclayer],
m4_normalize(m4_include([VERSION])),
[https://github.com/tailix/libkernaux/issues],
[libkernaux],
[https://github.com/tailix/libkernaux])
[https://github.com/tailix/libclayer/issues],
[libclayer],
[https://github.com/tailix/libclayer])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
@ -25,14 +25,14 @@ AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/xxxxx.c])
AC_CONFIG_FILES([
Makefile
libkernaux.pc
libclayer.pc
include/Makefile
tests/Makefile
])
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])))

View File

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

View File

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

View File

@ -7,5 +7,5 @@ Name: @PACKAGE_NAME@
Description: @PACKAGE_DESCR@
URL: @PACKAGE_URL@
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lkernaux
Libs: -L${libdir} -lclayer
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"
#endif
#include <kernaux/libc.h>
#include <libclayer.h>
#include <stddef.h>
struct KernAux_Libc kernaux_libc = {
struct Libclayer libclayer = {
.abort = NULL,
.exit = NULL,

View File

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