Lines Matching refs:objects
91 end = SIZE(objects); in init_objects()
94 let = objects[first].oc_olet; in init_objects()
96 while(last < end && objects[last].oc_olet == let in init_objects()
97 && objects[last].oc_name != NULL) in init_objects()
108 for(j = first; j < last; j++) sum += objects[j].oc_prob; in init_objects()
111 objects[j].oc_prob = (100+j-first)/(last-first); in init_objects()
117 if(objects[first].oc_descr != NULL && let != TOOL_SYM){ in init_objects()
119 while(last < end && objects[last].oc_olet == let) in init_objects()
124 tmp = objects[j].oc_descr; in init_objects()
125 objects[j].oc_descr = objects[i].oc_descr; in init_objects()
126 objects[i].oc_descr = tmp; in init_objects()
139 while((prob -= objects[i].oc_prob) >= 0) i++; in probtype()
140 if(objects[i].oc_olet != let || !objects[i].oc_name) in probtype()
154 objects[first+j].oc_prob = 0; in setgemprobs()
156 if(first >= LAST_GEM || first >= SIZE(objects) || in setgemprobs()
157 objects[first].oc_olet != GEM_SYM || in setgemprobs()
158 objects[first].oc_name == NULL) in setgemprobs()
162 objects[j].oc_prob = (20+j-first)/(LAST_GEM-first); in setgemprobs()
179 bwrite(fd, objects, sizeof objects); in savenames()
180 for(i=0; i < SIZE(objects); i++) { in savenames()
181 if(objects[i].oc_name) { in savenames()
182 len = strlen(objects[i].oc_name)+1; in savenames()
184 bwrite(fd, objects[i].oc_name, len); in savenames()
187 if(objects[i].oc_descr) { in savenames()
188 len = strlen(objects[i].oc_descr)+1; in savenames()
190 bwrite(fd, objects[i].oc_descr, len); in savenames()
193 if(objects[i].oc_uname) { in savenames()
194 len = strlen(objects[i].oc_uname)+1; in savenames()
196 bwrite(fd, objects[i].oc_uname, len); in savenames()
209 mread(fd, (char *) objects, sizeof objects); in restnames()
210 for(i=0; i < SIZE(objects); i++) { in restnames()
213 objects[i].oc_name = (char *) alloc(len); in restnames()
214 mread(fd, objects[i].oc_name, len); in restnames()
216 objects[i].oc_name = 0; in restnames()
219 objects[i].oc_descr = (char *) alloc(len); in restnames()
220 mread(fd, objects[i].oc_descr, len); in restnames()
222 objects[i].oc_descr = 0; in restnames()
225 objects[i].oc_uname = (char *) alloc(len); in restnames()
226 mread(fd, objects[i].oc_uname, len); in restnames()
228 objects[i].oc_uname = 0; in restnames()
240 end = SIZE(objects); in dodiscovered()
260 objects[i].oc_uname != NULL || in interesting_to_discover()
261 (objects[i].oc_name_known && objects[i].oc_descr != NULL) in interesting_to_discover()