Changeset 34081 for trunk/ippTools/src/pstamptool.c
- Timestamp:
- Jun 26, 2012, 11:19:48 AM (14 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
pstamptool.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src
- Property svn:mergeinfo changed
/branches/eam_branches/ipp-20120601/ippTools/src (added) merged: 34034,34047,34051-34052,34058-34059,34073
- Property svn:mergeinfo changed
-
trunk/ippTools/src/pstamptool.c
r33337 r34081 48 48 static bool stopdependentjobMode(pxConfig *config); 49 49 static bool revertjobMode(pxConfig *config); 50 51 # if (0) 52 // these are unused functions -- since they are 'static', this raises an warning 50 53 static bool addprojectMode(pxConfig *config); 51 54 static bool projectMode(pxConfig *config); … … 59 62 static bool listfileMode(pxConfig *config); 60 63 static bool deletefileMode(pxConfig *config); 64 # endif 61 65 62 66 # define MODECASE(caseName, func) \ … … 98 102 MODECASE(PSTAMPTOOL_MODE_STOPDEPENDENTJOB, stopdependentjobMode); 99 103 MODECASE(PSTAMPTOOL_MODE_REVERTJOB, revertjobMode); 104 # if (0) 100 105 MODECASE(PSTAMPTOOL_MODE_ADDPROJECT, addprojectMode); 101 106 MODECASE(PSTAMPTOOL_MODE_MODPROJECT, modprojectMode); … … 109 114 MODECASE(PSTAMPTOOL_MODE_LISTFILE, listfileMode); 110 115 MODECASE(PSTAMPTOOL_MODE_DELETEFILE, deletefileMode); 116 # endif 111 117 default: 112 118 psAbort("invalid option (this should not happen)"); … … 693 699 static bool addjobMode(pxConfig *config) 694 700 { 695 bool stampJob = false;701 bool stampJob = false; 696 702 697 703 PS_ASSERT_PTR_NON_NULL(config, false); … … 739 745 return false; 740 746 } 747 if (stampJob) { /* do something?? */ } 748 741 749 if (!pstampJobInsert(config->dbh, 742 750 0, // job_id … … 1044 1052 // it's an allowed arg because add_poll_args adds it 1045 1053 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 1054 if (limit) { /* do something?? */ } 1055 1046 1056 PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false); 1047 1057 … … 1051 1061 psString faultClause = psStringCopy(""); 1052 1062 if (!fault) { 1053 psStringAppend(&faultClause, " \nAND (pstampJob.fault < %d)", PSTAMP_FIRST_ERROR_CODE);1063 psStringAppend(&faultClause, " \nAND (pstampJob.fault < %d)", PSTAMP_FIRST_ERROR_CODE); 1054 1064 } 1055 1065 1056 1066 psString query = pxDataGet("pstamptool_revertjob.sql"); 1057 1067 if (!psListLength(where->list) && !all) { 1058 psFree(where);1059 psError(PXTOOLS_ERR_CONFIG, false, "search parameters or -all are required");1060 return false;1068 psFree(where); 1069 psError(PXTOOLS_ERR_CONFIG, false, "search parameters or -all are required"); 1070 return false; 1061 1071 } 1062 1072 if (psListLength(where->list)) { 1063 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);1064 psStringAppend(&query, " AND %s", whereClause);1065 psFree(whereClause);1073 psString whereClause = psDBGenerateWhereConditionSQL(where, NULL); 1074 psStringAppend(&query, " AND %s", whereClause); 1075 psFree(whereClause); 1066 1076 } 1067 1077 psFree(where); … … 1071 1081 psString faultCountClause = NULL; 1072 1082 if (clear_fault_count) { 1073 psStringAppend(&faultCountClause, "\n, pstampJob.fault_count = 0");1083 psStringAppend(&faultCountClause, "\n, pstampJob.fault_count = 0"); 1074 1084 } else { 1075 psStringAppend(&query, " AND pstampJob.fault_count < %d", PSTAMP_MAX_JOB_FAULTS);1085 psStringAppend(&query, " AND pstampJob.fault_count < %d", PSTAMP_MAX_JOB_FAULTS); 1076 1086 } 1077 1087 1078 1088 if (!p_psDBRunQueryF(config->dbh, query, faultCountClause, faultClause)) { 1079 psFree(faultCountClause);1080 psFree(faultClause);1081 psFree(query);1082 psError(PS_ERR_UNKNOWN, false, "database error");1083 return false;1089 psFree(faultCountClause); 1090 psFree(faultClause); 1091 psFree(query); 1092 psError(PS_ERR_UNKNOWN, false, "database error"); 1093 return false; 1084 1094 } 1085 1095 … … 1090 1100 return true; 1091 1101 } 1102 1103 # if (0) 1104 // these are unused functions 1092 1105 static bool addprojectMode(pxConfig *config) 1093 1106 { … … 1103 1116 1104 1117 if (!pstampProjectInsert(config->dbh, 1105 0,1106 name,1107 state,1108 imagedb,1109 dvodb,1110 camera,1111 telescope,1112 need_magic1113 )) {1118 0, 1119 name, 1120 state, 1121 imagedb, 1122 dvodb, 1123 camera, 1124 telescope, 1125 need_magic 1126 )) { 1114 1127 psError(PS_ERR_UNKNOWN, false, "database error"); 1115 1128 return false; … … 1448 1461 // it's an allowed arg because add_poll_args adds it 1449 1462 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 1463 if (limit) { /* do something?? */ } 1450 1464 1451 1465 if (!psListLength(where->list)) { … … 1628 1642 return true; 1629 1643 } 1644 # endif
Note:
See TracChangeset
for help on using the changeset viewer.
