#include #include #include #include #include "stringex.h" bool str_begin (const char *a, const char *b) { return strncmp(a, b, strlen(b)) == 0; } char* str_split (char *str) { char *res; char *pch; pch = strtok(str, " <>"); while (pch != NULL) { if (str_begin(pch, "href=")) { char *pch2; pch2 = strtok(pch, "=\"'"); while (pch2 != NULL) { if (pch2 != "href") { res = pch2; } pch2 = strtok(NULL, "=\"'"); } } pch = strtok(NULL, " <>"); } return(res); }