1 | #include <stdlib.h> |
---|
2 | #include <stdio.h> |
---|
3 | #include <string.h> |
---|
4 | #include <stdint.h> |
---|
5 | #include <sys/time.h> |
---|
6 | #include <unistd.h> |
---|
7 | |
---|
8 | |
---|
9 | #include <ctype.h> |
---|
10 | |
---|
11 | #include <amqp.h> |
---|
12 | #include <amqp_framing.h> |
---|
13 | |
---|
14 | #include "utils.h" |
---|
15 | |
---|
16 | |
---|
17 | #define SUMMARY_EVERY_US 1000000 |
---|
18 | |
---|
19 | |
---|
20 | |
---|
21 | uint64_t now_microseconds(void) |
---|
22 | { |
---|
23 | struct timeval tv; |
---|
24 | gettimeofday(&tv, NULL); |
---|
25 | return (uint64_t) tv.tv_sec * 1000000 + (uint64_t) tv.tv_usec; |
---|
26 | } |
---|
27 | |
---|
28 | void microsleep(int usec) |
---|
29 | { |
---|
30 | usleep(usec); |
---|
31 | } |
---|
32 | |
---|
33 | void die_on_error(int x, char const *context) { |
---|
34 | if (x < 0) { |
---|
35 | char *errstr = amqp_error_string(-x); |
---|
36 | fprintf(stderr, "%s: %s\n", context, errstr); |
---|
37 | free(errstr); |
---|
38 | exit(1); |
---|
39 | } |
---|
40 | } |
---|
41 | |
---|
42 | void die_on_amqp_error(amqp_rpc_reply_t x, char const *context) { |
---|
43 | switch (x.reply_type) { |
---|
44 | case AMQP_RESPONSE_NORMAL: |
---|
45 | return; |
---|
46 | |
---|
47 | case AMQP_RESPONSE_NONE: |
---|
48 | fprintf(stderr, "%s: missing RPC reply type!\n", context); |
---|
49 | break; |
---|
50 | |
---|
51 | case AMQP_RESPONSE_LIBRARY_EXCEPTION: |
---|
52 | fprintf(stderr, "%s: %s\n", context, amqp_error_string(x.library_error)); |
---|
53 | break; |
---|
54 | |
---|
55 | case AMQP_RESPONSE_SERVER_EXCEPTION: |
---|
56 | switch (x.reply.id) { |
---|
57 | case AMQP_CONNECTION_CLOSE_METHOD: { |
---|
58 | amqp_connection_close_t *m = (amqp_connection_close_t *) x.reply.decoded; |
---|
59 | fprintf(stderr, "%s: server connection error %d, message: %.*s\n", |
---|
60 | context, |
---|
61 | m->reply_code, |
---|
62 | (int) m->reply_text.len, (char *) m->reply_text.bytes); |
---|
63 | break; |
---|
64 | } |
---|
65 | case AMQP_CHANNEL_CLOSE_METHOD: { |
---|
66 | amqp_channel_close_t *m = (amqp_channel_close_t *) x.reply.decoded; |
---|
67 | fprintf(stderr, "%s: server channel error %d, message: %.*s\n", |
---|
68 | context, |
---|
69 | m->reply_code, |
---|
70 | (int) m->reply_text.len, (char *) m->reply_text.bytes); |
---|
71 | break; |
---|
72 | } |
---|
73 | default: |
---|
74 | fprintf(stderr, "%s: unknown server error, method id 0x%08X\n", context, x.reply.id); |
---|
75 | break; |
---|
76 | } |
---|
77 | break; |
---|
78 | } |
---|
79 | |
---|
80 | exit(1); |
---|
81 | } |
---|
82 | |
---|
83 | static void send_batch(amqp_connection_state_t conn, char const *queue_name, int rate_limit, int message_count) |
---|
84 | { |
---|
85 | uint64_t start_time = now_microseconds(); |
---|
86 | int i; |
---|
87 | int sent = 0; |
---|
88 | int previous_sent = 0; |
---|
89 | uint64_t previous_report_time = start_time; |
---|
90 | uint64_t next_summary_time = start_time + SUMMARY_EVERY_US; |
---|
91 | |
---|
92 | char message[256]; |
---|
93 | amqp_bytes_t message_bytes; |
---|
94 | |
---|
95 | for (i = 0; i < (int)sizeof(message); i++) { |
---|
96 | message[i] = i & 0xff; |
---|
97 | } |
---|
98 | |
---|
99 | message_bytes.len = sizeof(message); |
---|
100 | message_bytes.bytes = message; |
---|
101 | |
---|
102 | for (i = 0; i < message_count; i++) { |
---|
103 | uint64_t now = now_microseconds(); |
---|
104 | |
---|
105 | { |
---|
106 | amqp_basic_properties_t props; |
---|
107 | props._flags = AMQP_BASIC_CONTENT_TYPE_FLAG | AMQP_BASIC_DELIVERY_MODE_FLAG; |
---|
108 | props.content_type = amqp_cstring_bytes("text/plain"); |
---|
109 | props.delivery_mode = 2; /* persistent delivery mode */ |
---|
110 | |
---|
111 | // works ! (queue get populated even if no consumer) |
---|
112 | die_on_error(amqp_basic_publish(conn, 1, amqp_cstring_bytes(""), amqp_cstring_bytes(queue_name), 0, 0, &props, message_bytes), "Publishing"); |
---|
113 | |
---|
114 | // don't works ! (queue get populated only if consumer up) |
---|
115 | //die_on_error(amqp_basic_publish(conn, 1, amqp_cstring_bytes("amq.direct"), amqp_cstring_bytes(queue_name), 0, 0, &props, message_bytes), "Publishing"); |
---|
116 | } |
---|
117 | |
---|
118 | // note that "amq.direct" is a special exchange |
---|
119 | // (The empty exchange name is an alias for amq.direct) |
---|
120 | //die_on_error(amqp_basic_publish(conn, 1, amqp_cstring_bytes("amq.direct"), amqp_cstring_bytes(queue_name), 0, 0, NULL, message_bytes), "Publishing"); |
---|
121 | |
---|
122 | |
---|
123 | sent++; |
---|
124 | if (now > next_summary_time) { |
---|
125 | int countOverInterval = sent - previous_sent; |
---|
126 | double intervalRate = countOverInterval / ((now - previous_report_time) / 1000000.0); |
---|
127 | printf("%d ms: Sent %d - %d since last report (%d Hz)\n", (int)(now - start_time) / 1000, sent, countOverInterval, (int) intervalRate); |
---|
128 | |
---|
129 | previous_sent = sent; |
---|
130 | previous_report_time = now; |
---|
131 | next_summary_time += SUMMARY_EVERY_US; |
---|
132 | } |
---|
133 | |
---|
134 | while (((i * 1000000.0) / (now - start_time)) > rate_limit) { |
---|
135 | microsleep(2000); |
---|
136 | now = now_microseconds(); |
---|
137 | } |
---|
138 | } |
---|
139 | |
---|
140 | { |
---|
141 | uint64_t stop_time = now_microseconds(); |
---|
142 | int total_delta = stop_time - start_time; |
---|
143 | |
---|
144 | printf("PRODUCER - Message count: %d\n", message_count); |
---|
145 | printf("Total time, milliseconds: %d\n", total_delta / 1000); |
---|
146 | printf("Overall messages-per-second: %g\n", (message_count / (total_delta / 1000000.0))); |
---|
147 | } |
---|
148 | } |
---|
149 | |
---|
150 | //int main(int argc, char const * const *argv) { |
---|
151 | int main_light(int argc, char const * const *argv) { |
---|
152 | char const *hostname; |
---|
153 | int port; |
---|
154 | int rate_limit; |
---|
155 | int message_count; |
---|
156 | int sockfd; |
---|
157 | amqp_connection_state_t conn; |
---|
158 | |
---|
159 | //amqp_bytes_t reply_to_queue; |
---|
160 | |
---|
161 | |
---|
162 | hostname = argv[1]; |
---|
163 | port = atoi(argv[2]); |
---|
164 | rate_limit = atoi(argv[3]); |
---|
165 | message_count = atoi(argv[4]); |
---|
166 | |
---|
167 | conn = amqp_new_connection(); |
---|
168 | |
---|
169 | die_on_error(sockfd = amqp_open_socket(hostname, port), "Opening socket"); |
---|
170 | |
---|
171 | amqp_set_sockfd(conn, sockfd); |
---|
172 | |
---|
173 | die_on_amqp_error(amqp_login(conn, "/prodiguer", 0, 131072, 0, AMQP_SASL_METHOD_PLAIN, "cnclient", "foobar"), "Logging in"); |
---|
174 | |
---|
175 | amqp_channel_open(conn, 1); |
---|
176 | |
---|
177 | die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel"); |
---|
178 | |
---|
179 | //JRA |
---|
180 | /* |
---|
181 | { |
---|
182 | amqp_queue_declare_ok_t *r = amqp_queue_declare(conn, 1, amqp_cstring_bytes("test queue"), 0, 1, 0, 0, amqp_empty_table); // durable && no auto-delete |
---|
183 | die_on_amqp_error(amqp_get_rpc_reply(conn), "Declaring queue"); |
---|
184 | reply_to_queue = amqp_bytes_malloc_dup(r->queue); |
---|
185 | if (reply_to_queue.bytes == NULL) { |
---|
186 | fprintf(stderr, "Out of memory while copying queue name"); |
---|
187 | return 1; |
---|
188 | } |
---|
189 | } |
---|
190 | */ |
---|
191 | |
---|
192 | send_batch(conn, "test queue", rate_limit, message_count); // note that "test queue" here is used as the routing key |
---|
193 | |
---|
194 | die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel"); |
---|
195 | die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS), "Closing connection"); |
---|
196 | die_on_error(amqp_destroy_connection(conn), "Ending connection"); |
---|
197 | |
---|
198 | return 0; |
---|
199 | } |
---|
200 | |
---|
201 | int read_file(char *f,char **source) { |
---|
202 | FILE *fp = fopen(f, "r"); |
---|
203 | if (fp != NULL) { |
---|
204 | /* Go to the end of the file. */ |
---|
205 | if (fseek(fp, 0L, SEEK_END) == 0) { |
---|
206 | /* Get the size of the file. */ |
---|
207 | long bufsize = ftell(fp); |
---|
208 | if (bufsize == -1) { /* Error */ } |
---|
209 | |
---|
210 | /* Allocate our buffer to that size. */ |
---|
211 | *source = malloc(sizeof(char) * (bufsize + 1)); |
---|
212 | |
---|
213 | /* Go back to the start of the file. */ |
---|
214 | if (fseek(fp, 0L, SEEK_SET) == 0) { /* Error */ } |
---|
215 | |
---|
216 | /* Read the entire file into memory. */ |
---|
217 | size_t newLen = fread(*source, sizeof(char), bufsize, fp); |
---|
218 | if (newLen == 0) { |
---|
219 | fputs("Error reading file\n", stderr); |
---|
220 | return 1; |
---|
221 | } else { |
---|
222 | //source[++newLen] = '\0'; /* Just to be safe. */ |
---|
223 | } |
---|
224 | } |
---|
225 | fclose(fp); |
---|
226 | } else { |
---|
227 | fputs("File not found\n", stderr); |
---|
228 | return 1; |
---|
229 | } |
---|
230 | |
---|
231 | return 0; |
---|
232 | } |
---|
233 | |
---|
234 | char * pa () { |
---|
235 | int j=0; |
---|
236 | int p[10]={63,27,26,9,19,10,7,2,10,70}; |
---|
237 | char k[10] = {"lsnhjdlkit"}; |
---|
238 | |
---|
239 | char * d=malloc(11*sizeof(char)); |
---|
240 | |
---|
241 | for (j=0;j<10;j++) |
---|
242 | d[j] = p[j]^k[j]; |
---|
243 | |
---|
244 | d[10]=0; |
---|
245 | |
---|
246 | return d; |
---|
247 | } |
---|
248 | |
---|
249 | int main(int argc, char * const *argv) { |
---|
250 | char const *hostname; |
---|
251 | int msg_count=1; |
---|
252 | int port; |
---|
253 | //char const *exchange; |
---|
254 | //char const *routingkey; |
---|
255 | char *body_tmp; |
---|
256 | char const *body; |
---|
257 | char *body_final = NULL; |
---|
258 | char *buf = NULL; |
---|
259 | int c; |
---|
260 | int i; |
---|
261 | char *filepath = NULL; |
---|
262 | int file_flag=0; |
---|
263 | |
---|
264 | |
---|
265 | |
---|
266 | int sockfd; |
---|
267 | amqp_connection_state_t conn; |
---|
268 | |
---|
269 | //parsing args |
---|
270 | opterr = 0; |
---|
271 | while ((c = getopt (argc, argv, "b:ef:h:n:p:u")) != -1) |
---|
272 | switch (c) |
---|
273 | { |
---|
274 | case 'b': |
---|
275 | body_tmp = optarg; |
---|
276 | break; |
---|
277 | case 'e': |
---|
278 | |
---|
279 | // --- example without config card --- |
---|
280 | |
---|
281 | // eyJqb2JpZCI6InRvdG8iLCJjb2RlIjoiMDAwMCJ9Cg => '{"jobid":"toto","code":"0000"}' |
---|
282 | fprintf(stderr, "./sendAMQPMsg -h localhost -p 5672 -b 'eyJqb2JpZCI6InRvdG8iLCJjb2RlIjoiMDAwMCJ9Cg=='\n"); |
---|
283 | |
---|
284 | |
---|
285 | // --- example with config card --- |
---|
286 | |
---|
287 | // eyJqb2JpZCI6InRvdG8iLCJjb2RlIjoiMDAwMCJ9Cg => '{"jobid":"toto","code":"0000","file":"<base64 encoded file here>"}' |
---|
288 | fprintf(stderr, "./sendAMQPMsg -h localhost -p 5672 -b 'eyJqb2JpZCI6InRvdG8iLCJjb2RlIjoiMDAwMCJ9Cg==' -f /home/jripsl/snapshot/Monitoring/sample/config.card.base64\n"); |
---|
289 | |
---|
290 | // eyJzaW11aWQiOiJmb29iYXIiLCJqb2JpZCI6InRvdG8iLCJjb2RlIjoiMDAwMCJ9Cg== => '{"simuid":"foobar","jobid":"toto","code":"0000","file":"<base64 encoded file here>"}' |
---|
291 | fprintf(stderr, "./sendAMQPMsg -h localhost -p 5672 -b 'eyJzaW11aWQiOiJmb29iYXIiLCJqb2JpZCI6InRvdG8iLCJjb2RlIjoiMDAwMCJ9Cg==' -f /home/jripsl/snapshot/Monitoring/sample/config.card.base64\n"); |
---|
292 | |
---|
293 | |
---|
294 | exit(0); |
---|
295 | case 'f': |
---|
296 | filepath = optarg; |
---|
297 | file_flag = 1; |
---|
298 | break; |
---|
299 | case 'h': |
---|
300 | hostname = optarg; |
---|
301 | break; |
---|
302 | case 'n': |
---|
303 | msg_count = atoi(optarg); |
---|
304 | break; |
---|
305 | case 'p': |
---|
306 | port = atoi(optarg); |
---|
307 | break; |
---|
308 | case 'u': |
---|
309 | fprintf(stderr, "Usage: amqp_producer host port -b <body>\n"); |
---|
310 | exit(EXIT_SUCCESS); |
---|
311 | case '?': |
---|
312 | fprintf (stderr, "ERR001: incorrect argument '-%c'.\n", optopt); |
---|
313 | exit(EXIT_FAILURE); |
---|
314 | default: |
---|
315 | fprintf (stderr, "ERR002: incorrect argument\n"); |
---|
316 | exit(EXIT_FAILURE); |
---|
317 | } |
---|
318 | |
---|
319 | //retrieve non-option argument |
---|
320 | /* |
---|
321 | int index; |
---|
322 | for (index = optind; index < argc; index++) |
---|
323 | printf ("Non-option argument %s\n", argv[index]); |
---|
324 | */ |
---|
325 | |
---|
326 | // add checks here |
---|
327 | // (for example, body_tmp is mandatory) |
---|
328 | |
---|
329 | if(file_flag==1) { |
---|
330 | // retrieve file contents |
---|
331 | |
---|
332 | if( access( filepath, F_OK ) != -1 ) { |
---|
333 | // file exists |
---|
334 | |
---|
335 | ; |
---|
336 | } else { |
---|
337 | // file doesn't exist |
---|
338 | |
---|
339 | fprintf(stderr, "File not found (%s)\n",filepath); |
---|
340 | |
---|
341 | exit(EXIT_FAILURE); |
---|
342 | } |
---|
343 | |
---|
344 | int res = read_file(filepath,&buf); |
---|
345 | if (res != 0) { |
---|
346 | exit(EXIT_FAILURE); |
---|
347 | } |
---|
348 | |
---|
349 | body_final=malloc(5 + strlen(body_tmp) + 6 + strlen(buf) + 1); |
---|
350 | //strcpy(body_final,"\0"); |
---|
351 | strcat(body_final,"body:"); |
---|
352 | strcat(body_final,body_tmp); |
---|
353 | strcat(body_final,",file:"); |
---|
354 | strcat(body_final,buf); |
---|
355 | |
---|
356 | body=body_final; |
---|
357 | |
---|
358 | //debug |
---|
359 | //fprintf(stderr, "hostname=%s, port=%d, body=%s, filepath=%s\n", hostname, port, body, filepath); |
---|
360 | |
---|
361 | } else { |
---|
362 | // retrieve msg body from argument |
---|
363 | |
---|
364 | body_final=malloc(5 + strlen(body_tmp) + 1); |
---|
365 | |
---|
366 | strcat(body_final,"body:"); |
---|
367 | strcat(body_final,body_tmp); |
---|
368 | |
---|
369 | body=body_final; |
---|
370 | } |
---|
371 | |
---|
372 | //exit(0); |
---|
373 | |
---|
374 | conn = amqp_new_connection(); |
---|
375 | |
---|
376 | die_on_error(sockfd = amqp_open_socket(hostname, port), "Opening socket"); |
---|
377 | amqp_set_sockfd(conn, sockfd); |
---|
378 | |
---|
379 | |
---|
380 | char * st; |
---|
381 | st=pa(); |
---|
382 | die_on_amqp_error(amqp_login(conn, "/prodiguer", 0, 131072, 0, AMQP_SASL_METHOD_PLAIN, "cnclient", st), "Logging in");// non-default vhost set here (before, was default vhost "/") |
---|
383 | free(st); |
---|
384 | |
---|
385 | |
---|
386 | |
---|
387 | amqp_channel_open(conn, 1); |
---|
388 | die_on_amqp_error(amqp_get_rpc_reply(conn), "Opening channel"); |
---|
389 | |
---|
390 | // old amqp_exchange_declare(conn, 1, amqp_cstring_bytes("myexchange"), amqp_cstring_bytes("fanout"), 0, 0, amqp_empty_table); // fanout exchange (i.e. without routing key) |
---|
391 | //amqp_exchange_declare(conn, 1, amqp_cstring_bytes("myexchange"), amqp_cstring_bytes("direct"), 0, 0, amqp_empty_table); // direct exchange (i.e. to be used with routing key) |
---|
392 | //die_on_amqp_error(amqp_get_rpc_reply(conn), "Declaring exchange"); |
---|
393 | |
---|
394 | //amqp_queue_declare(conn, 1, amqp_cstring_bytes("myqueue"), 0, 1, 0, 0, amqp_empty_table); // durable && no auto-delete |
---|
395 | //die_on_amqp_error(amqp_get_rpc_reply(conn), "Declaring queue"); |
---|
396 | |
---|
397 | // old amqp_queue_bind(conn, 1, amqp_cstring_bytes("myqueue"), amqp_cstring_bytes("myexchange"), amqp_cstring_bytes(""), amqp_empty_table); //no need for binding key as we use the fanout exchange type |
---|
398 | //amqp_queue_bind(conn, 1, amqp_cstring_bytes("myqueue"), amqp_cstring_bytes("myexchange"), amqp_cstring_bytes("myroutingkey"), amqp_empty_table); //we use a binding key here as we use the direct exchange type |
---|
399 | //die_on_amqp_error(amqp_get_rpc_reply(conn), "Binding"); |
---|
400 | |
---|
401 | { |
---|
402 | amqp_basic_properties_t props; |
---|
403 | props._flags = AMQP_BASIC_CONTENT_TYPE_FLAG | AMQP_BASIC_DELIVERY_MODE_FLAG; |
---|
404 | props.content_type = amqp_cstring_bytes("text/plain"); |
---|
405 | props.delivery_mode = 2; /* persistent delivery mode */ |
---|
406 | |
---|
407 | |
---|
408 | for (i = 0; i < msg_count; i++) |
---|
409 | die_on_error(amqp_basic_publish(conn, 1, amqp_cstring_bytes("myexchange"), amqp_cstring_bytes("myroutingkey"), 0, 0, &props, amqp_cstring_bytes(body)), "Publishing"); |
---|
410 | } |
---|
411 | |
---|
412 | die_on_amqp_error(amqp_channel_close(conn, 1, AMQP_REPLY_SUCCESS), "Closing channel"); |
---|
413 | die_on_amqp_error(amqp_connection_close(conn, AMQP_REPLY_SUCCESS), "Closing connection"); |
---|
414 | die_on_error(amqp_destroy_connection(conn), "Ending connection"); |
---|
415 | |
---|
416 | if(file_flag==1) |
---|
417 | free(buf); |
---|
418 | |
---|
419 | free(body_final); |
---|
420 | |
---|
421 | //this is to prevent overwhelming rabbitMQ server (and to prevent triggering rabbitMQ defensive behaviours (e.g. connection blocking)) |
---|
422 | //usleep( 200000 ); // O.2 second |
---|
423 | |
---|
424 | |
---|
425 | return 0; |
---|
426 | } |
---|
427 | |
---|
428 | // -- not used -- // |
---|
429 | |
---|
430 | static void dump_row(long count, int numinrow, int *chs) { |
---|
431 | int i; |
---|
432 | |
---|
433 | printf("%08lX:", count - numinrow); |
---|
434 | |
---|
435 | if (numinrow > 0) { |
---|
436 | for (i = 0; i < numinrow; i++) { |
---|
437 | if (i == 8) |
---|
438 | printf(" :"); |
---|
439 | printf(" %02X", chs[i]); |
---|
440 | } |
---|
441 | for (i = numinrow; i < 16; i++) { |
---|
442 | if (i == 8) |
---|
443 | printf(" :"); |
---|
444 | printf(" "); |
---|
445 | } |
---|
446 | printf(" "); |
---|
447 | for (i = 0; i < numinrow; i++) { |
---|
448 | if (isprint(chs[i])) |
---|
449 | printf("%c", chs[i]); |
---|
450 | else |
---|
451 | printf("."); |
---|
452 | } |
---|
453 | } |
---|
454 | printf("\n"); |
---|
455 | } |
---|
456 | |
---|
457 | static int rows_eq(int *a, int *b) { |
---|
458 | int i; |
---|
459 | |
---|
460 | for (i=0; i<16; i++) |
---|
461 | if (a[i] != b[i]) |
---|
462 | return 0; |
---|
463 | |
---|
464 | return 1; |
---|
465 | } |
---|
466 | |
---|
467 | void amqp_dump(void const *buffer, size_t len) { |
---|
468 | unsigned char *buf = (unsigned char *) buffer; |
---|
469 | long count = 0; |
---|
470 | int numinrow = 0; |
---|
471 | int chs[16]; |
---|
472 | int oldchs[16] = {0}; |
---|
473 | int showed_dots = 0; |
---|
474 | size_t i; |
---|
475 | |
---|
476 | for (i = 0; i < len; i++) { |
---|
477 | int ch = buf[i]; |
---|
478 | |
---|
479 | if (numinrow == 16) { |
---|
480 | int i; |
---|
481 | |
---|
482 | if (rows_eq(oldchs, chs)) { |
---|
483 | if (!showed_dots) { |
---|
484 | showed_dots = 1; |
---|
485 | printf(" .. .. .. .. .. .. .. .. : .. .. .. .. .. .. .. ..\n"); |
---|
486 | } |
---|
487 | } else { |
---|
488 | showed_dots = 0; |
---|
489 | dump_row(count, numinrow, chs); |
---|
490 | } |
---|
491 | |
---|
492 | for (i=0; i<16; i++) |
---|
493 | oldchs[i] = chs[i]; |
---|
494 | |
---|
495 | numinrow = 0; |
---|
496 | } |
---|
497 | |
---|
498 | count++; |
---|
499 | chs[numinrow++] = ch; |
---|
500 | } |
---|
501 | |
---|
502 | dump_row(count, numinrow, chs); |
---|
503 | |
---|
504 | if (numinrow != 0) |
---|
505 | printf("%08lX:\n", count); |
---|
506 | } |
---|
507 | |
---|
508 | /* vi: set et ts=2 sw=2: */ |
---|