IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 5237


Ignore:
Timestamp:
Oct 7, 2005, 2:57:16 PM (21 years ago)
Author:
eugene
Message:

split into libohana and libdvo, removed structures from Fread

Location:
trunk/Ohana/src/libohana
Files:
17 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/Makefile

    r5228 r5237  
    2222libohana: $(LIB)/libohana.$(ARCH).a
    2323
    24 INC1 = \
     24INCS = \
    2525$(DESTINC)/Xohana.h  \
    2626$(DESTINC)/ohana_allocate.h \
    2727$(DESTINC)/ohana.h
    2828
    29 INC2 = \
    30 $(DESTINC)/dvo.h
    31 
    32 OBJ1 = \
     29OBJS = \
    3330$(SRC)/ohana_allocate.$(ARCH).o  \
    3431$(SRC)/string.$(ARCH).o          \
     
    3734$(SRC)/time.$(ARCH).o            \
    3835$(SRC)/config.$(ARCH).o          \
     36$(SRC)/Fread.$(ARCH).o           \
    3937$(SRC)/version.$(ARCH).o
    4038
    41 OBJ2 = \
    42 $(SRC)/Fread.$(ARCH).o           \
    43 $(SRC)/coordops.$(ARCH).o        \
    44 $(SRC)/LoadPhotcodes.$(ARCH).o   \
    45 $(SRC)/imreg_datatypes.$(ARCH).o \
    46 $(SRC)/mosaic_astrom.$(ARCH).o   \
    47 $(SRC)/fits_db.$(ARCH).o         \
    48 $(SRC)/photfits.$(ARCH).o        \
    49 $(SRC)/dvo_image.$(ARCH).o       \
    50 $(SRC)/dvo_image_raw.$(ARCH).o   \
    51 $(SRC)/dvo_catalog.$(ARCH).o     \
    52 $(SRC)/dvo_catalog_raw.$(ARCH).o       \
    53 $(SRC)/dvo_catalog_mef.$(ARCH).o       \
    54 $(SRC)/dvo_catalog_split.$(ARCH).o     \
    55 $(SRC)/dvo_convert.$(ARCH).o           \
    56 $(SRC)/dvo_convert_elixir.$(ARCH).o    \
    57 $(SRC)/dvo_convert_loneos.$(ARCH).o    \
    58 $(SRC)/dvo_convert_panstarrs.$(ARCH).o
    59 
    60 AOBJ = \
    61 $(ASRC)/coords.$(ARCH).o \
    62 $(ASRC)/average.$(ARCH).o \
    63 $(ASRC)/average-loneos.$(ARCH).o \
    64 $(ASRC)/average-elixir.$(ARCH).o \
    65 $(ASRC)/average-panstarrs.$(ARCH).o \
    66 $(ASRC)/secfilt.$(ARCH).o \
    67 $(ASRC)/secfilt-loneos.$(ARCH).o \
    68 $(ASRC)/secfilt-elixir.$(ARCH).o \
    69 $(ASRC)/secfilt-panstarrs.$(ARCH).o \
    70 $(ASRC)/measure.$(ARCH).o \
    71 $(ASRC)/measure-loneos.$(ARCH).o \
    72 $(ASRC)/measure-elixir.$(ARCH).o \
    73 $(ASRC)/measure-panstarrs.$(ARCH).o \
    74 $(ASRC)/missing.$(ARCH).o \
    75 $(ASRC)/photcode.$(ARCH).o \
    76 $(ASRC)/image.$(ARCH).o \
    77 $(ASRC)/image-loneos.$(ARCH).o \
    78 $(ASRC)/image-elixir.$(ARCH).o \
    79 $(ASRC)/image-panstarrs.$(ARCH).o \
    80 $(ASRC)/regimage.$(ARCH).o \
    81 $(ASRC)/detreg.$(ARCH).o \
    82 $(ASRC)/photreg.$(ARCH).o \
    83 $(ASRC)/photreg-old.$(ARCH).o \
    84 $(ASRC)/smpdata.$(ARCH).o \
    85 $(ASRC)/spectrum.$(ARCH).o \
    86 $(ASRC)/spectrum-ascii.$(ARCH).o
    87 
    88 ACOM = $(ADEF)/autocode.c $(ADEF)/autocode.h $(ADEF)/common.h
    89 
    90 $(OBJ1): $(INC1)
    91 $(OBJ2): $(INC2)
    92 $(AOBJ): $(ASRC)/%.$(ARCH).o : $(ADEF)/%.d $(ACOM)
    93         cd $(AUTO) && make install
     39$(OBJS): $(INCS)
    9440
    9541$(DESTLIB)/libohana.a: $(LIB)/libohana.$(ARCH).a
     
    9844        cp $(LIB)/libohana.$(ARCH).a $(DESTLIB)/libohana.a
    9945
    100 $(LIB)/libohana.$(ARCH).a: $(OBJ1) $(AOBJ) $(OBJ2)
     46$(LIB)/libohana.$(ARCH).a: $(OBJS)
    10147        @if [ ! -d $(LIB) ]; then mkdir -p $(LIB); fi
    10248        rm -f $(LIB)/libohana.$(ARCH).a
    103         ar rcv $(LIB)/libohana.$(ARCH).a $(OBJ1) $(AOBJ) $(OBJ2)
     49        ar rcv $(LIB)/libohana.$(ARCH).a $(OBJS)
    10450        $(RANLIB) $(LIB)/libohana.$(ARCH).a
    10551
     
    11460        rm -f */*.o
    11561        rm -f */*.a
    116         cd $(AUTO) && make clean
    11762
    11863dist: clean
  • trunk/Ohana/src/libohana/doc/ChangeLog.txt

    r4736 r5237  
     1
     22005.10.07
     3
     4        I was having some memory collision problems, and attempting to
     5        use the ohana_allocate functions reminded me that the libFITS
     6        functions were not supported under ohana_allocate.  This was
     7        unhelpful.  I bit the bullet and split libohana into libohana
     8        (base functions only, including ohana_allocate) and libdvo
     9        (functions based on the libautocode structures).  Doing this
     10        allowed me to make libFITS depend on libohana (including
     11        ohana_allocate).  BUT, this forced me to change all LDFLAGS
     12        entries in ohana to swap -lohana -lFITS for -lFITS -lohana,
     13        and to add include <fitsio.h> in some cases.
    114
    215libohana-1-4
  • trunk/Ohana/src/libohana/include/ohana.h

    r4810 r5237  
    2020
    2121/* OHANA included stuff */
    22 # include <fitsio.h>             
    23 
    2422# ifndef OHANA_H
    2523# define OHANA_H
     
    152150*/
    153151
     152/*
     153# ifndef ANSI
     154# include <varargs.h>
     155# else
     156# include <stdarg.h>
     157# include <cfuncs.h>
    154158# endif
     159*/
     160
     161# endif
  • trunk/Ohana/src/libohana/src/Fread.c

    r4025 r5237  
    11# include <ohana.h>
    2 # include <dvo.h>
    32
    43int   ByteSwap (char *ptr, int size, int nitems, char *type);
    5 int   ConvertStruct (char *buffer, int size, int Nbytes, char *type);
    64
    75# define BYTE_EXCHANGE(X,Y) tmp = byte[X]; byte[X] = byte[Y]; byte[Y] = tmp;
     
    1715  tmp = byte[X+3]; byte[X+3] = byte[X+4]; byte[X+4] = tmp;
    1816
    19 # define REGIMAGE_SIZE 360
    20 # define DETREG_SIZE 416
    21 # define PHOTPARS_SIZE 108
    22 # define MISSING_SIZE 4
    23 # define SECFILT_SIZE 6
    24 # define SPECTRUM_SIZE 216  /* where is this?? */
    25 # define IMAGE_SIZE 240
    26 
    27 # if (PANSTARRS)
    28 # define AVERAGE_SIZE 40
    29 # define MEASURE_SIZE 32
    30 # endif
    31 
    32 # if (ELIXIR)
    33 # define AVERAGE_SIZE 32
    34 # define MEASURE_SIZE 32
    35 # endif
    36 
    37 # if (LONEOS)
    38 # define AVERAGE_SIZE 28
    39 # define MEASURE_SIZE 20
    40 # endif
    41 
    42 # define OLDPHOTPARS_SIZE 100
    43 # define OLDSECFILT_SIZE 4
    44 # define OLDDETREG_SIZE 288
    45 
     17/** this is also used in libautocode/def/common.h -- consolidate **/
    4618# ifdef linux
    4719# define BYTE_SWAP
     
    5224# endif
    5325
    54 /* add other architectures here, ie dec, alpha, etc */
    5526# ifdef dec
    5627# define BYTE_SWAP
    5728# endif
    5829
     30/* add other architectures here, ie dec, alpha, etc */
     31
    5932int Fread (void *ptr, int size, int nitems, FILE *f, char *type) {
    6033
     
    8154}
    8255
    83 int ConvertStruct (char *buffer, int size, int nitems, char *type) {
    84 
    85   int status;
    86   status = ByteSwap (buffer, size, nitems, type);
    87   return (status);
    88 }
    89 
    9056int ByteSwap (char *ptr, int size, int nitems, char *type) {
    9157
    9258# ifdef BYTE_SWAP
    9359
    94   int i, j;
    95   unsigned char *byte, *byte0, *byte1, *byte2, *byte3, *byte4, *byte5, *byte6, *byte7, tmp;
     60  int i;
     61  unsigned char *byte0, *byte1, *byte2, *byte3, *byte4, *byte5, *byte6, *byte7, tmp;
    9662
    9763  if (!strcmp (type, "char")) return (TRUE);
     
    150116  }
    151117
     118# if (0) /** now in autocode **/
    152119  if (!strcmp (type, "regimage")) {
    153120    if (size != REGIMAGE_SIZE) {
     
    352319  }
    353320
    354 # endif /** ELIXIR **/
     321# endif /** PANSTARRS **/
    355322
    356323
     
    494461  }
    495462# endif /** others **/
     463# endif /** now in autocode **/
    496464
    497465  fprintf (stderr, "unknown type %s\n", type);
  • trunk/Ohana/src/libohana/src/ohana_allocate.c

    r4718 r5237  
    198198  }
    199199
    200   fprintf (stderr, "checking for memory corruption...\n");
    201200  header = FALSE;
    202201  for (i = 0; i < Nmemlist; i++) {
     
    216215    }
    217216    fprintf (stderr, "corrupt:  %3d  %c   %c  %-15s %3d\n", i, bottom, top, memlist[i].file, memlist[i].line);
     217    abort ();
    218218  }
    219219  return;
Note: See TracChangeset for help on using the changeset viewer.