Changeset 5852 for trunk/Ohana/src/kapa/graph/LoadObject.c
- Timestamp:
- Dec 27, 2005, 3:23:01 PM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/kapa/graph/LoadObject.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/kapa/graph/LoadObject.c
r5612 r5852 1 1 # include "Ximage.h" 2 # include <unistd.h>3 2 # include <errno.h> 4 5 # define SCAN \6 status = read (sock, buffer, 16); \7 buffer[16] = 0; \8 sscanf (buffer, "%*s %d", &Nbytes); \9 status = read (sock, buffer, Nbytes); \10 buffer[status] = 0;11 3 12 4 int LoadObject () { 13 5 14 char buffer[1024]; 15 int status, N, Nbytes; 6 int N; 16 7 Layout *layout; 17 8 … … 27 18 layout[0].objects[N].dym = layout[0].objects[N].dyp = (float *) NULL; 28 19 29 SCAN; 30 sscanf (buffer, "%d %d %d %d %d %d %d %lf %lf", 31 &layout[0].objects[N].Npts, &layout[0].objects[N].style, 32 &layout[0].objects[N].ptype, &layout[0].objects[N].ltype, 33 &layout[0].objects[N].etype, &layout[0].objects[N].ebar, 34 &layout[0].objects[N].color, 35 &layout[0].objects[N].lweight, &layout[0].objects[N].size); 20 KiiScanMessage (sock, "%d %d %d %d %d %d %d %lf %lf", 21 &layout[0].objects[N].Npts, &layout[0].objects[N].style, 22 &layout[0].objects[N].ptype, &layout[0].objects[N].ltype, 23 &layout[0].objects[N].etype, &layout[0].objects[N].ebar, 24 &layout[0].objects[N].color, 25 &layout[0].objects[N].lweight, &layout[0].objects[N].size); 36 26 37 27 if (DEBUG) fprintf (stderr, "%d %d %d %d %d %d %d %lf %lf\n", 38 layout[0].objects[N].Npts, layout[0].objects[N].style,39 layout[0].objects[N].ptype, layout[0].objects[N].ltype,40 layout[0].objects[N].etype, layout[0].objects[N].ebar,41 layout[0].objects[N].color,42 layout[0].objects[N].lweight, layout[0].objects[N].size);28 layout[0].objects[N].Npts, layout[0].objects[N].style, 29 layout[0].objects[N].ptype, layout[0].objects[N].ltype, 30 layout[0].objects[N].etype, layout[0].objects[N].ebar, 31 layout[0].objects[N].color, 32 layout[0].objects[N].lweight, layout[0].objects[N].size); 43 33 44 34 /* force valid ranges */ 45 if ((layout[0].objects[N].color > GetColormapSize()) || (layout[0].objects[N].color < 0))35 if ((layout[0].objects[N].color > KapaColormapSize()) || (layout[0].objects[N].color < 0)) 46 36 layout[0].objects[N].color = 0; 47 37 48 SCAN; 49 sscanf (buffer, "%lf %lf %lf %lf", 50 &layout[0].objects[N].x0, &layout[0].objects[N].x1, 51 &layout[0].objects[N].y0, &layout[0].objects[N].y1); 38 KiiScanMessage (sock, "%lf %lf %lf %lf", 39 &layout[0].objects[N].x0, &layout[0].objects[N].x1, 40 &layout[0].objects[N].y0, &layout[0].objects[N].y1); 52 41 53 42 fcntl (sock, F_SETFL, O_NONBLOCK);
Note:
See TracChangeset
for help on using the changeset viewer.
