Skip to content

Commit 713e2d4

Browse files
committed
Update badge layout
1 parent 563a6ad commit 713e2d4

File tree

1 file changed

+45
-68
lines changed

1 file changed

+45
-68
lines changed

README.md

Lines changed: 45 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,46 @@
44

55
# libdsc
66

7-
[![CI](https://github.com/cm-jones/libdsc/actions/workflows/ci.yaml/badge.svg)](https://github.com/cm-jones/libdsc/actions/workflows/ci.yaml)
8-
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/cb3382e664b54cb7b1f023424fcc774c)](https://app.codacy.com/gh/cm-jones/libdsc/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)
9-
[![Codecov](https://codecov.io/gh/cm-jones/libdsc/branch/main/graph/badge.svg)](https://codecov.io/gh/cm-jones/libdsc)
10-
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
7+
<div align="center">
118

12-
`libdsc` is an open-source C library featuring generic and memory-safe implementations of various containers provided by the C++ Standard Library.
9+
| Category | Status |
10+
|:--------:|:------:|
11+
| **Build** | [![CI](https://github.com/cm-jones/libdsc/actions/workflows/ci.yaml/badge.svg)](https://github.com/cm-jones/libdsc/actions/workflows/ci.yaml) |
12+
| **Quality** | [![Codacy Badge](https://app.codacy.com/project/badge/Grade/cb3382e664b54cb7b1f023424fcc774c)](https://app.codacy.com/gh/cm-jones/libdsc/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade) |
13+
| **Coverage** | [![Codecov](https://codecov.io/gh/cm-jones/libdsc/branch/main/graph/badge.svg)](https://codecov.io/gh/cm-jones/libdsc) |
14+
| **License** | [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) |
15+
16+
</div>
17+
18+
libdsc is a free and open-source C library featuring generic reimplementations of containers provided by the C++ Standard Library.
1319

1420
## Features
1521

16-
`libdsc` implements the following containers:
22+
libdsc currently reimplements the following containers:
23+
24+
### Sequence containers
25+
26+
- `std::vector`
27+
28+
- `std::forward_list`
29+
30+
- `std::list`
31+
32+
### Unordered associative containers
1733

18-
- `vector`: dynamically-sized array
19-
- `forward_list`: singly-linked list
20-
- `list`: doubly-linked list
21-
- `stack`: LIFO container
22-
- `queue`: FIFO container
23-
- `unordered_map`: hash table for key-value pairs
24-
- `unordered_set`: hash table for unique elements
34+
- `std::unordered_map`
2535

26-
All containers are:
36+
- `std::unordered_set`
2737

28-
- Generic (can store any data type)
29-
- Memory safe (with proper error handling)
30-
- Thoroughly tested
31-
- Benchmarked against C++ Standard Library counterparts
38+
### Container adaptors
39+
40+
- `std::stack`
41+
42+
- `std::queue`
43+
44+
All of these (re)implementations are generic (can store any data type), memory-safe, and benchmarked against their counterparts in the C++ Standard Library.
45+
46+
See [ROADMAP.md](ROADMAP.md) for a list of containers we plan to (re)implement in the future.
3247

3348
## Installing from source
3449

@@ -50,75 +65,35 @@ sudo make install
5065
This will install:
5166

5267
- Library files to `/usr/local/lib`
68+
5369
- Header files to `/usr/local/include/libdsc`
70+
5471
- CMake configuration files to `/usr/local/lib/cmake/libdsc`
5572

5673
## Installing from package
5774

58-
On Debian-based Linux distributions:
75+
On Debian-based Linux distributions (e.g., Debian, Ubuntu, Linux Mint):
5976

6077
```bash
61-
sudo dpkg -i libdsc-<current_version>.deb
78+
sudo dpkg -i libdsc-*.deb
6279
```
6380

64-
On RPM-based Linux distributions:
81+
On RPM-based Linux distributions (e.g., Fedora, Red Hat):
6582

6683
```bash
6784

6885
```
6986

7087
## Usage
7188

89+
Simply include the relevant headers in your project, like so:
90+
7291
```c
7392
#include <libdsc/vector.h>
7493
#include <libdsc/list.h>
75-
76-
// Include other containers as needed ...
77-
78-
#include <stdio.h>
79-
80-
int main(int argc, char *argv[]) {
81-
// Create a vector of integers
82-
dsc_vector *vec = vector_create(sizeof(int));
83-
84-
// Push some values
85-
for (size_t i = 0; i < 5; ++i) {
86-
vector_push_back(vec, &i);
87-
}
88-
89-
// Access elements
90-
for (size_t i = 0; i < vector_size(vec); ++i) {
91-
int *value = (int *) vector_get(vec, i);
92-
printf("%d ", *value);
93-
}
94-
95-
// Clean up
96-
vector_destroy(vec);
97-
98-
// Create a list of integers
99-
dsc_list *list = list_create(sizeof(int));
100-
101-
// Push some values
102-
for (size_t i = 0; i < 5; ++i) {
103-
list_push_back(list, &i);
104-
}
105-
106-
// Iterate through elements
107-
list_node_t *current = list_begin(list);
108-
while (current) {
109-
int *value = (int *) current->data;
110-
printf("%d ", *value);
111-
current = current->next;
112-
}
113-
114-
// Clean up
115-
list_destroy(list);
116-
117-
return EXIT_SUCCESS;
118-
}
11994
```
12095

121-
More examples can be found in the `examples` directory.
96+
Complete examples can be found in the `examples/` directory.
12297

12398
## Testing
12499

@@ -133,6 +108,8 @@ ctest --output-on-failure
133108

134109
Google Benchmark is used to measure the performance of libdsc's containers against their equivalents in the C++ Standard Library. Benchmarks are run weekly automatically via GitHub Actions. You can also run the benchmarks locally:
135110

111+
Benchmarks are automatica
112+
136113
```bash
137114
mkdir -p build
138115
cd build
@@ -144,8 +121,8 @@ cd benchmarks
144121

145122
## Contributing
146123

147-
Please read [CONTRIBUTING.md](CONTRIBUTING.md) carefully before you attempt to make contributions to this project.
124+
Please read [CONTRIBUTING.md](CONTRIBUTING.md) carefully before you attempt to make any contributions to this project.
148125

149126
## License
150127

151-
`libdsc` is licensed under the GPLv3. See [LICENSE](LICENSE) for details.
128+
This project is licensed under the GPLv3. See [LICENSE](LICENSE) for details.

0 commit comments

Comments
 (0)