MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / PiuLocals_set_language

Function PiuLocals_set_language

modules/piu/All/piuLocals.c:120–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

118}
119
120void PiuLocals_set_language(xsMachine* the)
121{
122 PiuLocals* self = PIU(Locals, xsThis);
123 char path[mxLocalsNameSize + 1 + mxLocalsLanguageSize + 4 + 1];
124 size_t size;
125 xsStringValue string = xsToString(xsArg(0));
126 if (c_strlen(string) > mxLocalsLanguageSize - 1)
127 xsRangeError("locals language too long: %s", string);
128 c_strcpy((*self)->language, string);
129 c_strcpy(path, (*self)->name);
130 c_strcat(path, ".");
131 c_strcat(path, (*self)->language);
132 c_strcat(path, ".mhr");
133 (*self)->results = (int32_t *)fxGetResource(the, NULL, path, &size);
134 if (!(*self)->results)
135 xsURIError("locals language not found: %s", path);
136}
137
138void PiuLocals_get(xsMachine* the)
139{

Callers

nothing calls this directly

Calls 1

fxGetResourceFunction · 0.85

Tested by

no test coverage detected