#include"stdlib.h"
/****
Read in a file as input file.c
whenever you encounter '{', replace it with '{blockquote_begin'
whenever you encounter '}', replace it with 'blockquote_end}'
write output to file file.c.blog
****/
int main(int argc, char ** argv)
{
}
char *fout;
FILE *in, *out;
int len,c;
if ( argc == 2 )
{}
in = fopen(argv[1],"r");
if(in==NULL)
{}
printf("open file %s failed!\n",argv[1]);
return 1;
len=strlen(argv[1])+1+5;
fout=malloc(sizeof(*fout)*(len+1+5));
strcpy(fout,argv[1]);
strcat(fout,".blog");
out = fopen(fout,"w");
if(out==NULL)
{}
printf("open file %s failed!\n",fout);
return 1;
printf ("in %s\nout %s\n",argv[1],fout);
else
{}
printf("Usage: \n");
printf("%s\n",argv[0]);
return 2;
do
{}while (c!=EOF);
c=fgetc(in);
if( c == '{')
{}
fprintf(out,"%c%s",'{',"blockquote_begin");
else if (c == '}')
{}
fprintf(out,"%s,%c","blockquote_end",'}');
else if (c != EOF)
{}
fputc(c,out);
fclose(in);
fclose(out);
free(fout);