7月2-6号LNI文件解析
来源:互联网 发布:淘宝卖家分析 编辑:程序博客网 时间:2024/04/29 13:24
#include<iostream.h>
#include<fstream.h>
#include<string.h>
#include<malloc.h>
typedef struct Node
{
int libraryfilecount;
char libraryfile[10][50];
char linkerotheroption[100];
char cruntimefile[50];
char dllentry[50];
}Node;
typedef Node *NSNode;
void main()
{
char ch[50]="";
char dh[50]="";
char d[50]="";
char a[50]="";
int i=0,j=0,k=0,n=0,flag=0,flag1=0,flag2=0,flag3=0,m=0;
fstream rfile,rrfile, wfile;
rrfile.open("d:\\1\\c.txt",ios::in);
while(!rrfile.eof())
{
rrfile.getline(dh,30);
if(strstr(dh,"LibraryFileCount"))
{
while(dh[i]!='=')i++;
i++;
m=dh[i]-48;
cout<<"m="<<m<<endl;
}
}
rrfile.close();
rfile.open("e:\\Sample\\SAMPLE33.LNI",ios::in);
wfile.open("d:\\1\\c.txt",ios::app);
NSNode ns;
ns=(NSNode)malloc(sizeof(Node));
ns->libraryfilecount=m;
if(!wfile)
{
cout<<"cant open"<<endl;
}
wfile.put('\n');
//wfile.put('0');
//wfile.put('\n');
//wfile.write("hello!\n",10);
if(!rfile)
{
cout<<"mei you da kai cheng gong! "<<endl;
}
rfile.getline(ch,50);
for(n=0;n<5;n++)
{
i=0;k=0;
rfile.getline(ch,50);
while(ch[i]!='=')
{
a[k++]=ch[i++];
}
a[k]='\0';
cout<<a<<endl;
i=0;
while(ch[i]!='\0')
{
if(ch[i]=='='&&ch[i+1]!='\0')
{
if(flag==0)
{
wfile.put('\n');
wfile.write("[LinkerOptions]",20);
flag=1;
}
i++;j=0;
while(ch[i]!='\0')
{
d[j]=ch[i];
i++;
j++;
}
i--;
d[j++]='\0';
cout<<d<<endl;
if(!strcmp(a,"Option32"))
{
ns->libraryfilecount++;
strncpy(ns->libraryfile[0],d,j);
//ns->libraryfile[0][j++]='\0';
}
else if(!strcmp(a,"DebugType"))
{
flag1=1;
strncpy(ns->linkerotheroption,"LinkerOtherOptions=/DebugType:",strlen("LinkerOtherOptions=/DebugType:"));
ns->linkerotheroption[strlen("LinkerOtherOptions=/DebugType:")]='\0';
strncat(ns->linkerotheroption,d,j);
//cout<<d<<endl;
}
else if(!strcmp(a,"C Linkage File"))
{
flag2=1;
strncpy(ns->cruntimefile,"CRuntimeFile=",strlen("CRuntimeFile="));
ns->cruntimefile[strlen("CRuntimeFile=")]='\0';
strncat(ns->cruntimefile,d,j);
//cout<<d<<endl;
}
else if(!strcmp(a,"DllEntryObjecy"))
{
flag3=1;
strncpy(ns->dllentry,"DLLEntry=",strlen("DLLEntry="));
ns->dllentry[strlen("DLLEntry=")]='\0';
strncat(ns->dllentry,d,j);
}
else if(!strcmp(a,"Map"))
{
j=0;n=0;
if(strcmp(d,"No"))
{
while(d[j]!=',')j++;
j++;
while(d[j]!='\0')
d[n++]=d[j++];
d[n]='\0';
if(flag1==0)
{
strncpy(ns->linkerotheroption,"LinkerOtherOption=/MAP",strlen("LinkerOtherOption=/MAP"));
ns->linkerotheroption[strlen("LinkerOtherOption=/MAP")]='\0';
strncat(ns->linkerotheroption,d,j);
}
else
{
strncat(ns->linkerotheroption,";/MAP",strlen(";/MAP"));
strncat(ns->linkerotheroption,d,j);
}
}
}
else
{
}
}
// cout<<d<<endl;
i++;
}
}
wfile<<endl;
wfile<<"LibraryFileCount="<<ns->libraryfilecount<<endl;
wfile<<"libraryfile"<<ns->libraryfilecount<<"="<<ns->libraryfile[0]<<endl;
wfile<<ns->linkerotheroption<<endl;
wfile<<ns->cruntimefile<<endl;
wfile<<ns->dllentry<<endl;
wfile.close();
}
- 7月2-6号LNI文件解析
- 7月2-6号-rc文件的解析
- 7月2-6号
- 7月6号
- 2017月6月7月
- 7月2-6号-readblock
- 2月6号总结
- 6-29解析文件
- 解析TXT文件2
- 周2:6月7号完成指定任务
- 2004年6月7月记事
- 2009年6月-7月计划
- 缺失的6月、7月
- servlet之web.xml文件部分解析(2014年10月31日)
- 10月11号 iPhone开发 JSON解析
- 2010年6月SAT阅读真题及解析
- 7月23日--File类、流、XML解析
- 7月24日-----JSON解析、Date、Calender、集合框架
- 一款简易的页面加载进度显示条
- 工作就是这么简单——去哪儿网CTO吴永强
- php 调用linux命令权限问题解决
- 限制类被继承或者函数被重写
- ORA-12154解决方案1
- 7月2-6号LNI文件解析
- VC编程零散笔记集锦
- 為什麼需要 JVM?
- Spring的注解配置和XML配置的比较
- 大一纯粹的日子
- 配置secondarynamenode
- bridge
- Linux Crontab 定时任务 命令详解
- 俄罗斯方块88行 代码注释版 (三)