我是用C语言写的程序.
struct resbuf *rb2,*rb1;
rb1=ads_buildlist(RTSTR,"APA-01",0);
rb2=ads_entgetx(ent,rb1);
assoc_dxf_str(rb1,1000,sTemp);
... ...
上边assoc-dxf_str函是检索数据链表的.详细如下
------ 缓冲链表操作函数 5.链表检索(字符型) -------------- */ int assoc_dxf_str(struct resbuf *rb,int dxf_code,char *result) { struct resbuf *rb1; if (dxf_type(dxf_code)!=RTSTR) return RTERROR; if (rb==NULL) return RTERROR; for (rb1=rb;rb1!=NULL;rb1=rb1->rbnext) { if (rb1->restype==dxf_code) { strcpy(result,rb1->resval.rstring); return RTNORM; } } return RTERROR; }
/***************************************************************************/
------ 缓冲链表操作函数 1.节点类型 */ int dxf_type(int dxf_code) { if (dxf_code>=1000) dxf_code=dxf_code-1000; if (dxf_code<0) return dxf_code; if (dxf_code>=0 && dxf_code<=9) return RTSTR; if (dxf_code>=10 && dxf_code<=19) return RTPOINT; if (dxf_code>=38 && dxf_code<=59) return RTREAL; if (dxf_code>=60 && dxf_code<=79) return RTSHORT; if (dxf_code>=210 && dxf_code<=239) return RT3DPOINT; return RTNONE; }
|