Find the next start-of-line marker at or after `from`. `bufStart` is the origin of the buffer, used to check "start of line" at position `from`.
| 96 | // Find the next start-of-line marker at or after `from`. `bufStart` is the |
| 97 | // origin of the buffer, used to check "start of line" at position `from`. |
| 98 | static char *fxBundleNextMarker(char *from, char *end, char *bufStart) |
| 99 | { |
| 100 | while (from < end) { |
| 101 | int atLineStart = (from == bufStart) || (from > bufStart && from[-1] == '\n'); |
| 102 | if (atLineStart && |
| 103 | (end - from) >= kBundleMarkerPrefixLen && |
| 104 | 0 == memcmp(from, kBundleMarkerPrefix, kBundleMarkerPrefixLen)) |
| 105 | return from; |
| 106 | char *nl = memchr(from, '\n', end - from); |
| 107 | if (!nl) |
| 108 | return end; |
| 109 | from = nl + 1; |
| 110 | } |
| 111 | return end; |
| 112 | } |
| 113 | |
| 114 | // Called from xst.c's fxLoadModule. Returns 1 if the module ID was found in |
| 115 | // the bundle map (and resolved), 0 to fall through to filesystem loading. |