{"id":26369882,"url":"https://github.com/jasperdevir/std_dds","last_synced_at":"2025-07-27T16:09:43.513Z","repository":{"id":282673701,"uuid":"949317452","full_name":"jasperdevir/std_dds","owner":"jasperdevir","description":"A single file C Library that implements of a range of basic dynamic data structures.","archived":false,"fork":false,"pushed_at":"2025-03-16T07:09:20.000Z","size":77,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T08:20:11.442Z","etag":null,"topics":["arraylist","data-structures","linkedlist"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jasperdevir.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-16T07:04:22.000Z","updated_at":"2025-03-16T07:10:26.000Z","dependencies_parsed_at":"2025-03-16T10:15:22.115Z","dependency_job_id":null,"html_url":"https://github.com/jasperdevir/std_dds","commit_stats":null,"previous_names":["jasperdevir/std_dds"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasperdevir%2Fstd_dds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasperdevir%2Fstd_dds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasperdevir%2Fstd_dds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasperdevir%2Fstd_dds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasperdevir","download_url":"https://codeload.github.com/jasperdevir/std_dds/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243945585,"owners_count":20372897,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arraylist","data-structures","linkedlist"],"created_at":"2025-03-16T23:17:05.018Z","updated_at":"2025-07-27T16:09:43.505Z","avatar_url":"https://github.com/jasperdevir.png","language":"C","readme":"# std_dds\nstd_dds _(Standard Dynamic Data Structures)_ is a simple C Library that\nimplements a range of basic dynamic data structures in C.\n\n### Data Structures Included:\n- Array List\n- Linked List\n- Doublely Linked List\n- Stack\n- Queue\n- Graph (Adjacency Matrix)\n- Graph (Adjacency List)\n- Tree\n- Binary Search Tree\n- Hash Map\n\n## Contents\n\n- [Usage](#usage)\n- [Examples](#examples)\n- [Macros](#macros)\n- [References](#references)\n\n## Usage\n\nInclude the `std_dds.h` header file to have access to all the data structures:\n```c\n#include \"std_dds.h\"\n```\n\nOtherwise, include individual header files for specific data structures:\n```c\n#include \"array_list.h\"\n#include \"stack.h\"\n```\nInclude all needed `.h` files in your project's `/include` directory, as well as\ntheir corresponding `.c` files in your `/src` directory.\n\n### Error and Warning Messages\n\nWithin all std_dds functions are optional error and warning messages that \ncould be useful during debugging. To enable them define `STD_DDS_ERROR_MSG` \nand/or `STD_DDS_WARNING_MSG`, defining `STD_DDS_WARNING_MSG` automatically\ndefines `STD_DDS_ERROR_MSG`.:\n```c\n#define STD_DDS_WARNING_MSG\n#include \"std_dds.h\"\n...\n\nLinkedListAppend(NULL, NULL);\n/** Calling this function like this will now result in \n * this warning message printed to stderr output.\n * \"[Warning] LinkedListAppend failed. LinkedList value is NULL.\" \n**/\n```\n\n### Result Codes\n\nSome std_dds functions return `STD_DDS_RESULT` which are `unsigned int` values\nreflecting the result status of the function process. If a function does not \nreturn `STD_DDS_RESULT` its return value in the case of a failure will be \nspecified in its inline documentation _(e.g. `-1`, `NULL`)_.\n\nA typical pattern for checking the status of std_dds functions should be\nsimilar to the following:\n\n```c\nArrayList *list = ArrayListInit(4);\nif(list == NULL){\n    // HANDLE ERROR\n}\n```\n\n```c\nif(ArrayListAppend(list, value) != STD_DDS_SUCCESS){\n    // HANDLE ERROR\n}\n```\n\n`std_dds_utils.h` contains the function `PrintResultCode(STD_DDS_RESULT result)`\nwhich can be used to print a result code as its string value.\n\n```c\nSTD_DDS_RESULT result = ArrayListInsertAt(list, index, value);\nif(result != STD_DDS_SUCCESS){\n    PrintResultCode(result);\n    // HANDLE ERROR\n}\n```\n\n## Examples\n\nThe `/examples` directory contains an example program for each data structure,\nutilising each one of its associated functions.\n\nTo build these programs with `make`, run the `make` command from the root\ndirectory.\n\nThe compiled example programs should now be in the `/bin/` directory.\n\n## Macros\n\n### Warning and Error Messages\n\n- `STD_DDS_ERROR_MSG`\n    - Enables error messages printed to `stderr`. \n- `STD_DDS_WARNING_MSG`\n    - Enables warning messages printed to `stderr`\n    - _(Automatically defines `STD_DDS_ERROR_MSG`)_    \n\n### Result Codes\n\n- `STD_DDS_RESULT` = `unsigned int`\n\n##### Success Code\n\n- `STD_DDS_SUCCESS` = `0`\n\n##### Non-Critical Error Codes (1-999)\n\n- `STD_DDS_NULL_PARAM` = `100`\n- `STD_DDS_OUT_OF_BOUNDS` = `200`\n- `STD_DDS_NOT_FOUND` = `210`\n- `STD_DDS_DUPLICATE_VALUE` = `300`\n\n##### Critical Error Codes (1000-)\n\n- `STD_DDS_MALLOC_FAILED` = `1000`\n- `STD_DDS_CALLOC_FAILED` = `1010`\n- `STD_DDS_REALLOC_FAILED` = `1020`\n\n## References\n\nThis project was completed during my completion of the postgraduate subject \n[COMP9024 Data Structures and Algorithms](https://www.handbook.unsw.edu.au/postgraduate/courses/2025/comp9024) \nat [UNSW](https://www.unsw.edu.au/).\n\nThe [course outline](https://www.unsw.edu.au/course-outlines/course-outline#courseCode=COMP9024\u0026year=2025) \nfor COMP9024 sites the use of the following three books: \n- [Algorithms in C Parts 1-4](https://www.oreilly.com/library/view/algorithms-in-c/9780768685312/) by Robert Sedgewick \n- [Algorithms in C Part 5](https://www.oreilly.com/library/view/algorithms-in-c/9780768685329/) by Robert Sedgewick \n- [Programming, Problem Solving, and Abstraction in C](https://www.pearson.com/en-au/subject-catalog/p/programming-problem-solving-and-abstraction-with-c-pearson-original-edition/P200000008355/9781486010974) by Alistar Moffat \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasperdevir%2Fstd_dds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasperdevir%2Fstd_dds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasperdevir%2Fstd_dds/lists"}