From 296a38509d12306e423800ed2c583a94a31eddff Mon Sep 17 00:00:00 2001 From: Jonathan Beck Date: Thu, 29 Jan 2009 19:26:15 +0100 Subject: Clean some old stuff. --- plutil/plutil.c | 2 -- src/Makefile.am | 2 +- src/bplist.c | 11 --------- src/plist.c | 2 +- src/plist.h | 3 --- src/utils.c | 77 --------------------------------------------------------- src/utils.h | 30 ---------------------- src/xplist.c | 2 -- 8 files changed, 2 insertions(+), 127 deletions(-) delete mode 100644 src/utils.c delete mode 100644 src/utils.h diff --git a/plutil/plutil.c b/plutil/plutil.c index ef22a77..27932d1 100644 --- a/plutil/plutil.c +++ b/plutil/plutil.c @@ -38,8 +38,6 @@ int main(int argc, char *argv[]) return 0; } - iphone_set_debug(options->debug); - //read input file FILE *iplist = fopen(options->in_file, "r"); if (!iplist) diff --git a/src/Makefile.am b/src/Makefile.am index eb9cd08..87b5a20 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -4,4 +4,4 @@ AM_CFLAGS = $(GLOBAL_CFLAGS) $(libxml2_CFLAGS) $(libglib2_CFLAGS) AM_LDFLAGS = $(libxml2_LIBS) $(libglib2_LIBS) lib_LTLIBRARIES = libplist.la -libplist_la_SOURCES = plist.c bplist.c xplist.c utils.c +libplist_la_SOURCES = plist.c bplist.c xplist.c diff --git a/src/bplist.c b/src/bplist.c index 78bbe4a..d05c2e5 100644 --- a/src/bplist.c +++ b/src/bplist.c @@ -380,12 +380,6 @@ void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist) uint64_t root_object = be64dec(trailer + BPLIST_TRL_ROOTOBJ_IDX); uint64_t offset_table_index = be64dec(trailer + BPLIST_TRL_OFFTAB_IDX); - log_debug_msg("Offset size: %i\n", offset_size); - log_debug_msg("Ref size: %i\n", dict_param_size); - log_debug_msg("Number of objects: %lli\n", num_objects); - log_debug_msg("Root object index: %lli\n", root_object); - log_debug_msg("Offset table index: %lli\n", offset_table_index); - if (num_objects == 0) return; @@ -403,10 +397,8 @@ void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist) for (i = 0; i < num_objects; i++) { current_offset = UINT_TO_HOST(offset_table + i * offset_size, offset_size); - log_debug_msg("parse_nodes: current_offset = %i\n", current_offset); char *obj = plist_bin + current_offset; nodeslist[i] = parse_bin_node(obj, dict_param_size, &obj); - log_debug_msg("parse_nodes: parse_raw_node done\n"); } //setup children for structured types @@ -415,12 +407,10 @@ void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist) for (i = 0; i < num_objects; i++) { - log_debug_msg("parse_nodes: on node %i\n", i); plist_data_t data = plist_get_data(nodeslist[i]); switch (data->type) { case PLIST_DICT: - log_debug_msg("parse_nodes: dictionary found\n"); for (j = 0; j < data->length; j++) { str_i = j * dict_param_size; str_j = (j + data->length) * dict_param_size; @@ -450,7 +440,6 @@ void plist_from_bin(const char *plist_bin, uint32_t length, plist_t * plist) break; case PLIST_ARRAY: - log_debug_msg("parse_nodes: array found\n"); for (j = 0; j < data->length; j++) { str_j = j * dict_param_size; index1 = UINT_TO_HOST(data->buff + str_j, dict_param_size); diff --git a/src/plist.c b/src/plist.c index f315e7e..0f6d741 100644 --- a/src/plist.c +++ b/src/plist.c @@ -22,7 +22,6 @@ #include #include -#include "utils.h" #include "plist.h" #include #include @@ -118,6 +117,7 @@ static plist_t plist_add_sub_element(plist_t node, plist_type type, const void * } else return NULL; } + return NULL; } void plist_free(plist_t plist) diff --git a/src/plist.h b/src/plist.h index 33f6c20..830da75 100644 --- a/src/plist.h +++ b/src/plist.h @@ -30,9 +30,6 @@ #include #include #include -#include "utils.h" - - struct plist_data_s { diff --git a/src/utils.c b/src/utils.c deleted file mode 100644 index 920b347..0000000 --- a/src/utils.c +++ /dev/null @@ -1,77 +0,0 @@ -/* - * utils.c - * contains utilitary methos for logging and debugging - * - * Copyright (c) 2008 Jonathan Beck All Rights Reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ -#include -#include -#include "utils.h" - -int toto_debug = 0; - -/** - * Sets the level of debugging. Currently the only acceptable values are 0 and - * 1. - * - * @param level Set to 0 for no debugging or 1 for debugging. - */ -void iphone_set_debug(int level) -{ - toto_debug = level; -} - -void log_debug_msg(const char *format, ...) -{ -#ifndef STRIP_DEBUG_CODE - - va_list args; - /* run the real fprintf */ - va_start(args, format); - - if (toto_debug) - vfprintf(stderr, format, args); - - va_end(args); - -#endif -} - -inline void log_debug_buffer(const char *data, const int length) -{ -#ifndef STRIP_DEBUG_CODE - - /* run the real fprintf */ - if (toto_debug) - fwrite(data, 1, length, stderr); -#endif -} - -inline void dump_debug_buffer(const char *file, const char *data, const int length) -{ -#ifndef STRIP_DEBUG_CODE - - /* run the real fprintf */ - if (toto_debug) { - FILE *my_ssl_packet = fopen(file, "w+"); - fwrite(data, 1, length, my_ssl_packet); - fflush(my_ssl_packet); - fprintf(stderr, "Wrote SSL packet to drive, too.\n"); - fclose(my_ssl_packet); - } -#endif -} diff --git a/src/utils.h b/src/utils.h deleted file mode 100644 index 489f610..0000000 --- a/src/utils.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * utils.h - * contains utilitary methos for logging and debugging - * - * Copyright (c) 2008 Jonathan Beck All Rights Reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef UTILS_H -#define UTILS_H - -#include "libiphone/libiphone.h" - -inline void log_debug_msg(const char *format, ...); -inline void log_debug_buffer(const char *data, const int length); -inline void dump_debug_buffer(const char *file, const char *data, const int length); -#endif diff --git a/src/xplist.c b/src/xplist.c index f9670f1..0c1a6b9 100644 --- a/src/xplist.c +++ b/src/xplist.c @@ -29,8 +29,6 @@ #include #include -#include -#include "utils.h" #include "plist.h" #define XPLIST_TEXT BAD_CAST("text") -- cgit v1.1-32-gdbae