Remove NEON and related hacks
[platform/upstream/rpm.git] / rpmio / tdir.c
1 #include "system.h"
2
3 #include <rpmio_internal.h>
4 #include <rpmmacro.h>
5 #include <rpmmessages.h>
6 #include <popt.h>
7
8 #include "debug.h"
9
10 static int _debug = 0;
11
12 #define HTTPPATH        "https://wellfleet.jbj.org/rawhide/test/"
13 #define FTPPATH         "ftp://wellfleet.jbj.org/pub/rawhide/packages/test/"
14 #define DIRPATH         "/var/ftp/pub/rawhide/packages/test"
15 static char * httppath = HTTPPATH;
16 static char * ftppath = FTPPATH;
17 static char * dirpath = DIRPATH;
18
19 static void printDir(const char * path)
20 {
21     struct dirent * dp;
22     DIR * dir;
23     int xx;
24     int i;
25
26 fprintf(stderr, "===== %s\n", path);
27     dir = Opendir(path);
28     i = 0;
29     while ((dp = Readdir(dir)) != NULL) {
30 fprintf(stderr, "%5d (%x,%x) %x %x %s\n", i++,
31 (unsigned) dp->d_ino,
32 (unsigned) dp->d_off,
33 (unsigned) dp->d_reclen,
34 (unsigned) dp->d_type,
35 dp->d_name);
36     }
37     xx = Closedir(dir);
38 }
39
40 static struct poptOption optionsTable[] = {
41  { "debug", 'd', POPT_ARG_VAL,  &_debug, -1,            NULL, NULL },
42  { "ftpdebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_ftp_debug, -1,
43         N_("debug protocol data stream"), NULL},
44  { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1,
45         N_("debug rpmio I/O"), NULL},
46  { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1,
47         N_("debug URL cache handling"), NULL},
48  { "verbose", 'v', 0, 0, 'v',                           NULL, NULL },
49   POPT_AUTOHELP
50   POPT_TABLEEND
51 };
52
53 int
54 main(int argc, const char *argv[])
55 {
56     poptContext optCon = poptGetContext(argv[0], argc, argv, optionsTable, 0);
57     int rc;
58
59     while ((rc = poptGetNextOpt(optCon)) > 0) {
60         switch (rc) {
61         case 'v':
62             rpmIncreaseVerbosity();
63             break;
64         default:
65             break;
66         }
67     }
68
69     if (_debug) {
70         rpmIncreaseVerbosity();
71         rpmIncreaseVerbosity();
72     }
73
74 _ftp_debug = -1;
75     printDir(dirpath);
76     printDir(ftppath);
77     printDir(httppath);
78
79 urlFreeCache();
80
81     return 0;
82 }