diff options
author | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-31 19:16:55 +0100 |
---|---|---|
committer | Anton Luka Šijanec <anton@sijanec.eu> | 2022-01-31 19:16:55 +0100 |
commit | f26b60718163cfe454df368099ca1901acafc047 (patch) | |
tree | 5446a485e682f281ee6b46e02ea41d397b05f186 /src/main.c | |
parent | unicode queries now work 0.0.19 (diff) | |
download | sear.c-f26b60718163cfe454df368099ca1901acafc047.tar sear.c-f26b60718163cfe454df368099ca1901acafc047.tar.gz sear.c-f26b60718163cfe454df368099ca1901acafc047.tar.bz2 sear.c-f26b60718163cfe454df368099ca1901acafc047.tar.lz sear.c-f26b60718163cfe454df368099ca1901acafc047.tar.xz sear.c-f26b60718163cfe454df368099ca1901acafc047.tar.zst sear.c-f26b60718163cfe454df368099ca1901acafc047.zip |
Diffstat (limited to '')
-rw-r--r-- | src/main.c | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -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> }; |