1 // relink.c (1190.bicyclesonthemoon.info/ongoing.png (old))
\r
2 // redirect to the latest frame
\r
5 // Copyright (C) 2015 Balthasar SzczepaĆski
\r
7 // This program is free software: you can redistribute it and/or modify
\r
8 // it under the terms of the GNU Affero General Public License as
\r
9 // published by the Free Software Foundation, either version 3 of the
\r
10 // License, or (at your option) any later version.
\r
12 // This program is distributed in the hope that it will be useful,
\r
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
15 // GNU Affero General Public License for more details.
\r
17 // You should have received a copy of the GNU Affero General Public License
\r
18 // along with this program. If not, see <http://www.gnu.org/licenses/>.
\r
20 #define ONG_STATE_PATH "/eizm/data/aftertime/bftf/ongstate"
\r
21 #define RELINK_PATH "/ongframe.png?f=%hu"
\r
28 int main (int argc, char *argv[])
\r
31 char relinkPath[256];
\r
32 unsigned short ongFrame;
\r
33 unsigned char ongState;
\r
37 file=fopen(ONG_STATE_PATH,"rt");
\r
40 fscanf(file,"%hhu %hu",&ongState,&ongFrame);
\r
51 file=fopen(ONG_STATE_PATH,"wt");
\r
54 fprintf(file,"2 %hu",ongFrame);
\r
59 sprintf(relinkPath,RELINK_PATH,(unsigned short)ongFrame);
\r
60 cgiRedirect(relinkPath);
\r