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/)
34 #include "online-core.h"
38 char *inpix, char *outpix,
39 uint_fast8_t a, uint_fast8_t b, uint_fast8_t c,
40 uint_fast8_t d, uint_fast8_t e, uint_fast8_t f
43 int main (int argc, char *argv[])
50 uint_fast8_t a, b, c, d, e, f;
58 make_tmp_path(in_tmp, 256, 0, "");
59 make_tmp_path(out_tmp, 256, 1, ".png");
63 r = get_file(cgi,"inpix2", in_tmp, &in_path);
65 r = get_file(cgi,"inpix", in_tmp, &in_path);
69 t = cgiGetValue(cgi, "a");
71 sscanf(t,"%"SCNuFAST8, &a);
75 t = cgiGetValue(cgi, "b");
77 sscanf(t,"%"SCNuFAST8, &b);
81 t = cgiGetValue(cgi, "c");
83 sscanf(t,"%"SCNuFAST8, &c);
87 t = cgiGetValue(cgi, "d");
89 sscanf(t,"%"SCNuFAST8, &d);
93 t = cgiGetValue(cgi, "e");
95 sscanf(t,"%"SCNuFAST8, &e);
99 t = cgiGetValue(cgi, "f");
101 sscanf(t,"%"SCNuFAST8, &f);
105 r = bluenh(in_path, out_tmp, a, b, c, d, e, f);
109 r1 = send_file(out_tmp, "image/png", 0);
113 r1 = send_data(nh, nh_size, "image/png", 500);
129 char *inpix, char *outpix,
130 uint_fast8_t a, uint_fast8_t b, uint_fast8_t c,
131 uint_fast8_t d, uint_fast8_t e, uint_fast8_t f
144 snprintf(s_a, 4, "%"PRIuFAST8, a);
145 snprintf(s_b, 4, "%"PRIuFAST8, b);
146 snprintf(s_c, 4, "%"PRIuFAST8, c);
147 snprintf(s_d, 4, "%"PRIuFAST8, d);
148 snprintf(s_e, 4, "%"PRIuFAST8, e);
149 snprintf(s_f, 4, "%"PRIuFAST8, f);
155 BLUENH_PATH, BLUENH_PATH,