cleanup warnings, meson build file

This commit is contained in:
roswold 2021-06-16 11:14:36 -05:00
parent 096bc32ed1
commit 5f5b18ab48
3 changed files with 20 additions and 7 deletions

12
meson.build Normal file
View File

@ -0,0 +1,12 @@
project('rcms', 'c',
version : '0.1',
default_options : ['warning_level=3'])
exe = executable('rcms',
'src/main.c',
'src/rcms.c',
'src/rss.c',
'src/str.c',
install : true)
test('basic', exe)

View File

@ -1,5 +1,5 @@
CC= cc
CFLAGS= -Wfatal-errors
CFLAGS= -Wfatal-errors -Wall
LDFLAGS= -s
OBJS= main.o str.o rcms.o rss.o

View File

@ -31,6 +31,8 @@ int print_file_mtim(char*fn)
localtime_r(&ts.tv_sec, &tm);
strftime(b,512,"%c",&tm);
printf("%s",b);
return 0;
}
void parse(char*fn,String str,Rss*rss)
@ -70,7 +72,7 @@ void parse(char*fn,String str,Rss*rss)
else if(strcmp(s,"h1")==0)
{
printf("<h1>");
while(s=strtok(NULL,del))printf("%s ",s);
while((s=strtok(NULL,del)))printf("%s ",s);
//printf("%s",strtok(NULL,del));
printf("</h1>");
}
@ -86,23 +88,23 @@ void parse(char*fn,String str,Rss*rss)
else if(strcmp(s,"img")==0)
{
printf("<img src=\"");
while(s=strtok(NULL,del))printf("%s ",s);
while((s=strtok(NULL,del)))printf("%s ",s);
printf("\"></img>");
}
// --- PAGE HASH ---
else if(strcmp(s,"hash")==0)
{
printf("<a name=\"%u\"></a>",hash_id);
printf("<a name=\"%lu\"></a>",hash_id);
++hash_id;
}
// --- BLOG ---
else if(strcmp(s,"blog")==0)
{
printf("<a name=\"%u\"></a>",hash_id);
printf("<a name=\"%lu\"></a>",hash_id);
++hash_id;
if(s=strtok(NULL,del))
if((s=strtok(NULL,del)))
output_blogfile_rss(rss,s);
else
fprintf(stderr,"error: could not open file '%s'\n",
@ -122,7 +124,6 @@ void outputfile(char*fn,FILE*in,Rss*rss)
{
char b=0;
char res=0;
char*string=NULL;
fread(&b,1,1,in);
res=fpeek(in);