Giter VIP home page Giter VIP logo

sdbl's Introduction

sdbl

Simple Database Library - a module to do data persistence in C, in size fixed rows, size fixed columns, no data types.

For small data, no index.

The key for register is the number of register.

Installation

Just compile with make command.

Interface

  • SDBL_file_s *SDBL_open(const char *fname, int data_len)

Open file fname with register size of data_len characters, create if necessary. Returns a controller pointer.

  • int SDBL_close(SDBL_file_s *fh)

Free internal structures and close controller fh.

  • int SDBL_put(SDBL_file_s *finfo, SDBL_key_t key, char *data)

Save the register poitend by data into controller fh. If key is equal SDBL_NEW_RECORD, add a register, otherwise save a existent register pointed by key. Returns a true value if success.

  • char *SDBL_get(SDBL_file_s *file, SDBL_key_t key)

Returns a register pointed by key.

  • int SDBL_next(SDBL_file_s *)

Go to next register in file.

  • int SDBL_prev(SDBL_file_s *)

Go to prev register in file.

  • int SDBL_top(SDBL_file_s *)

Go to first register (top of file).

  • int SDBL_bottom(SDBL_file_s *)

Go to last register in file (bottom of file).

Usage example

See the test.c (type make test to compile).

sdbl's People

Contributors

paulohrpinheiro avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.