Kiwi Engine
VM for interpreter
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
KEPath.h
Go to the documentation of this file.
1 
8 #ifndef KEPATH_H
9 #define KEPATH_H
10 
11 #include <Coconut/Coconut.h>
12 #include "KEObject.h"
13 #include "KEForwarders.h"
14 
16 struct KEPath {
20  struct CNList identifierList ;
22  struct KELineInfo * lineInfo ;
23 } ;
24 
31 struct KEPath *
32 KEAllocatePath(struct KELineInfo * linfo, struct CNResource * resource) ;
33 
38 static inline void
39 KERetainPath(struct KEPath * dst)
40 {
41  KERetainObject(&(dst->superClass)) ;
42 }
43 
48 static inline void
49 KEReleasePath(struct KEPath * dst)
50 {
51  KEReleaseObject(&(dst->superClass)) ;
52 }
53 
59 static inline struct CNResource *
60 KEResourceOfPath(struct KEPath * src)
61 {
62  return KEResourceOfObject(&(src->superClass)) ;
63 }
64 
70 static inline struct KELineInfo *
71 KELineInfoOfPath(struct KEPath * src)
72 {
73  return src->lineInfo ;
74 }
75 
81 static inline void
82 KEAppendIdentifierToPath(struct KEPath * dst, const struct CNFixedString * src)
83 {
84  CNAppendItemToList(&(dst->identifierList), (void *) src) ;
85 }
86 
92 static inline void
93 KEPrependIdentifierToPath(struct KEPath * dst, const struct CNFixedString * src)
94 {
95  CNPrependItemToList(&(dst->identifierList), (void *) src) ;
96 }
97 
105 CNBoolean
106 KEAddIdentifiersToPathWithString(struct KEPath * dst, struct CNString * pathstr) ;
107 
113 static inline size_t
114 KECountOfIdentifiersInPath(struct KEPath * src)
115 {
116  return CNCountOfItemsInList(&(src->identifierList)) ;
117 }
118 
124 static inline const struct CNListItem *
125 KEFirstItemInPath(const struct KEPath * src)
126 {
127  return CNFirstListItem(&(src->identifierList)) ;
128 }
129 
135 static inline const struct CNListItem *
136 KECentinelItemInPath(const struct KEPath * src)
137 {
138  return CNCentinelListItem(&(src->identifierList)) ;
139 }
140 
146 static inline struct CNList
147 KEMakeIdentifierListOfPath(struct KEPath * src)
148 {
149  return CNCopyList(&(src->identifierList)) ;
150 }
151 
159 struct KEPath *
160 KEAllocateTailPathInPath(struct KEPath * src) ;
161 
168 struct CNString *
169 KEPathToString(const struct KEPath * path, struct CNResource * resource) ;
170 
176 void
177 KEDumpPath(struct CNText * outbuf, const struct KEPath * src) ;
178 
184 void
185 KEPrintPath(FILE * outfp, const struct KEPath * src) ;
186 
187 #endif /* KEPATH_H */
KEProgram class.
Definition: KELineInfo.h:19
void KEDumpPath(struct CNText *outbuf, const struct KEPath *src)
Dump context of the path.
struct KELineInfo * lineInfo
Definition: KEPath.h:22
Define KEObject class.
struct KEObject superClass
Definition: KEPath.h:18
Definition: KEObject.h:42
struct KEPath * KEAllocateTailPathInPath(struct KEPath *src)
Allocate path by source path without 1st item.
struct KEPath * KEAllocatePath(struct KELineInfo *linfo, struct CNResource *resource)
Alloxate KEPath object.
struct CNList identifierList
Definition: KEPath.h:20
Forward declarations of the data type in KiwiEngine.
CNBoolean KEAddIdentifiersToPathWithString(struct KEPath *dst, struct CNString *pathstr)
Add multiple identities by the string which contains identifiers and commas.
struct CNString * KEPathToString(const struct KEPath *path, struct CNResource *resource)
Encode path to string.
void KEPrintPath(FILE *outfp, const struct KEPath *src)
Print context of the path.
Definition: KEPath.h:16