From 421d9e59416850968707dfec7a665cb0211b8d1c Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Mon, 3 Apr 2006 16:39:31 +0000 Subject: - move buffer allocation schemes to libbb.h - include the correct headers: applets need busybox.h while lib* need libbb.h --- libbb/bb_do_delay.c | 1 + libbb/bb_echo.c | 2 +- libbb/compare_string_array.c | 16 +++------------- libbb/copy_file.c | 2 +- libbb/copyfd.c | 1 - libbb/get_last_path_component.c | 2 ++ libbb/get_terminal_width_height.c | 16 ++-------------- libbb/md5.c | 8 ++++---- libbb/messages.c | 14 +------------- libbb/mode_string.c | 16 +++------------- libbb/sha1.c | 2 +- libbb/u_signal_names.c | 17 +++-------------- libbb/xgetlarg.c | 4 +++- 13 files changed, 25 insertions(+), 76 deletions(-) (limited to 'libbb') diff --git a/libbb/bb_do_delay.c b/libbb/bb_do_delay.c index ddcff07..1fbdc9a 100644 --- a/libbb/bb_do_delay.c +++ b/libbb/bb_do_delay.c @@ -9,6 +9,7 @@ #include #include +#include "libbb.h" void bb_do_delay(int seconds) { diff --git a/libbb/bb_echo.c b/libbb/bb_echo.c index 9ad73df..0c5a947 100644 --- a/libbb/bb_echo.c +++ b/libbb/bb_echo.c @@ -26,7 +26,7 @@ #include #include -#include "busybox.h" +#include "libbb.h" int bb_echo(int ATTRIBUTE_UNUSED argc, char **argv) { diff --git a/libbb/compare_string_array.c b/libbb/compare_string_array.c index 529d294..d379fee 100644 --- a/libbb/compare_string_array.c +++ b/libbb/compare_string_array.c @@ -1,20 +1,10 @@ +/* vi:set ts=4:*/ /* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ #include +#include "libbb.h" /* returns the array number of the string */ int compare_string_array(const char * const string_array[], const char *key) diff --git a/libbb/copy_file.c b/libbb/copy_file.c index 35352d2..3b172ff 100644 --- a/libbb/copy_file.c +++ b/libbb/copy_file.c @@ -18,7 +18,7 @@ #include #include -#include "busybox.h" +#include "libbb.h" /* Compiler version-specific crap that should be in a header file somewhere. */ diff --git a/libbb/copyfd.c b/libbb/copyfd.c index d138f3e..e2c542e 100644 --- a/libbb/copyfd.c +++ b/libbb/copyfd.c @@ -12,7 +12,6 @@ #include #include -#include "busybox.h" #include "libbb.h" diff --git a/libbb/get_last_path_component.c b/libbb/get_last_path_component.c index c950fae..3119097 100644 --- a/libbb/get_last_path_component.c +++ b/libbb/get_last_path_component.c @@ -7,6 +7,8 @@ * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ +#include "libbb.h" + char *bb_get_last_path_component(char *path) { char *first = path; diff --git a/libbb/get_terminal_width_height.c b/libbb/get_terminal_width_height.c index 01136d4..df5aa90 100644 --- a/libbb/get_terminal_width_height.c +++ b/libbb/get_terminal_width_height.c @@ -4,19 +4,7 @@ * * Copyright (C) 1999-2004 by Erik Andersen * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ #include @@ -26,7 +14,7 @@ #include #include #include -#include "busybox.h" +#include "libbb.h" /* It is perfectly ok to pass in a NULL for either width or for * height, in which case that value will not be set. */ diff --git a/libbb/md5.c b/libbb/md5.c index 8cec885..b5aa89f 100644 --- a/libbb/md5.c +++ b/libbb/md5.c @@ -1,9 +1,9 @@ /* * md5.c - Compute MD5 checksum of strings according to the * definition of MD5 in RFC 1321 from April 1992. - * + * * Written by Ulrich Drepper , 1995. - * + * * Copyright (C) 1995-1999 Free Software Foundation, Inc. * Copyright (C) 2001 Manuel Novoa III * Copyright (C) 2003 Glenn L. McGrath @@ -19,7 +19,7 @@ #include #include -#include "busybox.h" +#include "libbb.h" # if CONFIG_MD5_SIZE_VS_SPEED < 0 || CONFIG_MD5_SIZE_VS_SPEED > 3 # define MD5_SIZE_VS_SPEED 2 @@ -71,7 +71,7 @@ void md5_begin(md5_ctx_t *ctx) * starting at BUFFER. * It is necessary that LEN is a multiple of 64!!! */ -void md5_hash_block(const void *buffer, size_t len, md5_ctx_t *ctx) +static void md5_hash_block(const void *buffer, size_t len, md5_ctx_t *ctx) { uint32_t correct_words[16]; const uint32_t *words = buffer; diff --git a/libbb/messages.c b/libbb/messages.c index 23f0ea2..b9a5353 100644 --- a/libbb/messages.c +++ b/libbb/messages.c @@ -2,19 +2,7 @@ /* * Copyright (C) 1999-2004 by Erik Andersen * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. * */ diff --git a/libbb/mode_string.c b/libbb/mode_string.c index 83142ba..5a97759 100644 --- a/libbb/mode_string.c +++ b/libbb/mode_string.c @@ -4,19 +4,7 @@ * * Copyright (C) 2003 Manuel Novoa III * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. * */ @@ -28,6 +16,8 @@ #include #include +#include "libbb.h" + #if ( S_ISUID != 04000 ) || ( S_ISGID != 02000 ) || ( S_ISVTX != 01000 ) \ || ( S_IRUSR != 00400 ) || ( S_IWUSR != 00200 ) || ( S_IXUSR != 00100 ) \ || ( S_IRGRP != 00040 ) || ( S_IWGRP != 00020 ) || ( S_IXGRP != 00010 ) \ diff --git a/libbb/sha1.c b/libbb/sha1.c index 128d4b9..4b28266 100644 --- a/libbb/sha1.c +++ b/libbb/sha1.c @@ -45,7 +45,7 @@ #include #include -#include "busybox.h" +#include "libbb.h" # define SHA1_BLOCK_SIZE 64 # define SHA1_DIGEST_SIZE 20 diff --git a/libbb/u_signal_names.c b/libbb/u_signal_names.c index be444a9..31ebd89 100644 --- a/libbb/u_signal_names.c +++ b/libbb/u_signal_names.c @@ -5,20 +5,7 @@ * Copyright (C) many different people. * If you wrote this, please acknowledge your work. * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program 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 - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ #include @@ -27,6 +14,8 @@ #include #include +#include "libbb.h" + struct signal_name { const char *name; int number; diff --git a/libbb/xgetlarg.c b/libbb/xgetlarg.c index 6d3c4d1..893cd28 100644 --- a/libbb/xgetlarg.c +++ b/libbb/xgetlarg.c @@ -1,6 +1,8 @@ /* vi: set sw=4 ts=4: */ /* * Copyright (C) 2003-2004 Erik Andersen + * + * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ @@ -11,7 +13,7 @@ #include #include -#include "busybox.h" +#include "libbb.h" long bb_xgetlarg(const char *arg, int base, long lower, long upper) { -- cgit v1.1