{"id":32617737,"url":"https://github.com/cfnptr/pack","last_synced_at":"2025-10-30T17:05:33.711Z","repository":{"id":40388718,"uuid":"412092730","full_name":"cfnptr/pack","owner":"cfnptr","description":"Runtime optimized multi-platform data packing library for realtime game resources loading","archived":false,"fork":false,"pushed_at":"2025-09-27T09:05:52.000Z","size":1084,"stargazers_count":10,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-27T11:21:15.608Z","etag":null,"topics":["c","c99","compression","compressor","container","cpp","cross-platform","csharp","data","library","multi-platform","pack","package","packer","packing","resource","resources","runtime","storage","zstd"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cfnptr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-09-30T14:14:53.000Z","updated_at":"2025-09-27T09:05:55.000Z","dependencies_parsed_at":"2024-02-03T18:40:38.796Z","dependency_job_id":"a0e50a2a-ecf0-4d16-8874-20cc1c68747c","html_url":"https://github.com/cfnptr/pack","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/cfnptr/pack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fpack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fpack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fpack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fpack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cfnptr","download_url":"https://codeload.github.com/cfnptr/pack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cfnptr%2Fpack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281844759,"owners_count":26571538,"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-10-30T02:00:06.501Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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","c99","compression","compressor","container","cpp","cross-platform","csharp","data","library","multi-platform","pack","package","packer","packing","resource","resources","runtime","storage","zstd"],"created_at":"2025-10-30T17:05:30.264Z","updated_at":"2025-10-30T17:05:33.706Z","avatar_url":"https://github.com/cfnptr.png","language":"C","readme":"# Pack\n\nA [library](https://github.com/cfnptr/pack) providing **packing** of files into runtime reading optimized archives, across different platforms.\u003cbr/\u003e\nFor example can be used to load game resources. (images, shaders, models, levels, etc...)\n\nSee the [documentation](https://cfnptr.github.io/pack).\n\n## Features\n\n* Compressed file pack creation\n* Runtime optimized file pack reading\n* Automatic file data deduplication\n* Maximum ZSTD compression level\n* Customisable compression threshold\n* C and C++ implementations\n\n## Usage example\n\n```cpp\nvoid packReaderExampleCPP()\n{\n    pack::Reader packReader(\"resources.pack\");\n    auto itemIndex = packReader.getItemIndex(\"textures/sky.png\");\n    std::vector\u003cuint8_t\u003e itemData;\n    packReader.readItemData(itemIndex, itemData);\n    // use data...\n}\n```\n\n```c\nvoid packReaderExampleC()\n{\n    PackReader packReader = NULL;\n    PackResult packResult = createFilePackReader(\"resources.pack\", 0, false, 1, \u0026packReader);\n    if (packResult != SUCCESS_PACK_RESULT) abort();\n\n    uint64_t itemIndex = 0;\n    bool result = getPackItemIndex(packReader, \"textures/sky.png\")\n    if (!result) abort();\n\n    uint32_t dataSize = getPackItemDataSize(packReader, itemIndex);\n    uint8_t* itemData = (uint8_t*)malloc(dataSize);\n    if (!itemData) abort();\n\n    packResult = readPackItemData(packReader, itemIndex, itemData, 0)\n    if (packResult != SUCCESS_PACK_RESULT) { free(data); abort(); }\n\n    // use data...\n    destroyPackReader(packReader);\n}\n```\n\n## Supported operating systems\n\n* Windows (10/11)\n* Ubuntu (22.04/24.04)\n* macOS (14/15)\n\nThis list includes only those systems on which functionality testing is conducted.\nHowever, you can also compile it under any other Linux distribution or operating system.\n\n## Build requirements\n\n* C99 compiler\n* C++17 compiler (optional)\n* [Git 2.30+](https://git-scm.com/)\n* [CMake 3.16+](https://cmake.org/)\n\nUse building [instructions](BUILDING.md) to install all required tools and libraries.\n\n### CMake options\n\n| Name                 | Description                 | Default value |\n|----------------------|-----------------------------|---------------|\n| PACK_BUILD_SHARED    | Build Pack shared library   | `ON`          |\n| PACK_BUILD_UTILITIES | Build Pack utility programs | `ON`          |\n| PACK_BUILD_TESTS     | Build Pack library tests    | `ON`          |\n\n### CMake targets\n\n| Name        | Description          | Windows | macOS    | Linux |\n|-------------|----------------------|---------|----------|-------|\n| pack-static | Static Pack library  | `.lib`  | `.a`     | `.a`  |\n| pack-shared | Dynamic Pack library | `.dll`  | `.dylib` | `.so` |\n| packer      | Packer executable    | `.exe`  |          |       |\n| unpacker    | Unpacker executable  | `.exe`  |          |       |\n| pack-info   | Pack info executable | `.exe`  |          |       |\n\n## Cloning\n\n```\ngit clone --recursive https://github.com/cfnptr/pack\n```\n\n## Building ![CI](https://github.com/cfnptr/pack/actions/workflows/cmake.yml/badge.svg)\n\n* Windows: ```./scripts/build-release.bat```\n* macOS / Ubuntu: ```./scripts/build-release.sh```\n\n## Utilities\n\n### packer\n\nCreates compressed data pack from files.\n\n* Usage: ```packer [-z, -v] \u003cpack-path\u003e \u003cfile-path-1\u003e \u003citem-path-1\u003e...```\n* Example: ```packer resources.pack C:/Users/user/Desktop/sky.png images/sky.png```\n* Arguments: [-z zipThreshold, -v dataVersion]\n\n### unpacker\n\nExtracts compressed data pack files.\n\n* Usage: ```unpacker \u003cpack-path\u003e```\n* Example: ```unpacker resources.pack```\n\n### pack-info\n\nShows pack file information.\n\n* Usage: ```pack-info \u003cpack-path\u003e```\n* Example: ```pack-info resources.pack```\n\n## Third-party\n\n* [mpio](https://github.com/cfnptr/mpio/) (Apache-2.0 License)\n* [zstd](https://github.com/facebook/zstd/) (BSD License)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfnptr%2Fpack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcfnptr%2Fpack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcfnptr%2Fpack/lists"}