Skip to content

Releases: null-default/easyqueue

v1.1.0

22 Feb 19:11
3c5db47

Choose a tag to compare

Easyqueue

Easyqueue is a simple queue implementation in C intended to support flexible applicability with a simple interface. It encapsulates a fixed-size buffer in which items are stored that is augmented by a dynamically allocated singly-linked list when the fixed-size buffer is filled.

Other features include:

  • Configurability
    • Compile-time configurable fixed-size buffer length
    • Optional maximum capacity, configurable per-queue
  • Portability
    • Supports custom memory allocators
    • No external dependencies
    • Written using C89-conformant syntax
  • Fully unit tested

Usage

After installation, simply include the easyqueue.h header file in your project to use the definitions. The Easyqueue API is straightforward and only consists of a few symbols:

Symbol Symbol Type Description
ezq_queue struct The primary structure encapsulating the Easyqueue queue implementation. This structure name has been typedef'd for more convenient usage.
ezq_status enum An integer-based status code that indicates the success or failure of an Easyqueue API function. All Easyqueue API functions (except ezq_count) return one of these values, with successful calls returning EZQ_STATUS_SUCCESS and unsuccessful calls returning an error-specific value. This enumeration has been typedef'd for more convenient usage.
EZQ_FIXED_BUFFER_CAPACITY Preprocessor definition The number of items an ezq_queue will be able to store without necessitating dynamic allocation. See the Configuration section for more details.
ezq_init Function Initializes an ezq_queue structure, setting its fields to their respective "empty" values.
ezq_push Function Places a new item at the tail end of a passed ezq_queue.
ezq_pop Function Retrieves an item from the front end of a passed ezq_queue.
ezq_count Function Returns the number of items in a passed ezq_queue. An optional ezq_status pointer may be passed to capture the success or failure of the operation.
ezq_destroy Function Clears a passed ezq_queue and performs any necessary teardown.

NOTE: The ezq_queue structure definition (and those of its supporting structures) are exposed to avoid users having to dynamically allocate instances of it. This structure is not intended to be accessed directly, but rather through the Easyqueue API functions.

Configuration

Easyqueue supports some configuration options, depending on your build system.

Option/Flag Option Type Description Default Value
EZQ_FIXED_BUFFER_CAPACITY Compilation Flag Sets the number of items an ezq_queue will support before dynamically allocating new nodes. 32
EASYQUEUE_FIXED_BUFFER_CAPACITY CMake Variable CMake variable equivalent to the EZQ_FIXED_BUFFER_CAPACITY compilation flag. 32
EASYQUEUE_BUILD_EXAMPLES CMake Variable If set/defined, any example programs in the examples/ directory will be built. unset
EASYQUEUE_BUILD_32 CMake Option If set, the build outputs (to include any examples) are built for 32-bit systems. Setting this option disables stack protection. OFF

Pre-Built Releases

The v1.1.0 release comes with pre-built binaries for both x86 and x86_64 Unix systems. .zip and .tar.gz archives are provided, but both contain the same contents. The contents are as follows:

libeasyqueue-1.1.0/
├── include/
│   └── easyqueue.h
├── lib/
│   ├── libeasyqueue.a         # 64-bit static archive
│   └── libeasyqueue.so.1.1.0  # 64-bit shared object
└── lib32/
    ├── libeasyqueue.a         # 32-bit static archive
    └── libeasyqueue.so.1.1.0  # 32-bit shared object

v1.0.0

19 Feb 02:19
5336ca3

Choose a tag to compare

Easyqueue

Easyqueue is a simple queue implementation in C intended to support flexible applicability with a simple interface. It encapsulates a fixed-size buffer in which items are stored that is augmented by a dynamically allocated singly-linked list when the fixed-size buffer is filled.

Other features include:

  • Configurability
    • Compile-time configurable fixed-size buffer length
    • Optional maximum capacity, configurable per-queue
  • Portability
    • Supports custom memory allocators
    • No external dependencies
    • Written using C89-conformant syntax

Usage

After installation, simply include the easyqueue.h header file in your project to use the definitions. The Easyqueue API is straightforward and only consists of a few symbols:

Symbol Symbol Type Description
ezq_queue struct The primary structure encapsulating the Easyqueue queue implementation. This structure name has been typedef'd for more convenient usage.
ezq_status enum An integer-based status code that indicates the success or failure of an Easyqueue API function. All Easyqueue API functions (except ezq_count) return one of these values, with successful calls returning EZQ_STATUS_SUCCESS and unsuccessful calls returning an error-specific value. This enumeration has been typedef'd for more convenient usage.
EZQ_FIXED_BUFFER_CAPACITY Preprocessor definition The number of items an ezq_queue will be able to store without necessitating dynamic allocation. See the Configuration section for more details.
ezq_init Function Initializes an ezq_queue structure, setting its fields to their respective "empty" values.
ezq_push Function Places a new item at the tail end of a passed ezq_queue.
ezq_pop Function Retrieves an item from the front end of a passed ezq_queue.
ezq_count Function Returns the number of items in a passed ezq_queue. An optional ezq_status pointer may be passed to capture the success or failure of the operation.
ezq_destroy Function Clears a passed ezq_queue and performs any necessary teardown.

NOTE: The ezq_queue structure definition (and those of its supporting structures) are exposed to avoid users having to dynamically allocate instances of it. This structure is not intended to be accessed directly, but rather through the Easyqueue API functions.

Configuration

Easyqueue supports some configuration options, depending on your build system.

Option/Flag Option Type Description Default Value
EZQ_FIXED_BUFFER_CAPACITY Compilation Flag Sets the number of items an ezq_queue will support before dynamically allocating new nodes. 32
EASYQUEUE_FIXED_BUFFER_CAPACITY CMake Variable CMake variable equivalent to the EZQ_FIXED_BUFFER_CAPACITY compilation flag. 32
EASYQUEUE_BUILD_EXAMPLES CMake Variable If set/defined, any example programs in the examples/ directory will be built. unset
EASYQUEUE_BUILD_32 CMake Option If set, the build outputs (to include any examples) are built for 32-bit systems. Setting this option disables stack protection. OFF

Pre-Built Releases

The v1.0.0 release comes with pre-built binaries for both x86 and x86_64 Unix systems. .zip and .tar.gz archives are provided, but both contain the same contents. The contents are as follows:

libeasyqueue-1.0.0/
├── include/
│   └── easyqueue.h
├── lib/
│   ├── libeasyqueue.a         # 64-bit static archive
│   └── libeasyqueue.so.1.0.0  # 64-bit shared object
└── lib32/
    ├── libeasyqueue.a         # 32-bit static archive
    └── libeasyqueue.so.1.0.0  # 32-bit shared object