{"id":23077990,"url":"https://github.com/jaliborc/c_everywhere","last_synced_at":"2025-06-24T20:09:59.080Z","repository":{"id":64457847,"uuid":"570558279","full_name":"Jaliborc/C_Everywhere","owner":"Jaliborc","description":"JIT converts WoW API depending on client version","archived":false,"fork":false,"pushed_at":"2025-04-17T18:28:04.000Z","size":33,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T08:42:56.509Z","etag":null,"topics":["jit","library","lua","world-of-warcraft"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/Jaliborc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"patreon":"jaliborc","custom":"paypal.me/jaliborc"}},"created_at":"2022-11-25T13:33:59.000Z","updated_at":"2025-04-17T18:28:08.000Z","dependencies_parsed_at":"2024-08-14T12:27:14.999Z","dependency_job_id":"150fa08d-767f-47e7-9b8d-c592a61ed24b","html_url":"https://github.com/Jaliborc/C_Everywhere","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Jaliborc/C_Everywhere","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaliborc%2FC_Everywhere","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaliborc%2FC_Everywhere/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaliborc%2FC_Everywhere/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaliborc%2FC_Everywhere/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jaliborc","download_url":"https://codeload.github.com/Jaliborc/C_Everywhere/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jaliborc%2FC_Everywhere/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261749221,"owners_count":23203990,"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":["jit","library","lua","world-of-warcraft"],"created_at":"2024-12-16T10:45:59.235Z","updated_at":"2025-06-24T20:09:59.045Z","avatar_url":"https://github.com/Jaliborc.png","language":"Lua","funding_links":["https://patreon.com/jaliborc","paypal.me/jaliborc","https://www.patreon.com/jaliborc","https://www.paypal.me/jaliborc"],"categories":[],"sub_categories":[],"readme":"# C_Everywhere :stars:\n[![Patreon](http://img.shields.io/badge/news%20\u0026%20rewards-patreon-ff4d42)](https://www.patreon.com/jaliborc)\n[![Paypal](http://img.shields.io/badge/donate-paypal-1d3fe5)](https://www.paypal.me/jaliborc)\n[![Discord](http://img.shields.io/badge/discuss-discord-5865F2)](https://bit.ly/discord-jaliborc)\n\nA JIT library that simplifies developing World of Wacraft addons which support multiple client versions. Code for latest expansion, run everywhere.\n\n## Overview\nSince Blizzard started refactoring the game's API, but only on it's retail servers, supporting the multiple clients often results in a choice between duplicated or unneficient code (so much spaghetti :spaghetti:!), even when using version-dependent code compilers.\n\nHere is an implementation for printing link and quantity of the first 3 tracked currencies, running on both Dragonflight and Wrath of the Lich King:\n\n```lua\nfor i = 0, 3 do\n    local id, quantity\n    if LE_EXPANSION_LEVEL_CURRENT \u003e= LE_EXPANSION_DRAGONFLIGHT then\n        local data = C_CurrencyInfo.GetBackpackCurrencyInfo(i)\n        if data then\n            id = data.currencyTypesID\n            quantity = data.quantity\n        end\n    else\n        local _, count, _, typeID = GetBackpackCurrencyInfo(i)\n        id, quantity = typeID, count\n    end\n\n    local link = C_CurrencyInfo and C_CurrencyInfo.GetCurrencyLink and C_CurrencyInfo.GetCurrencyLink(id) or GetCurrencyLink(id)\n    print(link, quantity)\nend\n```\n\nC_Everywhere takes all that clutter away while ensuring efficient implementation:\n\n```lua\nlocal C = LibStub('C_Everywhere')\n\nfor i = 0, 3 do\n    local data = C.CurrencyInfo.GetBackpackCurrencyInfo(i)\n    if data then\n        print(C.CurrencyInfo.GetCurrencyLink(data.currencyTypesID), data.quantity)\n    end\nend\n```\n\nIt does so by lazily just-in-time building namespaces and compiling lua functions optimized for the current client.\n## Advanced\nAs shown, when a namesapce `C.Some_Namespace` is requested, C_Everywhere returns a virtual namespace that abstracts the process of finding and optimizing APIs. These virtual namespaces also provide some extra functions:\n\n Function | Description | Input | Return\n -------- | ----------- | ----- | ------- \n.rawfind(api) | Forces a search for the requested API, without using any of the other features or optimizations. | string | function\n.locate(api) | Returns the real namespace in which the API can be found. | string | table\n.hooksecurefunc(api, call) | Shorthand, equivalent to `hooksecurefunc(.locate(api), api, call)` | string, function | nil\n\n:bulb: If I missed implementing output packing into structured code for a function you require, please submit a pull request. It only takes a single line of code to implement in the source code. Here is `GetBackpackCurrencyInfo` implementation:\n\n```lua\npack(C.CurrencyInfo, 'GetBackpackCurrencyInfo', 'name, quantity, iconFileID, currencyTypesID')\n```\n\n## Limitations \n**C_Everywhere** is not a virtual machine. It only handles three forms of refactoring:\n- API moving namespaces.\n- API moving from frame type to a namespace.\n- Change of output from a variable list to a single structured (table) variable.  \n\nIt cannot implement APIs that don't have a direct equivalent in the current client. It also does not handle discrepancies to input arguments.  \n\n## :warning: Reminder!\nIf you use this library, please list it as one of your dependencies in the CurseForge admin system. It's a big help! :+1:","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaliborc%2Fc_everywhere","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaliborc%2Fc_everywhere","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaliborc%2Fc_everywhere/lists"}