Changeset 15709 for titan/plugins/stock/stock.h
- Timestamp:
- 05/14/12 20:45:22 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
titan/plugins/stock/stock.h
r15707 r15709 62 62 { 63 63 changetext(tmp, fileline); 64 changename(tmp, fileline); 64 65 if(name == NULL) 65 66 name = ostrcat(name, fileline, 1, 0); … … 170 171 171 172 name = readstock(getconfig("stockfile", NULL), stock, listbox); 173 addscreenrc(stock, listbox); 172 174 173 175 start: … … 244 246 } 245 247 246 addscreenrc(stock, listbox);247 248 drawscreen(stock, 0); 248 249 … … 260 261 if(name != NULL) 261 262 { 262 freestock(node); node = NULL; 263 goto start; 263 struct skin* tmp = addlistbox(stock, listbox, NULL, 1); 264 if(tmp != NULL) 265 { 266 changetext(tmp, location); 267 changename(tmp, location); 268 } 264 269 } 265 270 drawscreen(stock, 0); 266 continue; 271 if(name == NULL) 272 continue; 273 free(name); name = NULL; 267 274 } 275 276 if(rcret == getrcconfigint("rcyellow", NULL)) 277 { 278 writestock(getconfig("stockfile", listbox); 279 continue; 280 } 281 282 if(listbox->select != NULL && rcret == getrcconfigint("rcgreen", NULL)) 283 { 284 delscreennode(stock, listbox->select->name); 285 drawscreen(stock, 0); 286 } 268 287 269 288 if(rcret == getrcconfigint("rcgreen", NULL) && node->symbol_lookup_url != NULL) … … 302 321 } 303 322 323 int writestock(const char *filename, struct skin* listbox) 324 { 325 debug(1000, "in"); 326 FILE *fd = NULL; 327 struct skin* node = listbox; 328 int ret = 0; 329 330 fd = fopen(filename, "w"); 331 if(fd == NULL) 332 { 333 perr("can't open %s", filename); 334 return 1; 335 } 336 337 while(node != NULL) 338 { 339 if(node->del == 1) 340 { 341 ret = fprintf(fd, "%s\n", node->text); 342 if(ret < 0) 343 { 344 perr("writting file %s", filename); 345 } 346 } 347 node = node->next; 348 } 349 350 fclose(fd); 351 debug(1000, "out"); 352 return 0; 353 } 354 304 355 #endif
Note: See TracChangeset
for help on using the changeset viewer.