IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Oct 13, 2006, 4:35:39 PM (20 years ago)
Author:
Paul Price
Message:

Adding const where appropriate. Adding doxygen documentation to header files. Removing comments on functions defined in the header file, so that there's only a single source.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/concepts/pmConceptsPhotcode.c

    r8815 r9572  
    44
    55#include <stdio.h>
     6#include <string.h>
    67#include <pslib.h>
    78
    89#include "pmConceptsPhotcode.h"
    910
    10 char *pmConceptsPhotcodeForView (pmConfig *config, pmFPAfile *file, pmFPAview *view)
     11psString pmConceptsPhotcodeForView(pmConfig *config, pmFPAfile *file, pmFPAview *view)
    1112{
     13    PS_ASSERT_PTR_NON_NULL(config, NULL);
     14    PS_ASSERT_PTR_NON_NULL(file, NULL);
     15    PS_ASSERT_PTR_NON_NULL(view, NULL);
    1216
    1317    if (view->chip < -1) {
    14         psError(PS_ERR_IO, true, "photcodes undefined for FPA: defined by chip\n");
     18        psError(PS_ERR_IO, true, "Photcodes undefined for FPA: defined by chip\n");
    1519        return NULL;
    1620    }
    1721
    1822    // select recipe options supplied on command line
    19     psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, "PHASE2");
    20     if (recipe == NULL) {
    21         psError(PS_ERR_IO, true, "recipe PHASE2 not found\n");
     23    bool mdok;                          // Status of MD lookup
     24    psMetadata *recipe  = psMetadataLookupPtr(&mdok, config->recipes, "PHASE2");
     25    if (!mdok || !recipe) {
     26        psError(PS_ERR_IO, true, "Recipe PHASE2 not found\n");
    2227        return NULL;
    2328    }
    2429
    2530    // select photcode rule from recipe
    26     char *rule = psMetadataLookupStr (NULL, recipe, "PHOTCODE.RULE");
    27     if (rule == NULL) {
     31    char *rule = psMetadataLookupStr(&mdok, recipe, "PHOTCODE.RULE");
     32    if (!mdok || !rule || strlen(rule) == 0) {
    2833        psError(PS_ERR_IO, true, "PHOTCODE.RULE not found in PHASE2 recipe\n");
    2934        return NULL;
     
    3136
    3237    // convert rule to real photcode
    33     char *photcode = pmFPAfileNameFromRule (rule, file, view);
     38    psString photcode = pmFPAfileNameFromRule(rule, file, view);
    3439
    3540    return photcode;
Note: See TracChangeset for help on using the changeset viewer.