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

Function builtinInitializeFormat

modules/io/common/builtinCommon.c:167–186  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

165}
166
167uint8_t builtinInitializeFormat(xsMachine *the, uint8_t format)
168{
169 xsSlot slot;
170
171 if (xsmcGet(slot, xsArg(0), xsID_format)) {
172 if (!xsmcTest(slot))
173 return format;
174
175 char *fmt = xsmcToString(slot);
176 uint8_t i;
177 for (i = 0; i < kIOFormatBufferDisposable; i++) {
178 if (!c_strcmp(gFormats[i], fmt))
179 return i + 1;
180 }
181
182 return kIOFormatInvalid;
183 }
184
185 return format;
186}
187
188// standard converstion to signed integer but disallows undefined
189int32_t builtinGetSignedInteger(xsMachine *the, xsSlot *slot)

Callers 15

xs_serial_constructorFunction · 0.85
xs_serial_constructorFunction · 0.85
xs_serial_constructorFunction · 0.85
xs_serial_constructorFunction · 0.85
xs_serial_constructorFunction · 0.85
spi.cFile · 0.85
xs_spi_constructorFunction · 0.85
xs_pwm_constructor_Function · 0.85
xs_pwm_constructor_Function · 0.85
xs_pwm_constructor_Function · 0.85
xs_pwm_constructor_Function · 0.85
xs_pwm_constructor_Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected