- Timestamp:
- 10/11/04 13:51:34 (16 years ago)
- Branches:
- 4.0.1-hotfixes, cachetimestamps, develop, dpdk-ndag, etsilive, getfragoff, help, libtrace4, master, ndag_format, pfring, rc-4.0.1, rc-4.0.2, rc-4.0.3, rc-4.0.4, ringdecrementfix, ringperformance, ringtimestampfixes
- Children:
- ef36351d
- Parents:
- d896967f
- Location:
- examples/erfsplit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/erfsplit/erfsplit.c
rc773929 r4e92740 31 31 #include <stdio.h> 32 32 #include <stdlib.h> 33 #include <string.h> 33 34 #include <assert.h> 34 35 #include <string.h> … … 94 95 outfile = stdout; 95 96 } else { 96 if ((outfile = fopen(outputfilename," ab")) == 0) {97 if ((outfile = fopen(outputfilename,"wb")) == 0) { 97 98 perror("fopen"); 98 99 exit(0); … … 106 107 // set up input files 107 108 if ((trace = trace_create(inputuri)) == 0) { 109 printf("trace_create(%s) failed. Bad/nonexistant URI?\n",inputuri); 108 110 exit(0); 109 111 } … … 129 131 if (count > 0) { 130 132 number ++; 131 fwrite( buffer,psize,1,outfile);133 fwrite(packet.buffer,psize,1,outfile); 132 134 if (number > count) { 133 135 fprintf(stderr,"Maximum number of packets reached\n"); … … 149 151 } 150 152 trace_destroy(trace); 153 fclose(outfile); 151 154 return 0; 152 155 } -
examples/erfsplit/getdate.tab.c
rc773929 r4e92740 93 93 #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) 94 94 95 #if STDC_HEADERS || HAVE_STRING_H 96 # include <string.h> 97 #endif 95 #include <string.h> 98 96 99 97 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__ … … 186 184 187 185 188 #line 17 2"getdate.y"186 #line 170 "getdate.y" 189 187 #ifndef YYSTYPE 190 188 typedef union … … 278 276 static const short yyrline[] = 279 277 { 280 0, 18 9, 191, 194, 197, 199, 201, 203, 205, 207,281 2 10, 218, 225, 233, 240, 251, 254, 258, 261, 263,282 26 7, 273, 278, 285, 291, 311, 318, 326, 331, 337,283 34 2, 350, 360, 363, 366, 368, 370, 372, 374, 376,284 37 8, 380, 382, 384, 386, 388, 390, 392, 394, 396,285 39 8, 402, 438, 441278 0, 187, 189, 192, 195, 197, 199, 201, 203, 205, 279 208, 216, 223, 231, 238, 249, 252, 256, 259, 261, 280 265, 271, 276, 283, 289, 309, 316, 324, 329, 335, 281 340, 348, 358, 361, 364, 366, 368, 370, 372, 374, 282 376, 378, 380, 382, 384, 386, 388, 390, 392, 394, 283 396, 400, 436, 439 286 284 }; 287 285 #endif … … 1095 1093 1096 1094 case 3: 1095 #line 194 "getdate.y" 1096 { PC.times_seen++; } 1097 break; 1098 case 4: 1097 1099 #line 196 "getdate.y" 1098 { PC. times_seen++; }1099 break; 1100 case 4:1100 { PC.local_zones_seen++; } 1101 break; 1102 case 5: 1101 1103 #line 198 "getdate.y" 1102 { PC. local_zones_seen++; }1103 break; 1104 case 5:1104 { PC.zones_seen++; } 1105 break; 1106 case 6: 1105 1107 #line 200 "getdate.y" 1106 { PC. zones_seen++; }1107 break; 1108 case 6:1108 { PC.dates_seen++; } 1109 break; 1110 case 7: 1109 1111 #line 202 "getdate.y" 1110 { PC.da tes_seen++; }1111 break; 1112 case 7:1112 { PC.days_seen++; } 1113 break; 1114 case 8: 1113 1115 #line 204 "getdate.y" 1114 { PC.days_seen++; }1115 break;1116 case 8:1117 #line 206 "getdate.y"1118 1116 { PC.rels_seen++; } 1119 1117 break; 1120 1118 case 10: 1121 #line 21 2"getdate.y"1119 #line 210 "getdate.y" 1122 1120 { 1123 1121 PC.hour = yyvsp[-1].textintval.value; … … 1128 1126 break; 1129 1127 case 11: 1130 #line 21 9"getdate.y"1128 #line 217 "getdate.y" 1131 1129 { 1132 1130 PC.hour = yyvsp[-3].textintval.value; … … 1137 1135 break; 1138 1136 case 12: 1139 #line 22 6"getdate.y"1137 #line 224 "getdate.y" 1140 1138 { 1141 1139 PC.hour = yyvsp[-3].textintval.value; … … 1147 1145 break; 1148 1146 case 13: 1149 #line 23 4"getdate.y"1147 #line 232 "getdate.y" 1150 1148 { 1151 1149 PC.hour = yyvsp[-5].textintval.value; … … 1156 1154 break; 1157 1155 case 14: 1158 #line 2 41"getdate.y"1156 #line 239 "getdate.y" 1159 1157 { 1160 1158 PC.hour = yyvsp[-5].textintval.value; … … 1167 1165 break; 1168 1166 case 15: 1167 #line 251 "getdate.y" 1168 { PC.local_isdst = yyvsp[0].intval; } 1169 break; 1170 case 16: 1169 1171 #line 253 "getdate.y" 1170 { PC.local_isdst = yyvsp[0].intval; }1171 break;1172 case 16:1173 #line 255 "getdate.y"1174 1172 { PC.local_isdst = yyvsp[-1].intval < 0 ? 1 : yyvsp[-1].intval + 1; } 1175 1173 break; 1176 1174 case 17: 1175 #line 258 "getdate.y" 1176 { PC.time_zone = yyvsp[0].intval; } 1177 break; 1178 case 18: 1177 1179 #line 260 "getdate.y" 1178 { PC.time_zone = yyvsp[0].intval ; }1179 break; 1180 case 1 8:1180 { PC.time_zone = yyvsp[0].intval + 60; } 1181 break; 1182 case 19: 1181 1183 #line 262 "getdate.y" 1182 { PC.time_zone = yyvsp[0].intval + 60; }1183 break;1184 case 19:1185 #line 264 "getdate.y"1186 1184 { PC.time_zone = yyvsp[-1].intval + 60; } 1187 1185 break; 1188 1186 case 20: 1189 #line 26 9"getdate.y"1187 #line 267 "getdate.y" 1190 1188 { 1191 1189 PC.day_ordinal = 1; … … 1194 1192 break; 1195 1193 case 21: 1196 #line 27 4"getdate.y"1194 #line 272 "getdate.y" 1197 1195 { 1198 1196 PC.day_ordinal = 1; … … 1201 1199 break; 1202 1200 case 22: 1203 #line 27 9"getdate.y"1201 #line 277 "getdate.y" 1204 1202 { 1205 1203 PC.day_ordinal = yyvsp[-1].textintval.value; … … 1208 1206 break; 1209 1207 case 23: 1210 #line 28 7"getdate.y"1208 #line 285 "getdate.y" 1211 1209 { 1212 1210 PC.month = yyvsp[-2].textintval.value; … … 1215 1213 break; 1216 1214 case 24: 1217 #line 29 2"getdate.y"1215 #line 290 "getdate.y" 1218 1216 { 1219 1217 /* Interpret as YYYY/MM/DD if the first value has 4 or more digits, … … 1237 1235 break; 1238 1236 case 25: 1239 #line 31 2"getdate.y"1237 #line 310 "getdate.y" 1240 1238 { 1241 1239 /* ISO 8601 format. YYYY-MM-DD. */ … … 1246 1244 break; 1247 1245 case 26: 1248 #line 31 9"getdate.y"1246 #line 317 "getdate.y" 1249 1247 { 1250 1248 /* e.g. 17-JUN-1992. */ … … 1256 1254 break; 1257 1255 case 27: 1258 #line 32 7"getdate.y"1256 #line 325 "getdate.y" 1259 1257 { 1260 1258 PC.month = yyvsp[-1].intval; … … 1263 1261 break; 1264 1262 case 28: 1265 #line 33 2"getdate.y"1263 #line 330 "getdate.y" 1266 1264 { 1267 1265 PC.month = yyvsp[-3].intval; … … 1271 1269 break; 1272 1270 case 29: 1273 #line 33 8"getdate.y"1271 #line 336 "getdate.y" 1274 1272 { 1275 1273 PC.day = yyvsp[-1].textintval.value; … … 1278 1276 break; 1279 1277 case 30: 1280 #line 34 3"getdate.y"1278 #line 341 "getdate.y" 1281 1279 { 1282 1280 PC.day = yyvsp[-2].textintval.value; … … 1286 1284 break; 1287 1285 case 31: 1288 #line 35 2"getdate.y"1286 #line 350 "getdate.y" 1289 1287 { 1290 1288 PC.rel_seconds = -PC.rel_seconds; … … 1297 1295 break; 1298 1296 case 33: 1297 #line 363 "getdate.y" 1298 { PC.rel_year += yyvsp[-1].textintval.value * yyvsp[0].intval; } 1299 break; 1300 case 34: 1299 1301 #line 365 "getdate.y" 1300 1302 { PC.rel_year += yyvsp[-1].textintval.value * yyvsp[0].intval; } 1301 1303 break; 1302 case 3 4:1304 case 35: 1303 1305 #line 367 "getdate.y" 1304 { PC.rel_year += yyvsp[ -1].textintval.value * yyvsp[0].intval; }1305 break; 1306 case 3 5:1306 { PC.rel_year += yyvsp[0].intval; } 1307 break; 1308 case 36: 1307 1309 #line 369 "getdate.y" 1308 { PC.rel_ year +=yyvsp[0].intval; }1309 break; 1310 case 3 6:1310 { PC.rel_month += yyvsp[-1].textintval.value * yyvsp[0].intval; } 1311 break; 1312 case 37: 1311 1313 #line 371 "getdate.y" 1312 1314 { PC.rel_month += yyvsp[-1].textintval.value * yyvsp[0].intval; } 1313 1315 break; 1314 case 3 7:1316 case 38: 1315 1317 #line 373 "getdate.y" 1316 { PC.rel_month += yyvsp[ -1].textintval.value * yyvsp[0].intval; }1317 break; 1318 case 3 8:1318 { PC.rel_month += yyvsp[0].intval; } 1319 break; 1320 case 39: 1319 1321 #line 375 "getdate.y" 1320 { PC.rel_ month +=yyvsp[0].intval; }1321 break; 1322 case 39:1322 { PC.rel_day += yyvsp[-1].textintval.value * yyvsp[0].intval; } 1323 break; 1324 case 40: 1323 1325 #line 377 "getdate.y" 1324 1326 { PC.rel_day += yyvsp[-1].textintval.value * yyvsp[0].intval; } 1325 1327 break; 1326 case 4 0:1328 case 41: 1327 1329 #line 379 "getdate.y" 1328 { PC.rel_day += yyvsp[ -1].textintval.value * yyvsp[0].intval; }1329 break; 1330 case 4 1:1330 { PC.rel_day += yyvsp[0].intval; } 1331 break; 1332 case 42: 1331 1333 #line 381 "getdate.y" 1332 { PC.rel_ day +=yyvsp[0].intval; }1333 break; 1334 case 4 2:1334 { PC.rel_hour += yyvsp[-1].textintval.value * yyvsp[0].intval; } 1335 break; 1336 case 43: 1335 1337 #line 383 "getdate.y" 1336 1338 { PC.rel_hour += yyvsp[-1].textintval.value * yyvsp[0].intval; } 1337 1339 break; 1338 case 4 3:1340 case 44: 1339 1341 #line 385 "getdate.y" 1340 { PC.rel_hour += yyvsp[ -1].textintval.value * yyvsp[0].intval; }1341 break; 1342 case 4 4:1342 { PC.rel_hour += yyvsp[0].intval; } 1343 break; 1344 case 45: 1343 1345 #line 387 "getdate.y" 1344 { PC.rel_ hour +=yyvsp[0].intval; }1345 break; 1346 case 4 5:1346 { PC.rel_minutes += yyvsp[-1].textintval.value * yyvsp[0].intval; } 1347 break; 1348 case 46: 1347 1349 #line 389 "getdate.y" 1348 1350 { PC.rel_minutes += yyvsp[-1].textintval.value * yyvsp[0].intval; } 1349 1351 break; 1350 case 4 6:1352 case 47: 1351 1353 #line 391 "getdate.y" 1352 { PC.rel_minutes += yyvsp[ -1].textintval.value * yyvsp[0].intval; }1353 break; 1354 case 4 7:1354 { PC.rel_minutes += yyvsp[0].intval; } 1355 break; 1356 case 48: 1355 1357 #line 393 "getdate.y" 1356 { PC.rel_ minutes +=yyvsp[0].intval; }1357 break; 1358 case 4 8:1358 { PC.rel_seconds += yyvsp[-1].textintval.value * yyvsp[0].intval; } 1359 break; 1360 case 49: 1359 1361 #line 395 "getdate.y" 1360 1362 { PC.rel_seconds += yyvsp[-1].textintval.value * yyvsp[0].intval; } 1361 1363 break; 1362 case 49:1364 case 50: 1363 1365 #line 397 "getdate.y" 1364 { PC.rel_seconds += yyvsp[-1].textintval.value * yyvsp[0].intval; }1365 break;1366 case 50:1367 #line 399 "getdate.y"1368 1366 { PC.rel_seconds += yyvsp[0].intval; } 1369 1367 break; 1370 1368 case 51: 1371 #line 40 4"getdate.y"1369 #line 402 "getdate.y" 1372 1370 { 1373 1371 if (PC.dates_seen … … 1404 1402 break; 1405 1403 case 52: 1404 #line 438 "getdate.y" 1405 { yyval.intval = MER24; } 1406 break; 1407 case 53: 1406 1408 #line 440 "getdate.y" 1407 { yyval.intval = MER24; }1408 break;1409 case 53:1410 #line 442 "getdate.y"1411 1409 { yyval.intval = yyvsp[0].intval; } 1412 1410 break; … … 1645 1643 return yyresult; 1646 1644 } 1647 #line 44 5"getdate.y"1645 #line 443 "getdate.y" 1648 1646 1649 1647 -
examples/erfsplit/getdate.y
rc773929 r4e92740 70 70 #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) 71 71 72 #if STDC_HEADERS || HAVE_STRING_H 73 # include <string.h> 74 #endif 72 #include <string.h> 75 73 76 74 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 8) || __STRICT_ANSI__
Note: See TracChangeset
for help on using the changeset viewer.