summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 32c7e96..f57e398 100644
--- a/src/main.c
+++ b/src/main.c
@@ -26,6 +26,32 @@
#endif
#include <lib.c>
#include <url.c>
+#define ABS(x) (((x) < 0) ? -(x) : (x))
+enum sc_return {
+ SC_BADCALL = -1, /* calling the function the wrong way, I could actually just crash */
+ SC_EMPTYRESPONSE = -2, /* something weird, do not retry */
+ SC_CAPTCHA = -3, /* engine responded with a CAPTCHA, redirect to a different server */
+ SC_NOIMGCLASS = -4, /* couldn't find image class name from definition, do not retry */
+ SC_NOCLASS = -5, /* couldn't find result class name from def, do not retry */
+ SC_NOHREF = -6 /* a result did not contain a href attribute */
+};
+const char * sc_return_str (enum sc_return r) {
+ switch (r) {
+ case SC_BADCALL:
+ return "SC_BADCALL";
+ case SC_EMPTYRESPONSE:
+ return "SC_EMPTYRESPONSE";
+ case SC_CAPTCHA:
+ return "SC_CAPTCHA";
+ case SC_NOIMGCLASS:
+ return "SC_NOIMGCLASS";
+ case SC_NOCLASS:
+ return "SC_NOCLASS";
+ case SC_NOHREF:
+ return "SC_NOHREF";
+ }
+ return "SC_BADRETURN";
+}
unsigned char sc_hp[] = { /* html page null terminated format string, from file src/hp.html */
#include <hp.xxd>
};