Changeset 6424
- Timestamp:
- Feb 13, 2006, 9:27:46 AM (20 years ago)
- Location:
- trunk/Ohana
- Files:
-
- 1 deleted
- 13 edited
-
Makefile (modified) (1 diff)
-
src/addstar/include/2mass.h (modified) (1 diff)
-
src/addstar/src/get2mass.c (modified) (5 diffs)
-
src/addstar/src/get2mass_as.c (modified) (3 diffs)
-
src/addstar/src/get2mass_dr2.c (modified) (2 diffs)
-
src/delstar/Makefile (modified) (1 diff)
-
src/kapa/event/EventLoop.c (modified) (3 diffs)
-
src/kapa/graph/cursor.c (modified) (3 diffs)
-
src/kii/event/EventLoop.c (modified) (1 diff)
-
src/kii/picture/cursor.c (modified) (2 diffs)
-
src/opihi/dvo/.dvo (deleted)
-
src/opihi/lib.shell/expand_vars.c (modified) (1 diff)
-
src/opihi/lib.shell/string.c (modified) (3 diffs)
-
src/opihi/lib.shell/variable.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/Makefile
r5899 r6424 98 98 for i in $(PROGRAM); do make $$i.clean || exit; done 99 99 for i in $(EXTRAS); do make $$i.clean || exit; done 100 @rm -f `find . -name .mana` 101 @rm -f `find . -name .dvo` 100 102 101 103 dist: -
trunk/Ohana/src/addstar/include/2mass.h
r5443 r6424 10 10 11 11 SkyTable *get2mass_acc (SkyRegion *patch, char *path, char *accel); 12 Stars *get2mass_2DR_data (SkyRegion *region, SkyRegion *patch, int photcode, int *nstars);13 Stars *get2mass_AS_data (SkyRegion *region, SkyRegion *patch, int phocode, int *nstars);12 Stars *get2mass_2DR_data (SkyRegion *region, char *filename, SkyRegion *patch, int photcode, int *nstars); 13 Stars *get2mass_AS_data (SkyRegion *region, char *filename, SkyRegion *patch, int phocode, int *nstars); -
trunk/Ohana/src/addstar/src/get2mass.c
r5945 r6424 32 32 case 0: 33 33 // XXX put filename from table here 34 refcat = get2mass_AS_data (&sky[0].regions[i], patch, photcode, &Nrefcat);34 refcat = get2mass_AS_data (&sky[0].regions[i], sky[0].filename[i], patch, photcode, &Nrefcat); 35 35 if (VERBOSE) fprintf (stderr, "loaded %d stars from 2MASS (allsky)\n", Nrefcat); 36 36 break; 37 37 case 1: 38 refcat = get2mass_2DR_data (&sky[0].regions[i], patch, photcode, &Nrefcat);38 refcat = get2mass_2DR_data (&sky[0].regions[i], sky[0].filename[i], patch, photcode, &Nrefcat); 39 39 if (VERBOSE) fprintf (stderr, "loaded %d stars from 2MASS (dr2)\n", Nrefcat); 40 40 break; … … 57 57 58 58 int Nregions, NREGIONS; 59 char accelfile[1024], line[256], filename[128], datafile[256] ;59 char accelfile[1024], line[256], filename[128], datafile[256], **filenames; 60 60 FILE *f; 61 61 double Rs, Re, Ds, De; … … 71 71 NREGIONS = 200; 72 72 ALLOCATE (regions, SkyRegion, NREGIONS); 73 ALLOCATE (filenames, char *, NREGIONS); 73 74 74 75 /* read in stars line-by-line */ … … 84 85 if (Ds > patch[0].Dmax) continue; 85 86 if (De < patch[0].Dmin) continue; 86 sprintf (datafile, "%s/%s", path, filename);87 // XXX : put in table regions[Nregions].filename = (e_void) strcreate (datafile);88 87 regions[Nregions].Rmin = Rs; 89 88 regions[Nregions].Rmax = Re; 90 89 regions[Nregions].Dmin = Ds; 91 90 regions[Nregions].Dmax = De; 91 92 sprintf (datafile, "%s/%s", path, filename); 93 filenames[Nregions] = strcreate (datafile); 94 92 95 Nregions ++; 93 96 CHECK_REALLOCATE (regions, SkyRegion, NREGIONS, Nregions, 20); 97 CHECK_REALLOCATE (filenames, char *, NREGIONS, Nregions, 20); 94 98 } 95 99 fclose (f); … … 97 101 ALLOCATE (sky, SkyTable, 1); 98 102 sky[0].regions = regions; 103 sky[0].filename = filenames; 99 104 sky[0].Nregions = Nregions; 100 105 return (sky); -
trunk/Ohana/src/addstar/src/get2mass_as.c
r5945 r6424 13 13 e_time get2mass_time (char *ptr, char *buffer, int Nbound, int Nbyte); 14 14 15 Stars *get2mass_AS_data (SkyRegion *region, SkyRegion *patch, int photcode, int *nstars) {15 Stars *get2mass_AS_data (SkyRegion *region, char *filename, SkyRegion *patch, int photcode, int *nstars) { 16 16 17 17 int FilterSkip, TimeSkip; … … 20 20 gzFile gf; 21 21 char qc; 22 char *buffer , *filename;22 char *buffer; 23 23 char *p, *q, *ptr, *tmp; 24 24 double RA, DEC, M, dM; … … 55 55 if (!FilterSkip) Shutdown ("invalid photcode %s", GetPhotcodeNamebyCode(photcode)); 56 56 57 // filename = (char *) region[0].filename;58 57 gf = gzopen (filename, "rb"); 59 58 if (gf == NULL) Shutdown ("can't read 2mass data file: %s", filename); -
trunk/Ohana/src/addstar/src/get2mass_dr2.c
r5945 r6424 5 5 # define NLINE 30000 6 6 7 Stars *get2mass_2DR_data (SkyRegion *region, SkyRegion *patch, int photcode, int *nstars) {7 Stars *get2mass_2DR_data (SkyRegion *region, char *filename, SkyRegion *patch, int photcode, int *nstars) { 8 8 9 9 int i, Nstars, NSTARS, Nbyte, Nline; 10 10 Stars *stars; 11 11 gzFile gf; 12 char *buffer , *filename;12 char *buffer; 13 13 char line[303]; 14 14 double RA, DEC, J, H, K, dJ, dH, dK; … … 27 27 fprintf (stderr, "overlap: %f - %f, %f - %f\n", RA0, RA1, DEC0, DEC1); 28 28 29 // XXX get from args30 // filename = (char *) region[0].filename;31 29 gf = gzopen (filename, "rb"); 32 30 if (gf == NULL) Shutdown ("can't read 2mass data file: %s", filename); -
trunk/Ohana/src/delstar/Makefile
r5899 r6424 40 40 $(SRC)/check_permissions.$(ARCH).o \ 41 41 $(SRC)/Shutdown.$(ARCH).o 42 43 skip: 44 @echo "skipping delstar for now" 42 45 43 46 default: $(PROGRAM) -
trunk/Ohana/src/kapa/event/EventLoop.c
r5612 r6424 1 1 # include "Ximage.h" 2 2 3 # define IgnoreMask (long) (ButtonPressMask | ClientMessage | ButtonReleaseMask | KeyPressMask | PointerMotionMask) 3 /* # define IgnoreMask (long) (ButtonPressMask | ClientMessage | ButtonReleaseMask | KeyPressMask | PointerMotionMask) */ 4 5 /* list events being selected below, all other masks are ignored */ 6 # define IgnoreMask (long) (~(StructureNotifyMask | SubstructureNotifyMask | ExposureMask)) 4 7 5 8 int LastEvent (Display *display, int type, XEvent *event) { … … 33 36 34 37 if (XEventsQueued (graphic.display, QueuedAfterFlush) < 1) { 38 /* fprintf (stderr, "."); */ 35 39 usleep (50000); 36 40 continue; … … 54 58 /* remove those events we will ignore */ 55 59 while (XCheckMaskEvent (display, IgnoreMask, &event)) continue; 56 60 61 /* events to remove which have no mask component */ 62 while (XCheckTypedEvent (display, MappingNotify, &event)) continue; 63 while (XCheckTypedEvent (display, ClientMessage, &event)) continue; 64 while (XCheckTypedEvent (display, SelectionClear, &event)) continue; 65 while (XCheckTypedEvent (display, SelectionNotify, &event)) continue; 66 while (XCheckTypedEvent (display, SelectionRequest, &event)) continue; 57 67 } 58 68 return (status); 59 69 } 70 71 # if (0) 72 73 /* all masks from X.h for reference: */ 74 75 #define NoEventMask 0L 76 #define KeyPressMask (1L<<0) 77 #define KeyReleaseMask (1L<<1) 78 #define ButtonPressMask (1L<<2) 79 #define ButtonReleaseMask (1L<<3) 80 #define EnterWindowMask (1L<<4) 81 #define LeaveWindowMask (1L<<5) 82 #define PointerMotionMask (1L<<6) 83 #define PointerMotionHintMask (1L<<7) 84 #define Button1MotionMask (1L<<8) 85 #define Button2MotionMask (1L<<9) 86 #define Button3MotionMask (1L<<10) 87 #define Button4MotionMask (1L<<11) 88 #define Button5MotionMask (1L<<12) 89 #define ButtonMotionMask (1L<<13) 90 #define KeymapStateMask (1L<<14) 91 #define ExposureMask (1L<<15) 92 #define VisibilityChangeMask (1L<<16) 93 #define StructureNotifyMask (1L<<17) 94 #define ResizeRedirectMask (1L<<18) 95 #define SubstructureNotifyMask (1L<<19) 96 #define SubstructureRedirectMask (1L<<20) 97 #define FocusChangeMask (1L<<21) 98 #define PropertyChangeMask (1L<<22) 99 #define ColormapChangeMask (1L<<23) 100 #define OwnerGrabButtonMask (1L<<24) 101 102 /* all events from X.h for reference: */ 103 104 #define KeyPress 2 105 #define KeyRelease 3 106 #define ButtonPress 4 107 #define ButtonRelease 5 108 #define MotionNotify 6 109 #define EnterNotify 7 110 #define LeaveNotify 8 111 #define FocusIn 9 112 #define FocusOut 10 113 #define KeymapNotify 11 114 #define Expose 12 115 #define GraphicsExpose 13 116 #define NoExpose 14 117 #define VisibilityNotify 15 118 #define CreateNotify 16 119 #define DestroyNotify 17 120 #define UnmapNotify 18 121 #define MapNotify 19 122 #define MapRequest 20 123 #define ReparentNotify 21 124 #define ConfigureNotify 22 125 #define ConfigureRequest 23 126 #define GravityNotify 24 127 #define ResizeRequest 25 128 #define CirculateNotify 26 129 #define CirculateRequest 27 130 #define PropertyNotify 28 131 #define SelectionClear 29 132 #define SelectionRequest 30 133 #define SelectionNotify 31 134 #define ColormapNotify 32 135 #define ClientMessage 33 136 #define MappingNotify 34 137 #define LASTEvent 35 /* must be bigger than any event # */ 138 139 # endif -
trunk/Ohana/src/kapa/graph/cursor.c
r5354 r6424 1 1 # include "Ximage.h" 2 2 3 # define IgnoreMask (long) (ClientMessage | ButtonReleaseMask | PointerMotionMask) 3 /* # define IgnoreMask (long) (ClientMessage | ButtonReleaseMask | PointerMotionMask) */ 4 # define IgnoreMask (long) (~(StructureNotifyMask | SubstructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask)) 4 5 5 6 int LastEvent (Display *display, int type, XEvent *event); … … 36 37 37 38 events: 38 if (XEventsQueued (graphic.display, QueuedAfterFlush) < 1){ 39 if (XEventsQueued (graphic.display, QueuedAfterFlush) < 1) { 40 fprintf (stderr, "."); 39 41 usleep (50000); 40 42 continue; … … 98 100 /* remove those events we will ignore */ 99 101 while (XCheckMaskEvent (display, IgnoreMask, &event)) continue; 102 103 /* events to remove which have no mask component */ 104 while (XCheckTypedEvent (display, ClientMessage, &event)) continue; 105 while (XCheckTypedEvent (display, SelectionClear, &event)) continue; 106 while (XCheckTypedEvent (display, SelectionNotify, &event)) continue; 107 while (XCheckTypedEvent (display, SelectionRequest, &event)) continue; 100 108 } 101 109 return (FALSE); -
trunk/Ohana/src/kii/event/EventLoop.c
r5637 r6424 1 1 # include "Ximage.h" 2 2 3 # define IgnoreMask (long) (ClientMessage | ButtonReleaseMask) 3 /* # define IgnoreMask (long) (ClientMessage | ButtonReleaseMask) */ 4 # define IgnoreMask (long) (~(StructureNotifyMask | SubstructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | PointerMotionMask)) 4 5 5 6 int LastEvent (Display *display, int type, XEvent *event) { -
trunk/Ohana/src/kii/picture/cursor.c
r5349 r6424 1 1 # include "Ximage.h" 2 3 # define IgnoreMask (long) (~(StructureNotifyMask | SubstructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | PointerMotionMask)) 2 4 3 5 int LastEvent (Display *display, int type, XEvent *event); … … 66 68 write (layout[0].Ximage, line, 40); 67 69 } 70 71 /* remove those events we will ignore */ 72 while (XCheckMaskEvent (display, IgnoreMask, &event)) continue; 68 73 } 69 74 return (FALSE); -
trunk/Ohana/src/opihi/lib.shell/expand_vars.c
r3922 r6424 71 71 *N = *Val; /* place the value of the variable in the newline */ 72 72 } 73 N--; /* we overshoot on last loop */ 73 74 74 for (N--,L++; ISVAR(*L); L++); 75 L--; 75 /* skip past the variable in the source line */ 76 /* L currently points at $ */ 77 L++; 78 if (*L == '?') L++; /* skip past ? in $?name */ 79 80 while (ISVAR(*L)) L++; 81 L--; /* we overshoot */ 76 82 77 83 if (V0 != NULL) free (V0); -
trunk/Ohana/src/opihi/lib.shell/string.c
r2598 r6424 94 94 char *thisvar (char *string) { 95 95 96 int i ;96 int i, start; 97 97 char *word; 98 98 … … 100 100 if (string[0] != '$') return ((char *) NULL); 101 101 102 for (i = 1; ISVAR(string[i]); i++); 103 if (i == 1) return ((char *) NULL); 104 102 /* special case $?name : check that name is valid */ 103 start = 1; 104 if (string[1] == '?') start = 2; 105 106 for (i = start; ISVAR(string[i]); i++); 107 if (i == start) return ((char *) NULL); 108 109 /* the ? is part of the variable */ 105 110 word = strncreate (&string[1], i - 1); 106 111 return (word); … … 207 212 char *aftervar (char *string) { 208 213 209 int i, j ;214 int i, j, start; 210 215 211 216 if (string == (char *) NULL) return ((char *) NULL); 212 217 if (string[0] != '$') return ((char *) NULL); 213 218 214 for (i = 1; ISVAR(string[i]); i++); 215 if (i == 1) return ((char *) NULL); 219 /* special case: $?name : test only name */ 220 start = 1; 221 if (string[1] == '?') start = 2; 222 223 for (i = start; ISVAR(string[i]); i++); 224 if (i == start) return ((char *) NULL); 216 225 217 226 for (j = i; whitespace (string[j]); j++); -
trunk/Ohana/src/opihi/lib.shell/variable.c
r6327 r6424 103 103 104 104 int i; 105 char *local, *MacroName ;105 char *local, *MacroName, *value; 106 106 107 107 if (name == NULL) return (NULL); … … 111 111 /* return a string which should not be freed */ 112 112 if (*name == '?') { 113 value = get_variable_ptr ( name[1]);113 value = get_variable_ptr (&name[1]); 114 114 if (value == NULL) { 115 115 return variable_false; … … 152 152 /* return a string which can be freed */ 153 153 if (*name == '?') { 154 value = get_variable_ptr ( name[1]);154 value = get_variable_ptr (&name[1]); 155 155 if (value == NULL) { 156 156 value = strcreate (variable_false);
Note:
See TracChangeset
for help on using the changeset viewer.
