2 bluenh-cgi.c is autogenerated from bluenh-cgi.1.c
3 Online interface for npb
6 Copyright (C) 2013, 2014, 2022 Balthasar SzczepaĆski
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU Affero General Public License as
10 published by the Free Software Foundation, either version 3 of the
11 License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU Affero General Public License for more details.
18 You should have received a copy of the GNU Affero General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
21 Requires cgilib (http://www.infodrom.org/projects/cgilib/)
32 #include "online-core.h"
35 int bluenh (char *inpix, char *outpix, unsigned a, unsigned b, unsigned c, unsigned d, unsigned e, unsigned f);
37 int main (int argc, char *argv[])
44 unsigned a, b, c, d, e, f;
52 make_tmp_path(in_tmp, 256, 0, "");
53 make_tmp_path(out_tmp, 256, 1, ".png");
57 r = get_file(cgi,"inpix", in_tmp, &in_path);
61 t = cgiGetValue(cgi, "a");
67 t = cgiGetValue(cgi, "b");
73 t = cgiGetValue(cgi, "c");
79 t = cgiGetValue(cgi, "d");
85 t = cgiGetValue(cgi, "e");
91 t = cgiGetValue(cgi, "f");
97 r = bluenh(in_path, out_tmp, a, b, c, d, e, f);
101 r1 = send_file(out_tmp, "image/png", 0);
105 r1 = send_data(nh, nh_size, "image/png", 500);
120 int bluenh (char *inpix, char *outpix, unsigned a, unsigned b, unsigned c, unsigned d, unsigned e, unsigned f)
132 snprintf(ca, 4, "%u", a);
133 snprintf(cb, 4, "%u", b);
134 snprintf(cc, 4, "%u", c);
135 snprintf(cd, 4, "%u", d);
136 snprintf(ce, 4, "%u", e);
137 snprintf(cf, 4, "%u", f);
142 r = execl(BLUENH_PATH, BLUENH_PATH, inpix, outpix, ca, cb, cc, cd, ce, cf, (char *)0);