{"id":19846031,"url":"https://github.com/alexfru/typetraitsinc","last_synced_at":"2025-05-01T21:30:57.638Z","repository":{"id":20854946,"uuid":"24141624","full_name":"alexfru/TypeTraitsInC","owner":"alexfru","description":"Type Traits in C","archived":false,"fork":false,"pushed_at":"2014-09-25T04:45:35.000Z","size":184,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-04-03T17:01:14.983Z","etag":null,"topics":["c","endianness","self-descriptive","traits","types"],"latest_commit_sha":null,"homepage":null,"language":null,"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/alexfru.png","metadata":{"files":{"readme":"readme.txt","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}},"created_at":"2014-09-17T11:19:16.000Z","updated_at":"2023-02-14T07:29:31.000Z","dependencies_parsed_at":"2022-09-13T20:00:53.288Z","dependency_job_id":null,"html_url":"https://github.com/alexfru/TypeTraitsInC","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexfru%2FTypeTraitsInC","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexfru%2FTypeTraitsInC/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexfru%2FTypeTraitsInC/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexfru%2FTypeTraitsInC/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexfru","download_url":"https://codeload.github.com/alexfru/TypeTraitsInC/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224278439,"owners_count":17285080,"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":["c","endianness","self-descriptive","traits","types"],"created_at":"2024-11-12T13:10:08.429Z","updated_at":"2024-11-12T13:10:09.134Z","avatar_url":"https://github.com/alexfru.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"The presentation slides and the sample code (TBD) demonstrate how to implement\ntype traits in C somewhat similar to those that can be implemented in C++ with\ntemplates. This is achieved through construction of \"self-descriptive types\".\n\nThe technique lets the programmer write more generic C code that is still type-\naware and abstract away and hide most of the type-specific machinery while also\nmaking coding less error-prone.\n\nAs an example of the technique the presentation shows how one can greatly\nsimplify handling of byte order (AKA endianness) conversions by introducing\ntypes like little_endian_uint32_t and big_endian_uint16_t and just 2 macros\n(EGET() and ESET()) that the programmer has to use to achive the goal as opposed\nto using the following battery of similarly looking and easy-to-confuse macros:\nhtonl(), ntohl(), htons() and ntohs().\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexfru%2Ftypetraitsinc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexfru%2Ftypetraitsinc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexfru%2Ftypetraitsinc/lists"}