IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 6424


Ignore:
Timestamp:
Feb 13, 2006, 9:27:46 AM (20 years ago)
Author:
eugene
Message:

various minor fixes

Location:
trunk/Ohana
Files:
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/Makefile

    r5899 r6424  
    9898        for i in $(PROGRAM); do make $$i.clean || exit; done
    9999        for i in $(EXTRAS); do make $$i.clean || exit; done
     100        @rm -f `find . -name .mana`
     101        @rm -f `find . -name .dvo`
    100102
    101103dist:
  • trunk/Ohana/src/addstar/include/2mass.h

    r5443 r6424  
    1010
    1111SkyTable *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);
     12Stars *get2mass_2DR_data (SkyRegion *region, char *filename, SkyRegion *patch, int photcode, int *nstars);
     13Stars *get2mass_AS_data (SkyRegion *region, char *filename, SkyRegion *patch, int phocode, int *nstars);
  • trunk/Ohana/src/addstar/src/get2mass.c

    r5945 r6424  
    3232      case 0:
    3333        // 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);
    3535        if (VERBOSE) fprintf (stderr, "loaded %d stars from 2MASS (allsky)\n", Nrefcat);
    3636        break;
    3737      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);
    3939        if (VERBOSE) fprintf (stderr, "loaded %d stars from 2MASS (dr2)\n", Nrefcat);
    4040        break;
     
    5757
    5858  int Nregions, NREGIONS;
    59   char accelfile[1024], line[256], filename[128], datafile[256];
     59  char accelfile[1024], line[256], filename[128], datafile[256], **filenames;
    6060  FILE *f;
    6161  double Rs, Re, Ds, De;
     
    7171  NREGIONS = 200;
    7272  ALLOCATE (regions, SkyRegion, NREGIONS);
     73  ALLOCATE (filenames, char *, NREGIONS);
    7374
    7475  /* read in stars line-by-line */
     
    8485    if (Ds > patch[0].Dmax) continue;
    8586    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);
    8887    regions[Nregions].Rmin = Rs;
    8988    regions[Nregions].Rmax = Re;
    9089    regions[Nregions].Dmin = Ds;
    9190    regions[Nregions].Dmax = De;
     91
     92    sprintf (datafile, "%s/%s", path, filename);
     93    filenames[Nregions] = strcreate (datafile);
     94
    9295    Nregions ++;
    9396    CHECK_REALLOCATE (regions, SkyRegion, NREGIONS, Nregions, 20);
     97    CHECK_REALLOCATE (filenames, char *, NREGIONS, Nregions, 20);
    9498  }   
    9599  fclose (f);
     
    97101  ALLOCATE (sky, SkyTable, 1);
    98102  sky[0].regions = regions;
     103  sky[0].filename = filenames;
    99104  sky[0].Nregions = Nregions;
    100105  return (sky);
  • trunk/Ohana/src/addstar/src/get2mass_as.c

    r5945 r6424  
    1313e_time get2mass_time (char *ptr, char *buffer, int Nbound, int Nbyte);
    1414
    15 Stars *get2mass_AS_data (SkyRegion *region, SkyRegion *patch, int photcode, int *nstars) {
     15Stars *get2mass_AS_data (SkyRegion *region, char *filename, SkyRegion *patch, int photcode, int *nstars) {
    1616 
    1717  int FilterSkip, TimeSkip;
     
    2020  gzFile gf;
    2121  char qc;
    22   char *buffer, *filename;
     22  char *buffer;
    2323  char *p, *q, *ptr, *tmp;
    2424  double RA, DEC, M, dM;
     
    5555  if (!FilterSkip) Shutdown ("invalid photcode %s", GetPhotcodeNamebyCode(photcode));
    5656
    57   // filename = (char *) region[0].filename;
    5857  gf = gzopen (filename, "rb");
    5958  if (gf == NULL) Shutdown ("can't read 2mass data file: %s", filename);
  • trunk/Ohana/src/addstar/src/get2mass_dr2.c

    r5945 r6424  
    55# define NLINE 30000
    66
    7 Stars *get2mass_2DR_data (SkyRegion *region, SkyRegion *patch, int photcode, int *nstars) {
     7Stars *get2mass_2DR_data (SkyRegion *region, char *filename, SkyRegion *patch, int photcode, int *nstars) {
    88 
    99  int i, Nstars, NSTARS, Nbyte, Nline;
    1010  Stars *stars;
    1111  gzFile gf;
    12   char *buffer, *filename;
     12  char *buffer;
    1313  char line[303];
    1414  double RA, DEC, J, H, K, dJ, dH, dK;
     
    2727  fprintf (stderr, "overlap: %f - %f, %f - %f\n", RA0, RA1, DEC0, DEC1);
    2828
    29   // XXX get from args
    30   // filename = (char *) region[0].filename;
    3129  gf = gzopen (filename, "rb");
    3230  if (gf == NULL) Shutdown ("can't read 2mass data file: %s", filename);
  • trunk/Ohana/src/delstar/Makefile

    r5899 r6424  
    4040$(SRC)/check_permissions.$(ARCH).o \
    4141$(SRC)/Shutdown.$(ARCH).o         
     42
     43skip:
     44        @echo "skipping delstar for now"
    4245
    4346default: $(PROGRAM)
  • trunk/Ohana/src/kapa/event/EventLoop.c

    r5612 r6424  
    11# include "Ximage.h"
    22
    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))
    47
    58int LastEvent (Display *display, int type, XEvent *event) {
     
    3336
    3437    if (XEventsQueued (graphic.display, QueuedAfterFlush) < 1) {
     38        /* fprintf (stderr, "."); */
    3539      usleep (50000);
    3640      continue;
     
    5458    /* remove those events we will ignore */
    5559    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;
    5767  }
    5868  return (status);
    5969}
     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  
    11# include "Ximage.h"
    22
    3 # define IgnoreMask (long) (ClientMessage | ButtonReleaseMask | PointerMotionMask)
     3/* # define IgnoreMask (long) (ClientMessage | ButtonReleaseMask | PointerMotionMask) */
     4# define IgnoreMask (long) (~(StructureNotifyMask | SubstructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask))
    45
    56int LastEvent (Display *display, int type, XEvent *event);
     
    3637
    3738  events:
    38     if (XEventsQueued (graphic.display, QueuedAfterFlush) < 1){
     39    if (XEventsQueued (graphic.display, QueuedAfterFlush) < 1) {
     40        fprintf (stderr, ".");
    3941      usleep (50000);
    4042      continue;
     
    98100    /* remove those events we will ignore */
    99101    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;
    100108  }
    101109  return (FALSE);
  • trunk/Ohana/src/kii/event/EventLoop.c

    r5637 r6424  
    11# include "Ximage.h"
    22
    3 # define IgnoreMask (long) (ClientMessage | ButtonReleaseMask)
     3/* # define IgnoreMask (long) (ClientMessage | ButtonReleaseMask) */
     4# define IgnoreMask (long) (~(StructureNotifyMask | SubstructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | PointerMotionMask))
    45
    56int LastEvent (Display *display, int type, XEvent *event) {
  • trunk/Ohana/src/kii/picture/cursor.c

    r5349 r6424  
    11# include "Ximage.h"
     2
     3# define IgnoreMask (long) (~(StructureNotifyMask | SubstructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | PointerMotionMask))
    24
    35int LastEvent (Display *display, int type, XEvent *event);
     
    6668      write (layout[0].Ximage, line, 40);
    6769    }
     70
     71    /* remove those events we will ignore */
     72    while (XCheckMaskEvent (display, IgnoreMask, &event)) continue;
    6873  }
    6974  return (FALSE);
  • trunk/Ohana/src/opihi/lib.shell/expand_vars.c

    r3922 r6424  
    7171      *N = *Val; /* place the value of the variable in the newline */
    7272    }
     73    N--; /* we overshoot on last loop */
    7374
    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 */
    7682
    7783    if (V0 != NULL) free (V0);
  • trunk/Ohana/src/opihi/lib.shell/string.c

    r2598 r6424  
    9494char *thisvar (char *string) {
    9595
    96   int i;
     96  int i, start;
    9797  char *word;
    9898
     
    100100  if (string[0] != '$') return ((char *) NULL);
    101101
    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 */
    105110  word = strncreate (&string[1], i - 1);
    106111  return (word);
     
    207212char *aftervar (char *string) {
    208213
    209   int i, j;
     214  int i, j, start;
    210215
    211216  if (string == (char *) NULL) return ((char *) NULL);
    212217  if (string[0] != '$') return ((char *) NULL);
    213218
    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);
    216225
    217226  for (j = i; whitespace (string[j]); j++);
  • trunk/Ohana/src/opihi/lib.shell/variable.c

    r6327 r6424  
    103103 
    104104  int i;
    105   char *local, *MacroName;
     105  char *local, *MacroName, *value;
    106106
    107107  if (name == NULL) return (NULL);
     
    111111  /* return a string which should not be freed */
    112112  if (*name == '?') {
    113     value = get_variable_ptr (name[1]);
     113    value = get_variable_ptr (&name[1]);
    114114    if (value == NULL) {
    115115      return variable_false;
     
    152152  /* return a string which can be freed */
    153153  if (*name == '?') {
    154     value = get_variable_ptr (name[1]);
     154    value = get_variable_ptr (&name[1]);
    155155    if (value == NULL) {
    156156      value = strcreate (variable_false);
Note: See TracChangeset for help on using the changeset viewer.