#include stdlib.h
#include io.h
#include "docedit.h"
void main()
{
int r_val = 0;
DOC_CONTEXT DocContext;
memset(&DocContext,0,sizeof(DOC_CONTEXT)); //clear context buffer
AddLine(&DocContext,"www.79cn.com");
AddLine(&DocContext,"I AM A LITTLE COW!");
AddLine(&DocContext,"BELL");
AddLine(&DocContext,"123");
AddLine(&DocContext,"hello");
AddLine(&DocContext,"test test test");
InsertLine(&DocContext,"here is the inserted text",3);
ModifyLine(&DocContext,"here is the modified text",5);
PrintfContext(&DocContext);
//save to file and then reload from file
r_val = SaveDocToFile(&DocContext,"d:\\doc.txt");
memset(&DocContext,0,sizeof(DOC_CONTEXT)); //clear context buffer
r_val = LoadDocFromFile(&DocContext,"d:\\doc.txt");
DeleteLine(&DocContext,4);
printf("i have delete line 4,please check it again.\n");
PrintfContext(&DocContext);
printf("%d 'test' was found in context.\n",GetStringCount(&DocContext,"test"));
printf("totol letter count:%d\n",GetLetterCount(&DocContext));
printf("totol digital count:%d\n",GetDigCount(&DocContext));
printf("totol space count:%d\n",GetSpaceCount(&DocContext));
printf("totol char count:%d\n",GetCharCount(&DocContext));
}
/*------------输出整篇文章内容-------------*/
/*
parameters