version 1.2, 2003/11/24 02:13:40 |
version 1.4, 2003/11/24 08:16:13 |
|
|
/* $OpenXM: OpenXM/src/kan96xx/Kan/Kclass/tree.c,v 1.1 2003/11/21 02:10:37 takayama Exp $ */ |
/* $OpenXM: OpenXM/src/kan96xx/Kan/Kclass/tree.c,v 1.3 2003/11/24 06:50:16 takayama Exp $ */ |
#include <stdio.h> |
#include <stdio.h> |
#include "../datatype.h" |
#include "../datatype.h" |
#include "../stackm.h" |
#include "../stackm.h" |
Line 112 struct object addTree(struct object ob1, struct object |
|
Line 112 struct object addTree(struct object ob1, struct object |
|
struct object KtreeGetDocumentElement(struct object to) { |
struct object KtreeGetDocumentElement(struct object to) { |
struct object rob; |
struct object rob; |
struct object ob; |
struct object ob; |
rob = NullObject; |
if (to.tag != Sclass) errorKan1("%s\n","KtreeGetDocumentElement"); |
if (to.tag != Sclass) return rob; |
if (ectag(to) != CLASSNAME_tree) errorKan1("%s\n","KtreeGetDocumentElement"); |
if (ectag(to) != CLASSNAME_tree) return rob; |
|
ob = KopTree(to); |
ob = KopTree(to); |
return getoa(ob,0); |
if (ob.tag != Sarray) errorKan1("%s\n","KtreeGetDocumentElement: not an array."); |
|
if (getoaSize(ob) != 3) errorKan1("%s\n","KtreeGetDocumentElement: array is broken."); |
|
ob=getoa(ob,0); |
|
if (ob.tag != Sdollar) errorKan1("%s\n","KtreeGetDocumentElement: element must be a string"); |
|
return ob; |
} |
} |
|
|
struct object KtreeGetAttributes(struct object to) { |
struct object KtreeGetAttributes(struct object to) { |
struct object rob; |
struct object rob; |
struct object ob; |
struct object ob; |
rob = NullObject; |
if (to.tag != Sclass) errorKan1("%s\n","KtreeGetAttributes:"); |
if (to.tag != Sclass) return rob; |
if (ectag(to) != CLASSNAME_tree) errorKan1("%s\n","KtreeGetAttributes:"); |
if (ectag(to) != CLASSNAME_tree) return rob; |
|
ob = KopTree(to); |
ob = KopTree(to); |
|
if (ob.tag != Sarray) errorKan1("%s\n","KtreeGetAttributes: not an array."); |
|
if (getoaSize(ob) != 3) errorKan1("%s\n","KtreeGetAttributes: array is broken."); |
return getoa(ob,1); |
return getoa(ob,1); |
} |
} |
|
|
struct object KtreeGetChildNodes(struct object to) { |
struct object KtreeGetChildNodes(struct object to) { |
struct object rob; |
struct object rob; |
struct object ob; |
struct object ob; |
rob = NullObject; |
if (to.tag != Sclass) errorKan1("%s\n","KtreeGetChildNodes:"); |
if (to.tag != Sclass) return rob; |
if (ectag(to) != CLASSNAME_tree) errorKan1("%s\n","KtreeGetChildNodes:"); |
if (ectag(to) != CLASSNAME_tree) return rob; |
|
ob = KopTree(to); |
ob = KopTree(to); |
|
if (ob.tag != Sarray) errorKan1("%s\n","KtreeGetChildNodes: not an array."); |
|
if (getoaSize(ob) != 3) errorKan1("%s\n","KtreeGetChildNodes: array is broken."); |
return getoa(ob,2); |
return getoa(ob,2); |
} |
} |
|
|
struct object KtreeCreateElement(struct object ostr) { |
struct object KtreeCreateElement(struct object ostr) { |
struct object ob; |
struct object ob; |
ob = NullObject; |
if (ostr.tag != Sdollar) errorKan1("%s\n","KtreeCreateElement: not a string."); |
if (ostr.tag != Sdollar) return NullObject; |
|
ob = newObjectArray(3); |
ob = newObjectArray(3); |
getoa(ob,0)=ostr; |
getoa(ob,0)=ostr; |
getoa(ob,1) = newObjectArray(0); |
getoa(ob,1) = newObjectArray(0); |