The code is very simple:
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include "OCIMod.h"
extern char * Trim();
extern char * CompressByItem();
char *ModuleDir = "OCIModdir", *FileSuffix = ".ocimod";
int main (int argc, char **argv)
{
int i;
FILE *fp;
char *FileName, FinFileName[FileSize + 1],
Buf[MaxSize + 1];
if (argc < 2)
{
puts ("You have to enter OCI Module Procedure");
exit(False);
}
FileName = malloc((strlen(argv[1]) + 1) * sizeof(char));
strcpy(FileName,argv[1]);
sprintf(FinFileName,"%s\\%s%s%c",ModuleDir,FileName,FileSuffix,0);
if ((fp=fopen(FinFileName,"r")) == NULL)
{
puts("File Not Found");
exit(False);
}
i = 0;
while (!feof(fp))
{
fgets(Buf,MaxSize,fp);
if (feof(fp)) continue;
Trim(Buf,NULL);
CompressByItem(Buf," ",NULL);
printf("%03d - %s",i++,Buf);
}
fclose(fp);
return(True);
}
Trim() and CompressByItem are 2 Pelles C objects residing in the Library project.