Allow IPv6 address entry in tools>ping - Loosens valid character check
[tomato/davidwu.git] / release / src / router / ntfs-3g / libntfs-3g / debug.c
blobf19348330955ea7f47b2718e494c8b5340bfea13
1 /**
2 * debug.c - Debugging output functions. Originated from the Linux-NTFS project.
4 * Copyright (c) 2002-2004 Anton Altaparmakov
5 * Copyright (c) 2004-2006 Szabolcs Szakacsits
7 * This program/include file is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as published
9 * by the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program/include file is distributed in the hope that it will be
13 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
14 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program (in the main directory of the NTFS-3G
19 * distribution in the file COPYING); if not, write to the Free Software
20 * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifdef HAVE_CONFIG_H
24 #include "config.h"
25 #endif
27 #ifdef HAVE_ERRNO_H
28 #include <errno.h>
29 #endif
31 #include "types.h"
32 #include "runlist.h"
33 #include "debug.h"
34 #include "logging.h"
36 #ifdef DEBUG
37 /**
38 * ntfs_debug_runlist_dump - Dump a runlist.
39 * @rl:
41 * Description...
43 * Returns:
45 void ntfs_debug_runlist_dump(const runlist_element *rl)
47 int i = 0;
48 const char *lcn_str[5] = { "LCN_HOLE ", "LCN_RL_NOT_MAPPED",
49 "LCN_ENOENT ", "LCN_EINVAL ",
50 "LCN_unknown " };
52 ntfs_log_debug("NTFS-fs DEBUG: Dumping runlist (values in hex):\n");
53 if (!rl) {
54 ntfs_log_debug("Run list not present.\n");
55 return;
57 ntfs_log_debug("VCN LCN Run length\n");
58 do {
59 LCN lcn = (rl + i)->lcn;
61 if (lcn < (LCN)0) {
62 int idx = -lcn - 1;
64 if (idx > -LCN_EINVAL - 1)
65 idx = 4;
66 ntfs_log_debug("%-16lld %s %-16lld%s\n",
67 (long long)rl[i].vcn, lcn_str[idx],
68 (long long)rl[i].length,
69 rl[i].length ? "" : " (runlist end)");
70 } else
71 ntfs_log_debug("%-16lld %-16lld %-16lld%s\n",
72 (long long)rl[i].vcn, (long long)rl[i].lcn,
73 (long long)rl[i].length,
74 rl[i].length ? "" : " (runlist end)");
75 } while (rl[i++].length);
78 #endif