source: pwntcha/trunk/src/main.c @ 387

Last change on this file since 387 was 387, checked in by Sam Hocevar, 15 years ago
  • renamed a few functions
  • Property svn:keywords set to Id
File size: 927 bytes
Line 
1/*
2 * main.c: main function
3 * $Id: main.c 387 2005-01-03 15:29:46Z sam $
4 *
5 * Copyright: (c) 2004 Sam Hocevar <sam@zoy.org>
6 *   This program is free software; you can redistribute it and/or
7 *   modify it under the terms of the Do What The Fuck You Want To
8 *   Public License as published by Banlu Kemiyatorn. See
9 *   http://sam.zoy.org/projects/COPYING.WTFPL for more details.
10 */
11
12#include <stdio.h>
13#include <stdlib.h>
14
15#include "config.h"
16#include "common.h"
17
18int main(int argc, char *argv[])
19{
20    struct image *img;
21    char *result;
22
23    if(argc != 2)
24    {
25        fprintf(stderr, "usage: %s <image>\n", argv[0]);
26        return -1;
27    }
28
29    img = image_load(argv[1]);
30    if(!img)
31    {
32        fprintf(stderr, "cannot load %s\n", argv[1]);
33        return -1;
34    }
35
36    result = decode_slashdot(img);
37    if(!result)
38    {
39        fprintf(stderr, "sorry, decoding failed\n");
40        return -1;
41    }
42
43    printf("%s\n", result);
44
45    return 0;
46}
47
Note: See TracBrowser for help on using the repository browser.