void url_purge(void);
void url_dump(void);
int url_count_inline(const char *line);
+int url_len_inline(const char *text);
#endif // !defined( URL_H )
return count;
}
+
+int url_len_inline(const char *text) {
+ int count = 0;
+ const char *i = text;
+
+ for (; *i; i++) {
+ if (*i == '\\') {
+ i++;
+ } else if ( *i == '[' && *(i+1) != ']') {
+ while (*i && *i != ']') i++;
+ i++;
+ if (*i == '(' && strchr(i, ')')) {
+ while (*i && *i != ')') {
+ count++;
+ i++;
+ }
+ }
+ }
+ }
+
+ return count;
+}
if (line && line->text && line->text->text)
lc += url_count_inline(line->text->text);
+ if (line && line->text && line->text->text)
+ line->length -= url_len_inline(line->text->text);
+
if(line->length > COLS) {
i = line->length;
offset = 0;