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

Function PiuCodeDictionary

modules/piu/PC/Code/piuCode.c:178–200  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176}
177
178void PiuCodeDictionary(xsMachine* the, void* it)
179{
180 PiuCode* self = it;
181 xsSlot* slot;
182 xsStringValue string;
183 if (!xsFindResult(xsArg(1), xsID_string))
184 xsResult = xsString("");
185 slot = PiuString(xsResult);
186 string = PiuToString(slot);
187 (*self)->string = slot;
188 (*self)->length = fxUnicodeLength(string, (xsIntegerValue*)&((*self)->size));
189 if (xsFindString(xsArg(1), xsID_type, &string)) {
190 if (!c_strcmp(string, "js"))
191 (*self)->type = 1;
192 else if (!c_strcmp(string, "json"))
193 (*self)->type = 2;
194 else if (!c_strcmp(string, "xml"))
195 (*self)->type = 3;
196 }
197 PiuCodeFormat(self);
198 PiuCodeSearch(self, (*self)->size);
199 PiuCodeSelect(self, 0, 0);
200}
201
202void PiuCodeIntersect(int32_t l1, int32_t r1, int32_t l2, int32_t r2, int32_t segments[6])
203{

Callers 1

PiuCode_createFunction · 0.85

Calls 4

fxUnicodeLengthFunction · 0.85
PiuCodeFormatFunction · 0.85
PiuCodeSearchFunction · 0.85
PiuCodeSelectFunction · 0.85

Tested by

no test coverage detected