{"id":18949016,"url":"https://github.com/junjizhi/fifo","last_synced_at":"2025-04-15T23:31:06.564Z","repository":{"id":28195761,"uuid":"31697867","full_name":"junjizhi/fifo","owner":"junjizhi","description":"A first-in-first-out(FIFO) queue implemented in C, based on the linux kernel linked list","archived":false,"fork":false,"pushed_at":"2015-03-05T08:40:05.000Z","size":152,"stargazers_count":7,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-07-11T12:22:23.092Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/junjizhi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-05T05:41:41.000Z","updated_at":"2024-03-07T05:50:53.000Z","dependencies_parsed_at":"2022-07-13T00:00:31.740Z","dependency_job_id":null,"html_url":"https://github.com/junjizhi/fifo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junjizhi%2Ffifo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junjizhi%2Ffifo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junjizhi%2Ffifo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junjizhi%2Ffifo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junjizhi","download_url":"https://codeload.github.com/junjizhi/fifo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223688650,"owners_count":17186299,"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":[],"created_at":"2024-11-08T13:15:25.629Z","updated_at":"2024-11-08T13:15:26.655Z","avatar_url":"https://github.com/junjizhi.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fifo\nA first-in-first-out(FIFO) queue implemented in C, based on the linux kernel linked list. It is a practice of how to use list_head data structure, etc. \n\n## Usage \n   #define QueueElement TYPE\n\n   Queue* q = initQueue(20);\n\n   QueueElement e1,e2; \n\n   /* init e1, e2*/ \n\n   enqueue(q,e1);\n\n   enqueue(q,e2);\n\n   dequeue(q);\n\n# Type generic issue\n  This queue implementation is type generic using void* type. It needs to be downcast to a certain\n  data type, which can be dangerous without proper type runtime check. \n\n  Alternatively, we can use Macro + structure offset to implement type generic queue data structures. Examples\n   include:\n  - list.h (kernel linked list), \n  - [uthash](http://troydhanson.github.io/uthash/) approach. \n  \n  However, the usage is a bit complicated because \n  - it has certain assumptions about how to use the data structure, e.g., list_for_each_entry(tmp, \u0026frame_queue-\u003elist, list). tmp needs to be the struct type contains the list member declaration. \n  - it needs to use the API calls to manipulate the data struct. That is, you need to memorize a bunch of functions, e.g.,  list_for_each_entry, HASH_FIND_INT(), etc. \n\n## Credits\n   list.h is copied from Kulesh Shanmugasundaram's site: \n   http://isis.poly.edu/kulesh/stuff/src/klist/\n   Kulesh deserves all the credits for posting the explanation and\nthe adapted source code. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunjizhi%2Ffifo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunjizhi%2Ffifo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunjizhi%2Ffifo/lists"}