{"id":22213850,"url":"https://github.com/damir-sijakovic/ds80lib","last_synced_at":"2025-07-23T11:06:34.210Z","repository":{"id":135104522,"uuid":"198805636","full_name":"damir-sijakovic/ds80lib","owner":"damir-sijakovic","description":"ds80lib - c data structures library","archived":false,"fork":false,"pushed_at":"2019-07-30T22:13:06.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-25T06:26:47.255Z","etag":null,"topics":["c","hashtable","linkedlist","pair","vector"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/damir-sijakovic.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":"2019-07-25T09:56:05.000Z","updated_at":"2019-07-30T22:13:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"a3fa3eab-631b-4a21-b0ff-1e5a1415fcfa","html_url":"https://github.com/damir-sijakovic/ds80lib","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/damir-sijakovic/ds80lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damir-sijakovic%2Fds80lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damir-sijakovic%2Fds80lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damir-sijakovic%2Fds80lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damir-sijakovic%2Fds80lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/damir-sijakovic","download_url":"https://codeload.github.com/damir-sijakovic/ds80lib/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/damir-sijakovic%2Fds80lib/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266665813,"owners_count":23964974,"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","status":"online","status_checked_at":"2025-07-23T02:00:09.312Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["c","hashtable","linkedlist","pair","vector"],"created_at":"2024-12-02T21:11:32.547Z","updated_at":"2025-07-23T11:06:34.178Z","avatar_url":"https://github.com/damir-sijakovic.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![alt text](https://repository-images.githubusercontent.com/198805636/16b3e680-afde-11e9-91b5-30d1ca5981b1)\n\n# DS80LIB c library \n#### Version 0.60 \n\nC data structures. Written as a test of code reusability in C language.\nReleased in the BSD licence. Most of the code is written by me (Damir Šijaković) \nand some parts are from public domain code found on internet.\n\n## Structures\n\n * DSVector - dynamically resizable array\n * DSLinkedlist - plain one direction linked list\n * DSHashtable - hash table using DSVector/DSLinkedList\n * DSPair - key/pair datatype with JSON export (will be used with DSVector as part of DSJson)\n * DSChunk - basic keyname chunk with size;\n \nFuture plans:\n\n * DSSend - send data to file/port/sql\n * DSJson - parse json strings\n * DSString - string datatype with JS like functions\n \n## Current status\n \n'ds80lib' is still in early development and it doesn't build as whole yet. \nEven though you could make object (.o) files and link all together in one lib.\nBest way to play around with these is to wipe everything from test.c/main() and use compile.sh inside module directory. \nDevelopment is done in module directories. So to compile run test.sh in module directory.  \nLib/code is tested under ArchLinux/openrc 5.1 kernel and Valgrind 3.14.\nDocumentation is in [ds80lib_docs.html](http://htmlpreview.github.io/?https://github.com/damir-sijakovic/ds80lib/blob/master/ds80lib_docs.html) file.\n\n\n## Interface \n\n### DSVector\n\n        typedef struct DSVector{     \n            size_t length;\n            DSVectorMode mode;\n            int step;\n            void * data[1];    \n        } DSVector;  \n\n\n        DSVector *dsv_create(size_t size, DSVectorMode mode, int step);\n        DSVector *dsv_clone(DSVector *handle); //clones adt object\n        void dsv_destroy(DSVector *handle);\n        int dsv_resize(DSVector **handle, size_t length);\n        boolean dsv_set(DSVector **handle, unsigned index, void * data); \n        void *dsv_get(DSVector *handle, unsigned index);\n        int dsv_shrinkToFit(DSVector **handle);\n        boolean dsv_forEach(DSVector **handle, boolean (*fn_ptr)(void **));\n        int dsv_forEachComplex(DSVector **handle, int (*fn_ptr)(void**, void**), void **data); \n        void *dsv_forEachData(DSVector **handle, void *(*fn_ptr)(void**, void**), void **data);  \n        void **dsv_getContainer(DSVector **handle, unsigned index);\n\n        int dsv_push(DSVector **handle, void *data); \n        void *dsv_pop(DSVector **handle);\n        int dsv_unshift(DSVector **handle, void *data);\n        void *dsv_shift(DSVector **handle);\n        void dsv_nullify(DSVector **v); \n        size_t dsv_getByteSize(DSVector *v); \n        boolean dsv_reverse(DSVector **v);\n        boolean dsv_compare(DSVector *a, DSVector *b);\n        int dsv_areMembers(DSVector *v, void *data, unsigned start_index); \n        void *dsv_removeMember(DSVector **handle, unsigned idx);\n        int dsv_insertMember(DSVector **handle, unsigned idx, void *data);   \n        void dsv_swapMembers(DSVector **handle, unsigned idx_a, unsigned idx_b);\n        DSVector *dsv_merge(DSVector *a, DSVector *b);\n        void dsv_firstToLast(DSVector **handle);\n        void dsv_lastToFirst(DSVector **handle);\n        boolean dsv_isNull(DSVector *handle, unsigned idx);\n        int dsv_countUsed(DSVector *handle);\n        int dsv_countFree(DSVector *handle);\n\n### DSLinkedList\n\n        typedef struct DSNode {    \n            void *data;\n            struct DSNode *next;\n        } DSNode;\n\n        typedef struct DSLinkedList {    \n            unsigned length;\n            struct DSNode *head;\n            struct DSNode *tail;\n        } DSLinkedList;\n\n\n        DSLinkedList *dsll_initilize();\n        DSNode *dsll_createNode(void *data);\n        int dsll_terminate(DSLinkedList **l);\n        size_t dsll_push(DSLinkedList **l, void *data);\n        void *dsll_pop(DSLinkedList **l); //rem last pass rem data\n        size_t dsll_unshift(DSLinkedList **l, void *val); //add first return length\n        void *dsll_shift(DSLinkedList **l); //rem first and return value\n        void dsll_firstToLast(DSLinkedList **l);\n        void dsll_lastToFirst(DSLinkedList **l);\n        boolean dsll_forEach(DSLinkedList **l, boolean (*pf)(void**)); \n        int dsll_forEachComplex(DSLinkedList **l, int (*pf)(void**, void**), void **data);\n        void *dsll_forEachData(DSLinkedList **l, void* (*pf)(void**, void**), void **data); \n        void *dsll_get(DSLinkedList *l, unsigned index);\n        void *dsll_set(DSLinkedList *l, unsigned index, void *data);\n        boolean dsll_dataExists(DSLinkedList *l, void *data);  \n        DSLinkedList *dsll_merge(DSLinkedList *a, DSLinkedList *b);\n        boolean dsll_find(DSLinkedList **l, DSNode **n, unsigned idx);\n        int dsll_findPrev(DSLinkedList **l, DSNode **prev, unsigned idx);\n        void *dsll_findData(DSLinkedList **l, void *data);   \n        DSNode *dsll_findDataGetNode(DSLinkedList **l, void *data);\n        int dsll_findDataIndex(DSLinkedList **l, void *data);  \n        int dsll_findPrevData(DSLinkedList **l, DSNode **prev, void *data); \n        boolean dsll_swap(DSLinkedList *l, unsigned idx_a, unsigned idx_b);\n\n        //linkedlist \u003c=\u003e vector\n        DSLinkedList *dsll_vectorToLinkedList(DSVector *v);\n        DSVector *dsll_linkedListToVector(DSLinkedList *l);\n        DSLinkedList *dsll_reverse(DSLinkedList *l);\n\n\n### DSPair\n\n        typedef struct DSPair{\n            char *key;\n            char data[1];\n        } DSPair;\n            \n        // DSPair adt must be deallocated with free()    \n        DSPair *dspr_newNumber(char *key, double n);\n        int dspr_typeOf(DSPair *handle);    \n        DSPair *dspr_setNumber(DSPair **handle, double n);\n        double dspr_getNumber(DSPair *handle);    \n        DSPair *dspr_newString(char *key, char *str);\n        char *dspr_getString(DSPair *handle);\n        size_t dspr_getStringSize(DSPair *handle);\n        DSPair *dspr_newBoolean(char *key, boolean b);\n        boolean dspr_getBoolean(DSPair *handle);   \n        DSPair *dspr_newNull(char *key);\n        char *dspr_toJson(DSPair *handle);\n        char *dspr_toJsonStripped(DSPair *handle);  \n        char *dspr_getKey(DSPair *handle);\n        \n        \n        \n### DSHashtable\n\n        typedef struct DSHashTable{\n            unsigned size;    \n            DSHashTableEnum hash;\n            DSHashTableModeEnum bucket_mode;\n            DSVector *table;\n        } DSHashTable;\n\n        typedef struct DSHashTablePair {    \n            char *key;\n            void *data;\n        } DSHashTablePair;\n\n        DSHashTable *dshs_create(unsigned size, DSHashTableEnum hash, DSHashTableModeEnum mode);\n        int dshs_destroy(DSHashTable **handle);\n        int dshs_set(DSHashTable **handle, char *key, void *data);\n        void *dshs_get(DSHashTable **handle, char *key);\n        int dshs_countCollides(DSHashTable *handle);\n        int dshs_countMembers(DSHashTable *handle);\n        int dshs_toPrime(int num);\n        DSVector *dshs_convertToVector(DSHashTable *handle);\n        DSLinkedList *dshs_convertToLinkedList(DSHashTable *handle);\n\n\n### Copyright and license\n\nDamir Šijaković (c) 2019, BSD Licence \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamir-sijakovic%2Fds80lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdamir-sijakovic%2Fds80lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdamir-sijakovic%2Fds80lib/lists"}