aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authoraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-04-03 16:39:31 +0000
committeraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-04-03 16:39:31 +0000
commit8a3979378b19f0a972bd97df224e8dce52637848 (patch)
treecee92b2a5cd0ea7298aab569ed944fdeb59dbdf2 /libbb
parent789c5ae4dfa476e433aab3877393a73bfdd31e64 (diff)
downloadbusybox-w32-8a3979378b19f0a972bd97df224e8dce52637848.tar.gz
busybox-w32-8a3979378b19f0a972bd97df224e8dce52637848.tar.bz2
busybox-w32-8a3979378b19f0a972bd97df224e8dce52637848.zip
- move buffer allocation schemes to libbb.h
- include the correct headers: applets need busybox.h while lib* need libbb.h git-svn-id: svn://busybox.net/trunk/busybox@14739 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r--libbb/bb_do_delay.c1
-rw-r--r--libbb/bb_echo.c2
-rw-r--r--libbb/compare_string_array.c16
-rw-r--r--libbb/copy_file.c2
-rw-r--r--libbb/copyfd.c1
-rw-r--r--libbb/get_last_path_component.c2
-rw-r--r--libbb/get_terminal_width_height.c16
-rw-r--r--libbb/md5.c8
-rw-r--r--libbb/messages.c14
-rw-r--r--libbb/mode_string.c16
-rw-r--r--libbb/sha1.c2
-rw-r--r--libbb/u_signal_names.c17
-rw-r--r--libbb/xgetlarg.c4
13 files changed, 25 insertions, 76 deletions
diff --git a/libbb/bb_do_delay.c b/libbb/bb_do_delay.c
index ddcff0765..1fbdc9ae8 100644
--- a/libbb/bb_do_delay.c
+++ b/libbb/bb_do_delay.c
@@ -9,6 +9,7 @@
9 9
10#include <time.h> 10#include <time.h>
11#include <unistd.h> 11#include <unistd.h>
12#include "libbb.h"
12 13
13void bb_do_delay(int seconds) 14void bb_do_delay(int seconds)
14{ 15{
diff --git a/libbb/bb_echo.c b/libbb/bb_echo.c
index 9ad73df85..0c5a94766 100644
--- a/libbb/bb_echo.c
+++ b/libbb/bb_echo.c
@@ -26,7 +26,7 @@
26 26
27#include <stdio.h> 27#include <stdio.h>
28#include <string.h> 28#include <string.h>
29#include "busybox.h" 29#include "libbb.h"
30 30
31int bb_echo(int ATTRIBUTE_UNUSED argc, char **argv) 31int bb_echo(int ATTRIBUTE_UNUSED argc, char **argv)
32{ 32{
diff --git a/libbb/compare_string_array.c b/libbb/compare_string_array.c
index 529d29495..d379feea4 100644
--- a/libbb/compare_string_array.c
+++ b/libbb/compare_string_array.c
@@ -1,20 +1,10 @@
1/* vi:set ts=4:*/
1/* 2/*
2 * This program is free software; you can redistribute it and/or modify 3 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation; either version 2 of the License, or
5 * (at your option) any later version.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15 */ 4 */
16 5
17#include <string.h> 6#include <string.h>
7#include "libbb.h"
18 8
19/* returns the array number of the string */ 9/* returns the array number of the string */
20int compare_string_array(const char * const string_array[], const char *key) 10int compare_string_array(const char * const string_array[], const char *key)
diff --git a/libbb/copy_file.c b/libbb/copy_file.c
index 35352d27a..3b172ffe4 100644
--- a/libbb/copy_file.c
+++ b/libbb/copy_file.c
@@ -18,7 +18,7 @@
18#include <stdlib.h> 18#include <stdlib.h>
19#include <string.h> 19#include <string.h>
20 20
21#include "busybox.h" 21#include "libbb.h"
22 22
23/* Compiler version-specific crap that should be in a header file somewhere. */ 23/* Compiler version-specific crap that should be in a header file somewhere. */
24 24
diff --git a/libbb/copyfd.c b/libbb/copyfd.c
index d138f3e59..e2c542e32 100644
--- a/libbb/copyfd.c
+++ b/libbb/copyfd.c
@@ -12,7 +12,6 @@
12#include <string.h> 12#include <string.h>
13#include <unistd.h> 13#include <unistd.h>
14 14
15#include "busybox.h"
16#include "libbb.h" 15#include "libbb.h"
17 16
18 17
diff --git a/libbb/get_last_path_component.c b/libbb/get_last_path_component.c
index c950faeb3..311909726 100644
--- a/libbb/get_last_path_component.c
+++ b/libbb/get_last_path_component.c
@@ -7,6 +7,8 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#include "libbb.h"
11
10char *bb_get_last_path_component(char *path) 12char *bb_get_last_path_component(char *path)
11{ 13{
12 char *first = path; 14 char *first = path;
diff --git a/libbb/get_terminal_width_height.c b/libbb/get_terminal_width_height.c
index 01136d414..df5aa907f 100644
--- a/libbb/get_terminal_width_height.c
+++ b/libbb/get_terminal_width_height.c
@@ -4,19 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */ 8 */
21 9
22#include <stdio.h> 10#include <stdio.h>
@@ -26,7 +14,7 @@
26#include <unistd.h> 14#include <unistd.h>
27#include <termios.h> 15#include <termios.h>
28#include <sys/ioctl.h> 16#include <sys/ioctl.h>
29#include "busybox.h" 17#include "libbb.h"
30 18
31/* It is perfectly ok to pass in a NULL for either width or for 19/* It is perfectly ok to pass in a NULL for either width or for
32 * height, in which case that value will not be set. */ 20 * height, in which case that value will not be set. */
diff --git a/libbb/md5.c b/libbb/md5.c
index 8cec88535..b5aa89fc6 100644
--- a/libbb/md5.c
+++ b/libbb/md5.c
@@ -1,9 +1,9 @@
1/* 1/*
2 * md5.c - Compute MD5 checksum of strings according to the 2 * md5.c - Compute MD5 checksum of strings according to the
3 * definition of MD5 in RFC 1321 from April 1992. 3 * definition of MD5 in RFC 1321 from April 1992.
4 * 4 *
5 * Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995. 5 * Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
6 * 6 *
7 * Copyright (C) 1995-1999 Free Software Foundation, Inc. 7 * Copyright (C) 1995-1999 Free Software Foundation, Inc.
8 * Copyright (C) 2001 Manuel Novoa III 8 * Copyright (C) 2001 Manuel Novoa III
9 * Copyright (C) 2003 Glenn L. McGrath 9 * Copyright (C) 2003 Glenn L. McGrath
@@ -19,7 +19,7 @@
19#include <string.h> 19#include <string.h>
20#include <unistd.h> 20#include <unistd.h>
21 21
22#include "busybox.h" 22#include "libbb.h"
23 23
24# if CONFIG_MD5_SIZE_VS_SPEED < 0 || CONFIG_MD5_SIZE_VS_SPEED > 3 24# if CONFIG_MD5_SIZE_VS_SPEED < 0 || CONFIG_MD5_SIZE_VS_SPEED > 3
25# define MD5_SIZE_VS_SPEED 2 25# define MD5_SIZE_VS_SPEED 2
@@ -71,7 +71,7 @@ void md5_begin(md5_ctx_t *ctx)
71 * starting at BUFFER. 71 * starting at BUFFER.
72 * It is necessary that LEN is a multiple of 64!!! 72 * It is necessary that LEN is a multiple of 64!!!
73 */ 73 */
74void md5_hash_block(const void *buffer, size_t len, md5_ctx_t *ctx) 74static void md5_hash_block(const void *buffer, size_t len, md5_ctx_t *ctx)
75{ 75{
76 uint32_t correct_words[16]; 76 uint32_t correct_words[16];
77 const uint32_t *words = buffer; 77 const uint32_t *words = buffer;
diff --git a/libbb/messages.c b/libbb/messages.c
index 23f0ea2ba..b9a5353a7 100644
--- a/libbb/messages.c
+++ b/libbb/messages.c
@@ -2,19 +2,7 @@
2/* 2/*
3 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 3 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
4 * 4 *
5 * This program is free software; you can redistribute it and/or modify 5 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 * 6 *
19 */ 7 */
20 8
diff --git a/libbb/mode_string.c b/libbb/mode_string.c
index 83142ba8a..5a9775930 100644
--- a/libbb/mode_string.c
+++ b/libbb/mode_string.c
@@ -4,19 +4,7 @@
4 * 4 *
5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 * 8 *
21 */ 9 */
22 10
@@ -28,6 +16,8 @@
28#include <assert.h> 16#include <assert.h>
29#include <sys/stat.h> 17#include <sys/stat.h>
30 18
19#include "libbb.h"
20
31#if ( S_ISUID != 04000 ) || ( S_ISGID != 02000 ) || ( S_ISVTX != 01000 ) \ 21#if ( S_ISUID != 04000 ) || ( S_ISGID != 02000 ) || ( S_ISVTX != 01000 ) \
32 || ( S_IRUSR != 00400 ) || ( S_IWUSR != 00200 ) || ( S_IXUSR != 00100 ) \ 22 || ( S_IRUSR != 00400 ) || ( S_IWUSR != 00200 ) || ( S_IXUSR != 00100 ) \
33 || ( S_IRGRP != 00040 ) || ( S_IWGRP != 00020 ) || ( S_IXGRP != 00010 ) \ 23 || ( S_IRGRP != 00040 ) || ( S_IWGRP != 00020 ) || ( S_IXGRP != 00010 ) \
diff --git a/libbb/sha1.c b/libbb/sha1.c
index 128d4b98f..4b28266af 100644
--- a/libbb/sha1.c
+++ b/libbb/sha1.c
@@ -45,7 +45,7 @@
45#include <string.h> 45#include <string.h>
46#include <unistd.h> 46#include <unistd.h>
47 47
48#include "busybox.h" 48#include "libbb.h"
49 49
50# define SHA1_BLOCK_SIZE 64 50# define SHA1_BLOCK_SIZE 64
51# define SHA1_DIGEST_SIZE 20 51# define SHA1_DIGEST_SIZE 20
diff --git a/libbb/u_signal_names.c b/libbb/u_signal_names.c
index be444a97b..31ebd895a 100644
--- a/libbb/u_signal_names.c
+++ b/libbb/u_signal_names.c
@@ -5,20 +5,7 @@
5 * Copyright (C) many different people. 5 * Copyright (C) many different people.
6 * If you wrote this, please acknowledge your work. 6 * If you wrote this, please acknowledge your work.
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21 * USA
22 */ 9 */
23 10
24#include <signal.h> 11#include <signal.h>
@@ -27,6 +14,8 @@
27#include <stdlib.h> 14#include <stdlib.h>
28#include <stdio.h> 15#include <stdio.h>
29 16
17#include "libbb.h"
18
30struct signal_name { 19struct signal_name {
31 const char *name; 20 const char *name;
32 int number; 21 int number;
diff --git a/libbb/xgetlarg.c b/libbb/xgetlarg.c
index 6d3c4d1db..893cd2813 100644
--- a/libbb/xgetlarg.c
+++ b/libbb/xgetlarg.c
@@ -1,6 +1,8 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * Copyright (C) 2003-2004 Erik Andersen <andersen@codepoet.org> 3 * Copyright (C) 2003-2004 Erik Andersen <andersen@codepoet.org>
4 *
5 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
4 */ 6 */
5 7
6 8
@@ -11,7 +13,7 @@
11#include <assert.h> 13#include <assert.h>
12#include <ctype.h> 14#include <ctype.h>
13 15
14#include "busybox.h" 16#include "libbb.h"
15 17
16long bb_xgetlarg(const char *arg, int base, long lower, long upper) 18long bb_xgetlarg(const char *arg, int base, long lower, long upper)
17{ 19{