Skip to content
/ bixi Public

C89 basic types and functions library

License

LGPL-3.0 and 2 other licenses found

Licenses found

LGPL-3.0
LICENSE
GPL-3.0
COPYING
LGPL-3.0
COPYING.LESSER
Notifications You must be signed in to change notification settings

codemeow/bixi

Bixi

Logo
C89 basic types and functions library for Linux, BSD and Minix operation systems.

Origins of the name

bixi statue image
Bixi or Bi Xi (Wade–Giles: Pi-hsi), is a figure from Chinese mythology. One of the 9 sons of the Dragon King, he is depicted as a dragon with the shell of a turtle. Stone sculptures of Bixi have been used in Chinese culture for centuries as a decorative plinth for commemorative steles and tablets, particularly in the funerary complexes of its later emperors and to commemorate important events, such as an imperial visit or the anniversary of a World War II victory. They are also used at the bases of bridges and archways. Sculptures of Bixi are traditionally rubbed for good luck, which can cause conservation issues. They can be found throughout East Asia in Japan, Korea, Vietnam, Mongolia, and even the Russian Far East.
(from wikipedia.org)
The name Bixi was selected to symbolise the basis of any solid and reliable library.

User manual

Definitions

Graph

Hashes

Math

Net

Random

Serials

Strings

Thread

Time

Types

Utils

External dependencies

Bixi library has no external dependencies. Headers of the standart library are not included anywhere in the project.

Compiling

From terminal

Debug mode:

./scripts/build.sh debug

Release mode:

./scripts/build.sh release

All the binaries will be put into ./bin directory.
All the includes wiil be put into ./includes directory.

Additional compiler options could be transferred as additional arguments:

./scripts/build.sh release -DBXI_NO_SQRTI

From QtCreator

Examples and demos

The library packed with examples of use and demos the following programs are available:

Braxel

Braxel library provides a few functions to be able to draw by Braille characters in stdout or FILE *. The following functions are present:

typedef struct
{
    bxi_size size;
    bxi_bts  data;
} brx_pic_t;

typedef enum
{
    BRX_MODE_BACK,
    BRX_MODE_FRONT,
    BRX_MODE_NOT_BACK,
    BRX_MODE_NOT_FRONT,

    BRX_MODE_OR,
    BRX_MODE_AND,
    BRX_MODE_XOR,
    BRX_MODE_NOR,
    BRX_MODE_NAND,

    BRX_MODE_COUNT
} brx_mode;
brx_pic_t * brx_pic_create   (bxi_size   size);
void        brx_pic_free     (brx_pic_t * pic);
void        brx_pic_draw     (brx_pic_t * pic, FILE * file);
void        brx_pic_pixel_set(brx_pic_t * pic, bxi_point pt, u8 value);
u8          brx_pic_pixel_get(brx_pic_t * pic, bxi_point pt);
void        brx_pic_map(brx_pic_t * back, brx_pic_t * front, bxi_point pt, brx_mode mode);

The examples of use are present in the next demo:

Braxel-demo

This example shows use of Bixi library and Braxel library to simulate "Tetris" demo. The code demonstrates use of integer names and size/position related structions (like bxi_size) and functions (like bxi_point_c).

NOTE: To run this demo you also need to add ./bin/braxel path to your LD_LIBRARY_PATH.

Net-server-demo

This example shows use of Bixi library for creation of pseudo-NTP server (the server which will send connected user current time). The code demostrate use of byte-order conversion functions, functions for bxi_bts byte arrays, to hex and to base64 converters (bxi_raw2hex, bxi_bin2base64). Also this demo provides example for memory allocation logging:

[I] Ready. Connect to 127.0.0.1:20622
[I] Client connected
[M] ./code/libbixi/types/bxiarrays.c:48 > [(nil)] realloc 45 bytes to [0x13eb420]
[M] ./code/libbixi/types/bxiarrays.c:48 > [(nil)] realloc 45 bytes to [0x13eb460]
[M] ./code/libbixi/types/bxiarrays.c:48 > [0x13eb460] realloc 47 bytes to [0x13eb460]
[M] ./code/libbixi/types/bxiarrays.c:48 > [(nil)] realloc 92 bytes to [0x13eb4a0]
[M] ./code/libbixi/types/bxiarrays.c:48 > [0x13eb460] realloc 139 bytes to [0x13eb510]
[M] ./code/net-server-demo/main.c:125 > [0x13eb4a0] freed
[M] ./code/net-server-demo/main.c:167 > [0x13eb420] freed
[M] ./code/net-server-demo/main.c:168 > [0x13eb510] freed

About

C89 basic types and functions library

Resources

License

LGPL-3.0 and 2 other licenses found

Licenses found

LGPL-3.0
LICENSE
GPL-3.0
COPYING
LGPL-3.0
COPYING.LESSER

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published