diff options
Diffstat (limited to 'ws2a/bugsdata.c')
| -rw-r--r-- | ws2a/bugsdata.c | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/ws2a/bugsdata.c b/ws2a/bugsdata.c deleted file mode 100644 index 0370147..0000000 --- a/ws2a/bugsdata.c +++ /dev/null @@ -1,78 +0,0 @@ -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <stdint.h> - -int main(){ - printf("%s%c%c\n", - "Content-Type:text/html;charset=iso-8859-1",13,10); - FILE* lastfilenum; - lastfilenum = fopen("../ws2a/bugs/lastbug","r"); - if(lastfilenum == NULL){ - printf("Error reteriveing bugs, contact the admin!"); - return 1; - } - long long last = 0; - fscanf(lastfilenum,"%lld",&last); - fclose(lastfilenum); - long long end = last-20; - - while(last > end && last > 0){ - char filestring[64] = "../ws2a/bugs/"; - char filename[10]; - sprintf(filename,"%lld",last); - strcat(filestring,filename); - FILE* thisbug; - thisbug = fopen(filestring,"r"); - if(thisbug == NULL){ - printf("Error opening bug:%s\n",filestring); - printf("<br/>"); - last--; - continue; - } - printbug(thisbug); - printf("%lld\n",last); - fclose(thisbug); - last--; - } - - return 0; -} -/*Prints bugs, format: - Submitter\n - SubmitterID - Date_submitted\n - Short Description\n - Status<Unassigned, Assigned, Closed>\n - numcomments\n - bugid -*/ -void printbug(FILE* f){ - - int line = 0; - char tchar = ' '; - while((tchar = fgetc(f)) && tchar != EOF){ - if(tchar == '\n') - line++; - if(line > 4) - break; - putchar(tchar); - } - - unsigned int comments = 0; - while (EOF != (fscanf(f,"%*[^\n]"), fscanf(f,"%*c"))) - ++comments; - printf("\n%u\n",(comments-1)/4); -} - -/* -function htmlEscape(str) { - return String(str) - .replace(/&/g, '&') - .replace(/"/g, '"') - .replace(/'/g, ''') - .replace(/</g, '<') - .replace(/>/g, '>') - .replace(/\//g, '/'); -} -*/ |
