Lizard is a markup language and a tool for parsing Lizard markup into html.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

41 lines
569 B

#include <stdio.h>
#include <stdlib.h>
#include "parser.h"
int main( int argc, char ** argv ) {
FILE *fp;
if ( argc > 1 ) {
fp = fopen ( argv[ 1 ], "r" );
if ( fp == NULL ) {
perror( "Unable to open file:" );
perror( argv[ 1 ] );
return -1;
}
fseek( fp, 0, SEEK_END );
long fsize = ftell( fp );
rewind( fp );
char *str = malloc(fsize + 1);
if ( str == NULL ) {
perror( "Error assigning memory." );
return -1;
}
fread( str, 1, fsize, fp );
const char * out = parse( str );
fclose( fp );
printf( out );
}
}