1 /*
2  *  typespeed - measures your typing speed
3  *  Copyright (C) 1999-2003   Jani Ollikainen  <bestis@iki.fi>
4  *                          & Jaakko Manelius  <jman@iki.fi>
5  *  Copyright (C) 2006-2007   Tobias Stoeckmann  <tobias@bugol.de>
6  *
7  *  This program is free software; you can redistribute it and/or modify
8  *  it under the terms of the GNU General Public License as published by
9  *  the Free Software Foundation; either version 2 of the License, or
10  *  (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 General Public License for more details.
16  *
17  *  You should have received a copy of the GNU General Public License
18  *  along with this program; if not, write to the Free Software
19  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21 
22 #ifdef HAVE_CONFIG_H
23 	#include "config.h"
24 #endif /* HAVE_CONFIG_H */
25 
26 #include <stdio.h>
27 
28 #ifdef HAVE_STDLIB_H
29 	#include <stdlib.h>
30 #endif /* HAVE_STDLIB_H */
31 
32 #ifdef HAVE_STRING_H
33 	#include <string.h>
34 #endif /* HAVE_STRING_H */
35 
36 extern char *unescstr(char *);
37 
38 extern char *progname;
39 
40 void usage(void);
41 
42 int
main(int argc,char ** argv)43 main(int argc, char **argv)
44 {
45 	int retval;
46 	char *result;
47 
48 	progname = "t_unescstr";
49 
50 	if (argc != 3)
51 		usage();
52 
53 	if ((result = unescstr(argv[1])) == NULL)
54 		return 1;
55 
56 	if (!strcmp(result, argv[2]))
57 		retval = 0;
58 	else
59 		retval = 1;
60 
61 	free(result);
62 
63 	return retval;
64 }
65 
66 void
usage()67 usage()
68 {
69 	fputs("usage: t_unescstr esc_string unesc_string\n", stderr);
70 	exit(EXIT_FAILURE);
71 }
72 
73