From f26b60718163cfe454df368099ca1901acafc047 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 31 Jan 2022 19:16:55 +0100 Subject: avtomatski merge je bil. 0.0.20 prvi poskus --- src/main.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/main.c') 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 #include +#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 }; -- cgit v1.2.3