Changeset 6257
- Timestamp:
- Jan 30, 2006, 5:19:13 PM (20 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 1 deleted
- 2 edited
-
Makefile.am (modified) (4 diffs)
-
pxalloc.c (deleted)
-
pxframes.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/Makefile.am
r6225 r6257 1 bin_PROGRAMS = p 2search pxadmin1 bin_PROGRAMS = pxadmin p0search p2search 2 2 3 3 include_HEADERS = pxtools.h … … 8 8 libpxtools_la_SOURCES = \ 9 9 p2searchDoneFrames.c \ 10 pxalloc.c \11 10 p2insertPendingFrames.c \ 12 11 p2pendingToDone.c \ … … 22 21 AM_CPPFLAGS = -I$(top_srcdir)/src$ 23 22 23 p0search_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(METADATADB_CFLAGS) $(pxtools_CFLAGS) 24 p0search_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(METADATADB_LIBS) $(top_builddir)/src/libpxtools.la 25 p0search_SOURCES = \ 26 p0search.c \ 27 p0searchConfig.c 28 24 29 p2search_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(METADATADB_CFLAGS) $(pxtools_CFLAGS) 25 30 p2search_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(METADATADB_LIBS) $(top_builddir)/src/libpxtools.la … … 27 32 p2search.c \ 28 33 p2searchConfig.c 34 29 35 pxadmin_CFLAGS = $(PSLIB_CFLAGS) $(PSMODULES_CFLAGS) $(METADATADB_CFLAGS) $(pxtools_CFLAGS) 30 36 pxadmin_LDADD = $(PSLIB_LIBS) $(PSMODULES_LIBS) $(METADATADB_LIBS) $(top_builddir)/src/libpxtools.la -
trunk/ippTools/src/pxframes.c
r6224 r6257 2 2 3 3 #include "pxtools.h" 4 5 #define PX_FRAME_ALLOC(frametype, exptype) \ 6 \ 7 static void frametype##Free(frametype *ptr);\ 8 \ 9 frametype *frametype##Alloc( \ 10 exptype##Row *exposure, \ 11 psArray *images \ 12 ) \ 13 { \ 14 frametype *frame; \ 15 \ 16 PS_ASSERT_PTR_NON_NULL(exposure, NULL); \ 17 PS_ASSERT_PTR_NON_NULL(images, NULL); \ 18 \ 19 frame = psAlloc(sizeof(frametype)); \ 20 psMemSetDeallocator(frame, (psFreeFunc)frametype##Free); \ 21 \ 22 frame->exposure = exposure; \ 23 frame->images = images; \ 24 \ 25 return frame; \ 26 } \ 27 \ 28 static void frametype##Free(frametype *ptr) \ 29 { \ 30 psFree(ptr->exposure); \ 31 psFree(ptr->images); \ 32 } 33 34 PX_FRAME_ALLOC(newFrame, newExp); 35 PX_FRAME_ALLOC(rawScienceFrame, rawScienceExp); 36 PX_FRAME_ALLOC(p2PendingFrame, p2PendingExp); 37 PX_FRAME_ALLOC(p2DoneFrame, p2DoneExp); 4 38 5 39 #define PX_FRAME_PRINT(frametype, imfiletype) \ … … 35 69 PX_FRAME_PRINT(rawScienceFrame, rawImfile); 36 70 PX_FRAME_PRINT(p2PendingFrame, p2PendingImfile); 71 72 73 #define PX_FRAME_SEARCH(frametype, exptype, imfiletype) \ 74 psArray *frametype##Search(pxConfig *config) \ 75 { \ 76 PS_ASSERT_PTR_NON_NULL(config, NULL); \ 77 \ 78 psArray *exposures = exptype##SelectRowObjects(config->database, \ 79 config->where, MAX_ROWS); \ 80 if (!exposures) { \ 81 psError(PS_ERR_UNKNOWN, false, "no exptype rows found"); \ 82 \ 83 return NULL; \ 84 } \ 85 \ 86 psArray *allFrames = psArrayAlloc(exposures->n); \ 87 allFrames->n = 0; \ 88 \ 89 psMetadata *where = psMetadataAlloc (); \ 90 for (int i = 0; i < exposures->n; i++) { \ 91 exptype##Row *exposure = exposures->data[i]; \ 92 \ 93 psMetadataAddStr(where, PS_LIST_TAIL, "exp_id", PS_META_REPLACE, "==", \ 94 exposure->exp_id); \ 95 \ 96 psArray *images = imfiletype##SelectRowObjects(config->database, where, \ 97 MAX_ROWS); \ 98 if (!images) { \ 99 psError(PS_ERR_UNKNOWN, false, "database access failed"); \ 100 \ 101 return NULL; \ 102 } \ 103 \ 104 frametype *frame = frametype##Alloc(exposure, images); \ 105 psArrayAdd(allFrames, 100, frame); \ 106 } \ 107 \ 108 return allFrames; \ 109 } 110 111 PX_FRAME_SEARCH(newFrame, newExp, newImfile);
Note:
See TracChangeset
for help on using the changeset viewer.
