An open API service indexing awesome lists of open source software.

https://github.com/samuelmarks/linked-list

Linked-list implementation with from/to array support
https://github.com/samuelmarks/linked-list

Last synced: 6 months ago
JSON representation

Linked-list implementation with from/to array support

Awesome Lists containing this project

README

          

linked-list
===========

[![License](https://img.shields.io/badge/license-Apache--2.0%20OR%20MIT-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Linux, Windows, macOS](https://github.com/SamuelMarks/linked-list/actions/workflows/linux-Windows-macOS.yml/badge.svg)](https://github.com/SamuelMarks/linked-list/actions/workflows/linux-Windows-macOS.yml)

Linked-list implementation with from/to array support

## Design choices

Unlike `sys/queue.h` from BSD (1995), this avoids:
- macro usage
- special handling of first|empty list and last list element (as per [Linus Torvalds good-taste argument](https://www.ted.com/talks/linus_torvalds_the_mind_behind_linux))

Additionally, incorporated ASans and support for all compiler toolchains that integrate with CMake.

## Development guide

Install: CMake ; C compiler toolchain ; git. Then:

```sh
$ git clone "https://github.com/offscale/vcpkg" -b "project0"
# Windows:
$ vcpkg\bootstrap-vcpkg.bat
# Non-Windows:
$ ./vcpkg/bootstrap-vcpkg.sh
# Both Windows and non-Windows:
$ git clone "https://github.com/SamuelMarks/linked-list" && cd "linked-list" # Or your fork of this repo
# Windows
$ cmake -DCMAKE_BUILD_TYPE="Debug" -DCMAKE_TOOLCHAIN_FILE="..\vcpkg\scripts\buildsystems\vcpkg.cmake" -S . -B "build"
# Non-Windows
$ cmake -DCMAKE_BUILD_TYPE='Debug' -DCMAKE_TOOLCHAIN_FILE='../vcpkg/scripts/buildsystems/vcpkg.cmake' -S . -B 'build'
# Both Windows and non-Windows:
$ cmake --build "build"
# Test on both Windows and non-Windows:
$ cd "build" && ctest -C "Debug" --verbose
```

---

## License

Licensed under either of

- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or )
- MIT license ([LICENSE-MIT](LICENSE-MIT) or )

at your option.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.