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

Function fx_parseURLHost

modules/data/url/url.c:909–921  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

907}
908
909txBoolean fx_parseURLHost(txMachine* the, txStringStream* src, txInteger from, txInteger to, txStringStream* dst, txBoolean special)
910{
911 txString p = src->slot->value.string;
912 if ((to - from > 1) && (p[from] == '[') && (p[to - 1] == ']')) {
913 return fx_parseURLHostIPv6( the, src, from + 1, to - 1, dst);
914 }
915 if (special) {
916 if (fx_parseURLHostSpecial(the, src, from, to, dst))
917 return fx_parseURLHostIPv4(the, src, from, to, dst);
918 return 0;
919 }
920 return fx_parseURLHostNotSpecial(the, src, from, to, dst);
921}
922
923txBoolean fx_parseURLHostIPv4(txMachine* the, txStringStream* src, txInteger from, txInteger to, txStringStream* dst)
924{

Callers 1

fx_parseURLFunction · 0.85

Calls 4

fx_parseURLHostIPv6Function · 0.85
fx_parseURLHostSpecialFunction · 0.85
fx_parseURLHostIPv4Function · 0.85

Tested by

no test coverage detected