Last change
on this file was
c5c522c,
checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago
|
initial commit, transferred from cleaned syn3 svn tree
|
-
Property mode set to
100644
|
File size:
1.6 KB
|
Rev | Line | |
---|
[c5c522c] | 1 | /* $Id: dspam_crc.c,v 1.8 2011/06/28 00:13:48 sbajic Exp $ */ |
---|
| 2 | |
---|
| 3 | /* |
---|
| 4 | DSPAM |
---|
| 5 | COPYRIGHT (C) 2002-2012 DSPAM PROJECT |
---|
| 6 | |
---|
| 7 | This program is free software: you can redistribute it and/or modify |
---|
| 8 | it under the terms of the GNU Affero General Public License as |
---|
| 9 | published by the Free Software Foundation, either version 3 of the |
---|
| 10 | License, or (at your option) any later version. |
---|
| 11 | |
---|
| 12 | This program is distributed in the hope that it will be useful, |
---|
| 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 15 | GNU Affero General Public License for more details. |
---|
| 16 | |
---|
| 17 | You should have received a copy of the GNU Affero General Public License |
---|
| 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
---|
| 19 | |
---|
| 20 | */ |
---|
| 21 | |
---|
| 22 | #ifdef HAVE_CONFIG_H |
---|
| 23 | #include <auto-config.h> |
---|
| 24 | #endif |
---|
| 25 | |
---|
| 26 | #include <stdio.h> |
---|
| 27 | #include <stdlib.h> |
---|
| 28 | #include <string.h> |
---|
| 29 | #include <ctype.h> |
---|
| 30 | #include <errno.h> |
---|
| 31 | #include <math.h> |
---|
| 32 | #include <unistd.h> |
---|
| 33 | #include <sys/types.h> |
---|
| 34 | #include <sys/stat.h> |
---|
| 35 | #include <fcntl.h> |
---|
| 36 | #include <sys/types.h> |
---|
| 37 | #include <sys/stat.h> |
---|
| 38 | #include "util.h" |
---|
| 39 | |
---|
| 40 | #ifdef TIME_WITH_SYS_TIME |
---|
| 41 | # include <sys/time.h> |
---|
| 42 | # include <time.h> |
---|
| 43 | #else |
---|
| 44 | # ifdef HAVE_SYS_TIME_H |
---|
| 45 | # include <sys/time.h> |
---|
| 46 | # else |
---|
| 47 | # include <time.h> |
---|
| 48 | # endif |
---|
| 49 | #endif |
---|
| 50 | |
---|
| 51 | #include "config.h" |
---|
| 52 | #include "libdspam.h" |
---|
| 53 | |
---|
| 54 | #define SYNTAX "syntax: dspam_crc [token]" |
---|
| 55 | |
---|
| 56 | int |
---|
| 57 | main (int argc, char *argv[]) |
---|
| 58 | { |
---|
| 59 | unsigned long long crc; |
---|
| 60 | |
---|
| 61 | if (argc < 2) |
---|
| 62 | { |
---|
| 63 | printf ("%s\n", SYNTAX); |
---|
| 64 | exit (EXIT_FAILURE); |
---|
| 65 | } |
---|
| 66 | |
---|
| 67 | crc = _ds_getcrc64 (argv[1]); |
---|
| 68 | |
---|
| 69 | printf ("TOKEN: '%s' CRC: %"LLU_FMT_SPEC"\n", argv[1], crc); |
---|
| 70 | exit (EXIT_SUCCESS); |
---|
| 71 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.