IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28106 for trunk/ippTools/src


Ignore:
Timestamp:
May 26, 2010, 9:12:02 AM (16 years ago)
Author:
bills
Message:

Get the 'webrequest number' frm the database

Location:
trunk/ippTools/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/src/pstamptool.c

    r27969 r28106  
    5353static bool updatedependentMode(pxConfig *config);
    5454static bool revertdependentMode(pxConfig *config);
     55static bool getwebrequestnumMode(pxConfig *config);
    5556
    5657# define MODECASE(caseName, func) \
     
    9596        MODECASE(PSTAMPTOOL_MODE_UPDATEDEPENDENT, updatedependentMode);
    9697        MODECASE(PSTAMPTOOL_MODE_REVERTDEPENDENT, revertdependentMode);
     98        MODECASE(PSTAMPTOOL_MODE_GETWEBREQUESTNUM, getwebrequestnumMode);
    9799        default:
    98100            psAbort("invalid option (this should not happen)");
     
    13341336    return true;
    13351337}
     1338
     1339static bool getwebrequestnumMode(pxConfig *config)
     1340{
     1341    PS_ASSERT_PTR_NON_NULL(config, false);
     1342
     1343    if (!pstampWebRequestInsert(config->dbh, 0 )) {
     1344        psError(PS_ERR_UNKNOWN, false, "failed to insert pstampWebRequest");
     1345        return false;
     1346    }
     1347
     1348    psS64 req_id = psDBLastInsertID(config->dbh);
     1349
     1350    printf("%" PRId64 "\n", req_id);
     1351
     1352    return true;
     1353}
  • trunk/ippTools/src/pstamptool.h

    r27874 r28106  
    4848    PSTAMPTOOL_MODE_UPDATEDEPENDENT,
    4949    PSTAMPTOOL_MODE_REVERTDEPENDENT,
     50    PSTAMPTOOL_MODE_GETWEBREQUESTNUM,
    5051} pstamptoolMode;
    5152
  • trunk/ippTools/src/pstamptoolConfig.c

    r27874 r28106  
    235235    psMetadataAddBool(projectArgs, PS_LIST_TAIL, "-simple", 0, "use the simple output format", false);
    236236
     237    // -getwebrequestnum
     238    psMetadata *getwebrequestnumArgs = psMetadataAlloc();
     239
    237240    psMetadata *argSets = psMetadataAlloc();
    238241    psMetadata *modes = psMetadataAlloc();
     
    264267    PXOPT_ADD_MODE("-modproject",      "", PSTAMPTOOL_MODE_MODPROJECT, modprojectArgs);
    265268    PXOPT_ADD_MODE("-project",         "", PSTAMPTOOL_MODE_PROJECT,    projectArgs);
     269    PXOPT_ADD_MODE("-getwebrequestnum","", PSTAMPTOOL_MODE_GETWEBREQUESTNUM,   getwebrequestnumArgs);
    266270
    267271    if (!pxGetOptions(stderr, argc, argv, config, modes, argSets)) {
Note: See TracChangeset for help on using the changeset viewer.