Changeset 8026
- Timestamp:
- Jul 31, 2006, 4:12:32 PM (20 years ago)
- Files:
-
- 10 edited
-
branches/jhoblitt/ippdb/configure.ac (modified) (1 diff)
-
branches/jhoblitt/ippdb/src/ippdb.c (modified) (42 diffs)
-
branches/jhoblitt/ippdb/src/ippdb.h (modified) (12 diffs)
-
branches/jhoblitt/ippdb/tests/alloc.c (modified) (4 diffs)
-
branches/jhoblitt/ippdb/tests/insert.c (modified) (3 diffs)
-
branches/jhoblitt/ippdb/tests/insertobject.c (modified) (3 diffs)
-
branches/jhoblitt/ippdb/tests/metadatafromobject.c (modified) (6 diffs)
-
branches/jhoblitt/ippdb/tests/objectfrommetadata.c (modified) (6 diffs)
-
branches/jhoblitt/ippdb/tests/pop.c (modified) (3 diffs)
-
trunk/ippdb/configure.ac (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/jhoblitt/ippdb/configure.ac
r8020 r8026 1 1 AC_PREREQ(2.59) 2 2 3 AC_INIT([ippdb], [0.0. 4], [pan-starrs.ifa.hawaii.edu])3 AC_INIT([ippdb], [0.0.5], [pan-starrs.ifa.hawaii.edu]) 4 4 AC_CONFIG_SRCDIR([ippdb.pc.in]) 5 5 -
branches/jhoblitt/ippdb/src/ippdb.c
r8020 r8026 4670 4670 static void pzPendingImfileRowFree(pzPendingImfileRow *object); 4671 4671 4672 pzPendingImfileRow *pzPendingImfileRowAlloc(const char *exp_id, psS32 bytes, const char *md5sum, const char *class _id, const char *uri)4672 pzPendingImfileRow *pzPendingImfileRowAlloc(const char *exp_id, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri) 4673 4673 { 4674 4674 pzPendingImfileRow *object; … … 4680 4680 object->bytes = bytes; 4681 4681 object->md5sum = psStringCopy(md5sum); 4682 object->class = psStringCopy(class); 4682 4683 object->class_id = psStringCopy(class_id); 4683 4684 object->uri = psStringCopy(uri); … … 4690 4691 psFree(object->exp_id); 4691 4692 psFree(object->md5sum); 4693 psFree(object->class); 4692 4694 psFree(object->class_id); 4693 4695 psFree(object->uri); … … 4720 4722 return false; 4721 4723 } 4724 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "64")) { 4725 psError(PS_ERR_UNKNOWN, false, "failed to add item class"); 4726 psFree(md); 4727 return false; 4728 } 4722 4729 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "64")) { 4723 4730 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id"); … … 4743 4750 } 4744 4751 4745 bool pzPendingImfileInsert(psDB * dbh, const char *exp_id, psS32 bytes, const char *md5sum, const char *class _id, const char *uri)4752 bool pzPendingImfileInsert(psDB * dbh, const char *exp_id, psS32 bytes, const char *md5sum, const char *class, const char *class_id, const char *uri) 4746 4753 { 4747 4754 psMetadata *md; … … 4764 4771 return false; 4765 4772 } 4773 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, class)) { 4774 psError(PS_ERR_UNKNOWN, false, "failed to add item class"); 4775 psFree(md); 4776 return false; 4777 } 4766 4778 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, class_id)) { 4767 4779 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id"); … … 4781 4793 } 4782 4794 4783 bool pzPendingImfilePop(psDB *dbh, char **exp_id, psS32 *bytes, char **md5sum, char **class _id, char **uri)4795 bool pzPendingImfilePop(psDB *dbh, char **exp_id, psS32 *bytes, char **md5sum, char **class, char **class_id, char **uri) 4784 4796 { 4785 4797 psArray *rowSet; … … 4843 4855 return false; 4844 4856 } 4857 *class = psMetadataLookupPtr(&status, row, "class"); 4858 if (!status) { 4859 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item class"); 4860 psFree(row); 4861 return false; 4862 } 4845 4863 *class_id = psMetadataLookupPtr(&status, row, "class_id"); 4846 4864 if (!status) { … … 4863 4881 bool pzPendingImfileInsertObject(psDB *dbh, pzPendingImfileRow *object) 4864 4882 { 4865 return pzPendingImfileInsert(dbh, object->exp_id, object->bytes, object->md5sum, object->class _id, object->uri);4883 return pzPendingImfileInsert(dbh, object->exp_id, object->bytes, object->md5sum, object->class, object->class_id, object->uri); 4866 4884 } 4867 4885 … … 4871 4889 psS32 bytes; 4872 4890 char md5sum[256]; 4891 char class[256]; 4873 4892 char class_id[256]; 4874 4893 char uri[256]; 4875 4894 4876 if (!pzPendingImfilePop(dbh, (char **)&exp_id, &bytes, (char **)&md5sum, (char **)&class _id, (char **)&uri)) {4895 if (!pzPendingImfilePop(dbh, (char **)&exp_id, &bytes, (char **)&md5sum, (char **)&class, (char **)&class_id, (char **)&uri)) { 4877 4896 psError(PS_ERR_UNKNOWN, false, "failed to pop a database row"); 4878 4897 return NULL; 4879 4898 } 4880 4899 4881 return pzPendingImfileRowAlloc(exp_id, bytes, md5sum, class _id, uri);4900 return pzPendingImfileRowAlloc(exp_id, bytes, md5sum, class, class_id, uri); 4882 4901 } 4883 4902 … … 4993 5012 return NULL; 4994 5013 } 5014 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, object->class)) { 5015 psError(PS_ERR_UNKNOWN, false, "failed to add item class"); 5016 psFree(md); 5017 return NULL; 5018 } 4995 5019 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, object->class_id)) { 4996 5020 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id"); … … 5013 5037 psS32 bytes; 5014 5038 char *md5sum; 5039 char *class; 5015 5040 char *class_id; 5016 5041 char *uri; … … 5031 5056 return false; 5032 5057 } 5058 class = psMetadataLookupPtr(&status, md, "class"); 5059 if (!status) { 5060 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item class"); 5061 return false; 5062 } 5033 5063 class_id = psMetadataLookupPtr(&status, md, "class_id"); 5034 5064 if (!status) { … … 5042 5072 } 5043 5073 5044 return pzPendingImfileRowAlloc(exp_id, bytes, md5sum, class _id, uri);5074 return pzPendingImfileRowAlloc(exp_id, bytes, md5sum, class, class_id, uri); 5045 5075 } 5046 5076 psArray *pzPendingImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 5530 5560 static void newImfileRowFree(newImfileRow *object); 5531 5561 5532 newImfileRow *newImfileRowAlloc(const char *exp_id, const char *class _id, const char *uri)5562 newImfileRow *newImfileRowAlloc(const char *exp_id, const char *class, const char *class_id, const char *uri) 5533 5563 { 5534 5564 newImfileRow *object; … … 5538 5568 5539 5569 object->exp_id = psStringCopy(exp_id); 5570 object->class = psStringCopy(class); 5540 5571 object->class_id = psStringCopy(class_id); 5541 5572 object->uri = psStringCopy(uri); … … 5547 5578 { 5548 5579 psFree(object->exp_id); 5580 psFree(object->class); 5549 5581 psFree(object->class_id); 5550 5582 psFree(object->uri); … … 5567 5599 return false; 5568 5600 } 5601 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "64")) { 5602 psError(PS_ERR_UNKNOWN, false, "failed to add item class"); 5603 psFree(md); 5604 return false; 5605 } 5569 5606 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "64")) { 5570 5607 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id"); … … 5590 5627 } 5591 5628 5592 bool newImfileInsert(psDB * dbh, const char *exp_id, const char *class _id, const char *uri)5629 bool newImfileInsert(psDB * dbh, const char *exp_id, const char *class, const char *class_id, const char *uri) 5593 5630 { 5594 5631 psMetadata *md; … … 5601 5638 return false; 5602 5639 } 5640 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, class)) { 5641 psError(PS_ERR_UNKNOWN, false, "failed to add item class"); 5642 psFree(md); 5643 return false; 5644 } 5603 5645 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, class_id)) { 5604 5646 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id"); … … 5618 5660 } 5619 5661 5620 bool newImfilePop(psDB *dbh, char **exp_id, char **class _id, char **uri)5662 bool newImfilePop(psDB *dbh, char **exp_id, char **class, char **class_id, char **uri) 5621 5663 { 5622 5664 psArray *rowSet; … … 5668 5710 return false; 5669 5711 } 5712 *class = psMetadataLookupPtr(&status, row, "class"); 5713 if (!status) { 5714 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item class"); 5715 psFree(row); 5716 return false; 5717 } 5670 5718 *class_id = psMetadataLookupPtr(&status, row, "class_id"); 5671 5719 if (!status) { … … 5688 5736 bool newImfileInsertObject(psDB *dbh, newImfileRow *object) 5689 5737 { 5690 return newImfileInsert(dbh, object->exp_id, object->class _id, object->uri);5738 return newImfileInsert(dbh, object->exp_id, object->class, object->class_id, object->uri); 5691 5739 } 5692 5740 … … 5694 5742 { 5695 5743 char exp_id[256]; 5744 char class[256]; 5696 5745 char class_id[256]; 5697 5746 char uri[256]; 5698 5747 5699 if (!newImfilePop(dbh, (char **)&exp_id, (char **)&class _id, (char **)&uri)) {5748 if (!newImfilePop(dbh, (char **)&exp_id, (char **)&class, (char **)&class_id, (char **)&uri)) { 5700 5749 psError(PS_ERR_UNKNOWN, false, "failed to pop a database row"); 5701 5750 return NULL; 5702 5751 } 5703 5752 5704 return newImfileRowAlloc(exp_id, class _id, uri);5753 return newImfileRowAlloc(exp_id, class, class_id, uri); 5705 5754 } 5706 5755 … … 5806 5855 return NULL; 5807 5856 } 5857 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, object->class)) { 5858 psError(PS_ERR_UNKNOWN, false, "failed to add item class"); 5859 psFree(md); 5860 return NULL; 5861 } 5808 5862 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, object->class_id)) { 5809 5863 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id"); … … 5824 5878 bool status; 5825 5879 char *exp_id; 5880 char *class; 5826 5881 char *class_id; 5827 5882 char *uri; … … 5832 5887 return false; 5833 5888 } 5889 class = psMetadataLookupPtr(&status, md, "class"); 5890 if (!status) { 5891 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item class"); 5892 return false; 5893 } 5834 5894 class_id = psMetadataLookupPtr(&status, md, "class_id"); 5835 5895 if (!status) { … … 5843 5903 } 5844 5904 5845 return newImfileRowAlloc(exp_id, class _id, uri);5905 return newImfileRowAlloc(exp_id, class, class_id, uri); 5846 5906 } 5847 5907 psArray *newImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) … … 6881 6941 static void rawImfileRowFree(rawImfileRow *object); 6882 6942 6883 rawImfileRow *rawImfileRowAlloc(const char *exp_id, const char *class _id, const char *uri, const char *stats)6943 rawImfileRow *rawImfileRowAlloc(const char *exp_id, const char *class, const char *class_id, const char *uri, const char *stats) 6884 6944 { 6885 6945 rawImfileRow *object; … … 6889 6949 6890 6950 object->exp_id = psStringCopy(exp_id); 6951 object->class = psStringCopy(class); 6891 6952 object->class_id = psStringCopy(class_id); 6892 6953 object->uri = psStringCopy(uri); … … 6899 6960 { 6900 6961 psFree(object->exp_id); 6962 psFree(object->class); 6901 6963 psFree(object->class_id); 6902 6964 psFree(object->uri); … … 6920 6982 return false; 6921 6983 } 6984 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "64")) { 6985 psError(PS_ERR_UNKNOWN, false, "failed to add item class"); 6986 psFree(md); 6987 return false; 6988 } 6922 6989 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "64")) { 6923 6990 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id"); … … 6948 7015 } 6949 7016 6950 bool rawImfileInsert(psDB * dbh, const char *exp_id, const char *class _id, const char *uri, const char *stats)7017 bool rawImfileInsert(psDB * dbh, const char *exp_id, const char *class, const char *class_id, const char *uri, const char *stats) 6951 7018 { 6952 7019 psMetadata *md; … … 6959 7026 return false; 6960 7027 } 7028 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, class)) { 7029 psError(PS_ERR_UNKNOWN, false, "failed to add item class"); 7030 psFree(md); 7031 return false; 7032 } 6961 7033 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, class_id)) { 6962 7034 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id"); … … 6981 7053 } 6982 7054 6983 bool rawImfilePop(psDB *dbh, char **exp_id, char **class _id, char **uri, char **stats)7055 bool rawImfilePop(psDB *dbh, char **exp_id, char **class, char **class_id, char **uri, char **stats) 6984 7056 { 6985 7057 psArray *rowSet; … … 7031 7103 return false; 7032 7104 } 7105 *class = psMetadataLookupPtr(&status, row, "class"); 7106 if (!status) { 7107 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item class"); 7108 psFree(row); 7109 return false; 7110 } 7033 7111 *class_id = psMetadataLookupPtr(&status, row, "class_id"); 7034 7112 if (!status) { … … 7057 7135 bool rawImfileInsertObject(psDB *dbh, rawImfileRow *object) 7058 7136 { 7059 return rawImfileInsert(dbh, object->exp_id, object->class _id, object->uri, object->stats);7137 return rawImfileInsert(dbh, object->exp_id, object->class, object->class_id, object->uri, object->stats); 7060 7138 } 7061 7139 … … 7063 7141 { 7064 7142 char exp_id[256]; 7143 char class[256]; 7065 7144 char class_id[256]; 7066 7145 char uri[256]; 7067 7146 char stats[256]; 7068 7147 7069 if (!rawImfilePop(dbh, (char **)&exp_id, (char **)&class _id, (char **)&uri, (char **)&stats)) {7148 if (!rawImfilePop(dbh, (char **)&exp_id, (char **)&class, (char **)&class_id, (char **)&uri, (char **)&stats)) { 7070 7149 psError(PS_ERR_UNKNOWN, false, "failed to pop a database row"); 7071 7150 return NULL; 7072 7151 } 7073 7152 7074 return rawImfileRowAlloc(exp_id, class _id, uri, stats);7153 return rawImfileRowAlloc(exp_id, class, class_id, uri, stats); 7075 7154 } 7076 7155 … … 7176 7255 return NULL; 7177 7256 } 7257 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, object->class)) { 7258 psError(PS_ERR_UNKNOWN, false, "failed to add item class"); 7259 psFree(md); 7260 return NULL; 7261 } 7178 7262 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, object->class_id)) { 7179 7263 psError(PS_ERR_UNKNOWN, false, "failed to add item class_id"); … … 7199 7283 bool status; 7200 7284 char *exp_id; 7285 char *class; 7201 7286 char *class_id; 7202 7287 char *uri; … … 7208 7293 return false; 7209 7294 } 7295 class = psMetadataLookupPtr(&status, md, "class"); 7296 if (!status) { 7297 psError(PS_ERR_UNKNOWN, true, "failed to lookup value for item class"); 7298 return false; 7299 } 7210 7300 class_id = psMetadataLookupPtr(&status, md, "class_id"); 7211 7301 if (!status) { … … 7224 7314 } 7225 7315 7226 return rawImfileRowAlloc(exp_id, class _id, uri, stats);7316 return rawImfileRowAlloc(exp_id, class, class_id, uri, stats); 7227 7317 } 7228 7318 psArray *rawImfileSelectRowObjects(psDB *dbh, const psMetadata *where, unsigned long long limit) -
branches/jhoblitt/ippdb/src/ippdb.h
r8020 r8026 1914 1914 psS32 bytes; 1915 1915 char *md5sum; 1916 char *class; 1916 1917 char *class_id; 1917 1918 char *uri; … … 1927 1928 psS32 bytes, 1928 1929 const char *md5sum, 1930 const char *class, 1929 1931 const char *class_id, 1930 1932 const char *uri … … 1961 1963 psS32 bytes, 1962 1964 const char *md5sum, 1965 const char *class, 1963 1966 const char *class_id, 1964 1967 const char *uri … … 1975 1978 psS32 *bytes, 1976 1979 char **md5sum, 1980 char **class, 1977 1981 char **class_id, 1978 1982 char **uri … … 2278 2282 typedef struct { 2279 2283 char *exp_id; 2284 char *class; 2280 2285 char *class_id; 2281 2286 char *uri; … … 2289 2294 newImfileRow *newImfileRowAlloc( 2290 2295 const char *exp_id, 2296 const char *class, 2291 2297 const char *class_id, 2292 2298 const char *uri … … 2321 2327 psDB *dbh, ///< Database handle 2322 2328 const char *exp_id, 2329 const char *class, 2323 2330 const char *class_id, 2324 2331 const char *uri … … 2333 2340 psDB *dbh, ///< Database handle 2334 2341 char **exp_id, 2342 char **class, 2335 2343 char **class_id, 2336 2344 char **uri … … 2835 2843 typedef struct { 2836 2844 char *exp_id; 2845 char *class; 2837 2846 char *class_id; 2838 2847 char *uri; … … 2847 2856 rawImfileRow *rawImfileRowAlloc( 2848 2857 const char *exp_id, 2858 const char *class, 2849 2859 const char *class_id, 2850 2860 const char *uri, … … 2880 2890 psDB *dbh, ///< Database handle 2881 2891 const char *exp_id, 2892 const char *class, 2882 2893 const char *class_id, 2883 2894 const char *uri, … … 2893 2904 psDB *dbh, ///< Database handle 2894 2905 char **exp_id, 2906 char **class, 2895 2907 char **class_id, 2896 2908 char **uri, -
branches/jhoblitt/ippdb/tests/alloc.c
r8020 r8026 384 384 pzPendingImfileRow *object; 385 385 386 object = pzPendingImfileRowAlloc("a string", -32, "a string", "a string", "a string" );386 object = pzPendingImfileRowAlloc("a string", -32, "a string", "a string", "a string", "a string" ); 387 387 388 388 if (!object) { … … 402 402 exit(EXIT_FAILURE); 403 403 } 404 if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) { 405 psFree(object); 406 exit(EXIT_FAILURE); 407 } 404 408 if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) { 405 409 psFree(object); … … 450 454 newImfileRow *object; 451 455 452 object = newImfileRowAlloc("a string", "a string", "a string" ); 453 454 if (!object) { 455 exit(EXIT_FAILURE); 456 } 457 458 if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) { 456 object = newImfileRowAlloc("a string", "a string", "a string", "a string" ); 457 458 if (!object) { 459 exit(EXIT_FAILURE); 460 } 461 462 if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) { 463 psFree(object); 464 exit(EXIT_FAILURE); 465 } 466 if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) { 459 467 psFree(object); 460 468 exit(EXIT_FAILURE); … … 557 565 rawImfileRow *object; 558 566 559 object = rawImfileRowAlloc("a string", "a string", "a string", "a string" ); 560 561 if (!object) { 562 exit(EXIT_FAILURE); 563 } 564 565 if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) { 567 object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string" ); 568 569 if (!object) { 570 exit(EXIT_FAILURE); 571 } 572 573 if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) { 574 psFree(object); 575 exit(EXIT_FAILURE); 576 } 577 if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) { 566 578 psFree(object); 567 579 exit(EXIT_FAILURE); -
branches/jhoblitt/ippdb/tests/insert.c
r8020 r8026 163 163 } 164 164 165 if (!pzPendingImfileInsert(dbh, "a string", -32, "a string", "a string", "a string" )) {165 if (!pzPendingImfileInsert(dbh, "a string", -32, "a string", "a string", "a string", "a string")) { 166 166 exit(EXIT_FAILURE); 167 167 } … … 193 193 } 194 194 195 if (!newImfileInsert(dbh, "a string", "a string", "a string" )) {195 if (!newImfileInsert(dbh, "a string", "a string", "a string", "a string")) { 196 196 exit(EXIT_FAILURE); 197 197 } … … 238 238 } 239 239 240 if (!rawImfileInsert(dbh, "a string", "a string", "a string", "a string" )) {240 if (!rawImfileInsert(dbh, "a string", "a string", "a string", "a string", "a string")) { 241 241 exit(EXIT_FAILURE); 242 242 } -
branches/jhoblitt/ippdb/tests/insertobject.c
r8020 r8026 234 234 } 235 235 236 object = pzPendingImfileRowAlloc("a string", -32, "a string", "a string", "a string" );236 object = pzPendingImfileRowAlloc("a string", -32, "a string", "a string", "a string", "a string"); 237 237 if (!object) { 238 238 exit(EXIT_FAILURE); … … 278 278 } 279 279 280 object = newImfileRowAlloc("a string", "a string", "a string" );280 object = newImfileRowAlloc("a string", "a string", "a string", "a string"); 281 281 if (!object) { 282 282 exit(EXIT_FAILURE); … … 344 344 } 345 345 346 object = rawImfileRowAlloc("a string", "a string", "a string", "a string" );346 object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string"); 347 347 if (!object) { 348 348 exit(EXIT_FAILURE); -
branches/jhoblitt/ippdb/tests/metadatafromobject.c
r8020 r8026 467 467 bool status; 468 468 469 object = pzPendingImfileRowAlloc("a string", -32, "a string", "a string", "a string" );469 object = pzPendingImfileRowAlloc("a string", -32, "a string", "a string", "a string", "a string"); 470 470 if (!object) { 471 471 exit(EXIT_FAILURE); … … 491 491 exit(EXIT_FAILURE); 492 492 } 493 if (strncmp(psMetadataLookupPtr(&status, md, "class"), "a string", MAX_STRING_LENGTH)) { 494 psFree(md); 495 exit(EXIT_FAILURE); 496 } 493 497 if (strncmp(psMetadataLookupPtr(&status, md, "class_id"), "a string", MAX_STRING_LENGTH)) { 494 498 psFree(md); … … 549 553 bool status; 550 554 551 object = newImfileRowAlloc("a string", "a string", "a string" );555 object = newImfileRowAlloc("a string", "a string", "a string", "a string"); 552 556 if (!object) { 553 557 exit(EXIT_FAILURE); … … 565 569 exit(EXIT_FAILURE); 566 570 } 571 if (strncmp(psMetadataLookupPtr(&status, md, "class"), "a string", MAX_STRING_LENGTH)) { 572 psFree(md); 573 exit(EXIT_FAILURE); 574 } 567 575 if (strncmp(psMetadataLookupPtr(&status, md, "class_id"), "a string", MAX_STRING_LENGTH)) { 568 576 psFree(md); … … 680 688 bool status; 681 689 682 object = rawImfileRowAlloc("a string", "a string", "a string", "a string" );690 object = rawImfileRowAlloc("a string", "a string", "a string", "a string", "a string"); 683 691 if (!object) { 684 692 exit(EXIT_FAILURE); … … 693 701 694 702 if (strncmp(psMetadataLookupPtr(&status, md, "exp_id"), "a string", MAX_STRING_LENGTH)) { 703 psFree(md); 704 exit(EXIT_FAILURE); 705 } 706 if (strncmp(psMetadataLookupPtr(&status, md, "class"), "a string", MAX_STRING_LENGTH)) { 695 707 psFree(md); 696 708 exit(EXIT_FAILURE); -
branches/jhoblitt/ippdb/tests/objectfrommetadata.c
r8020 r8026 693 693 exit(EXIT_FAILURE); 694 694 } 695 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "a string")) { 696 psFree(md); 697 exit(EXIT_FAILURE); 698 } 695 699 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) { 696 700 psFree(md); … … 722 726 exit(EXIT_FAILURE); 723 727 } 728 if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) { 729 psFree(object); 730 exit(EXIT_FAILURE); 731 } 724 732 if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) { 725 733 psFree(object); … … 801 809 exit(EXIT_FAILURE); 802 810 } 811 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "a string")) { 812 psFree(md); 813 exit(EXIT_FAILURE); 814 } 803 815 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) { 804 816 psFree(md); … … 822 834 exit(EXIT_FAILURE); 823 835 } 836 if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) { 837 psFree(object); 838 exit(EXIT_FAILURE); 839 } 824 840 if (strncmp(object->class_id, "a string", MAX_STRING_LENGTH)) { 825 841 psFree(object); … … 991 1007 exit(EXIT_FAILURE); 992 1008 } 1009 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class", 0, NULL, "a string")) { 1010 psFree(md); 1011 exit(EXIT_FAILURE); 1012 } 993 1013 if (!psMetadataAddStr(md, PS_LIST_TAIL, "class_id", 0, NULL, "a string")) { 994 1014 psFree(md); … … 1013 1033 1014 1034 if (strncmp(object->exp_id, "a string", MAX_STRING_LENGTH)) { 1035 psFree(object); 1036 exit(EXIT_FAILURE); 1037 } 1038 if (strncmp(object->class, "a string", MAX_STRING_LENGTH)) { 1015 1039 psFree(object); 1016 1040 exit(EXIT_FAILURE); -
branches/jhoblitt/ippdb/tests/pop.c
r8020 r8026 221 221 psS32 bytes; 222 222 char md5sum[256]; 223 char class_id[256]; 224 char uri[256]; 225 226 dbh = psDBInit("localhost", "test", NULL, "test"); 227 if (!dbh) { 228 exit(EXIT_FAILURE); 229 } 230 231 if (!pzPendingImfilePop(dbh, (char **)&exp_id, &bytes, (char **)&md5sum, (char **)&class_id, (char **)&uri)) { 223 char class[256]; 224 char class_id[256]; 225 char uri[256]; 226 227 dbh = psDBInit("localhost", "test", NULL, "test"); 228 if (!dbh) { 229 exit(EXIT_FAILURE); 230 } 231 232 if (!pzPendingImfilePop(dbh, (char **)&exp_id, &bytes, (char **)&md5sum, (char **)&class, (char **)&class_id, (char **)&uri)) { 232 233 exit(EXIT_FAILURE); 233 234 } … … 259 260 psDB *dbh; 260 261 char exp_id[256]; 261 char class_id[256]; 262 char uri[256]; 263 264 dbh = psDBInit("localhost", "test", NULL, "test"); 265 if (!dbh) { 266 exit(EXIT_FAILURE); 267 } 268 269 if (!newImfilePop(dbh, (char **)&exp_id, (char **)&class_id, (char **)&uri)) { 262 char class[256]; 263 char class_id[256]; 264 char uri[256]; 265 266 dbh = psDBInit("localhost", "test", NULL, "test"); 267 if (!dbh) { 268 exit(EXIT_FAILURE); 269 } 270 271 if (!newImfilePop(dbh, (char **)&exp_id, (char **)&class, (char **)&class_id, (char **)&uri)) { 270 272 exit(EXIT_FAILURE); 271 273 } … … 321 323 psDB *dbh; 322 324 char exp_id[256]; 323 char class_id[256]; 324 char uri[256]; 325 char stats[256]; 326 327 dbh = psDBInit("localhost", "test", NULL, "test"); 328 if (!dbh) { 329 exit(EXIT_FAILURE); 330 } 331 332 if (!rawImfilePop(dbh, (char **)&exp_id, (char **)&class_id, (char **)&uri, (char **)&stats)) { 325 char class[256]; 326 char class_id[256]; 327 char uri[256]; 328 char stats[256]; 329 330 dbh = psDBInit("localhost", "test", NULL, "test"); 331 if (!dbh) { 332 exit(EXIT_FAILURE); 333 } 334 335 if (!rawImfilePop(dbh, (char **)&exp_id, (char **)&class, (char **)&class_id, (char **)&uri, (char **)&stats)) { 333 336 exit(EXIT_FAILURE); 334 337 } -
trunk/ippdb/configure.ac
r8022 r8026 1 1 AC_PREREQ(2.59) 2 2 3 AC_INIT([ippdb], [0.0. 4], [pan-starrs.ifa.hawaii.edu])3 AC_INIT([ippdb], [0.0.5], [pan-starrs.ifa.hawaii.edu]) 4 4 AC_CONFIG_SRCDIR([ippdb.pc.in]) 5 5
Note:
See TracChangeset
for help on using the changeset viewer.
