- use shorter boilerplate while at it.
scripts/bb_mkdep: $(top_srcdir)/scripts/bb_mkdep.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
-DEP_INCLUDES := include/config.h include/bb_config.h
+DEP_INCLUDES := include/config.h include/bb_config.h include/_usage.h
ifeq ($(strip $(CONFIG_BBCONFIG)),y)
DEP_INCLUDES += include/bbconfigopts.h
< $< >> $@
@echo "#endif" >> $@
+# Create macros for usage.h, e.g.:
+#if ENABLE_HAVE_DOT_CONFIG
+#define USAGE_HAVE_DOT_CONFIG(a) a
+#else
+#define USAGE_HAVE_DOT_CONFIG(a)
+#endif
+include/_usage.h: .config
+ awk '/CONFIG|BB_APPLET/{gsub("#[[:space:]]*|=y|.*CONFIG_|.*BB_APPLET_","");if(!/=/){print("#if ENABLE_"$$1"\n#define USAGE_"$$1"(a) a\n#else\n#define USAGE_"$$1"(a)\n#endif");}}' $(<) > $(@)
+
clean:
- $(MAKE) -C scripts/config $@
- $(RM_F) docs/busybox.dvi docs/busybox.ps \
docs/busybox.pod docs/busybox.net/busybox.html \
docs/busybox pod2htm* *.gdb *.elf *~ core .*config.log \
docs/BusyBox.txt docs/BusyBox.1 docs/BusyBox.html \
- docs/busybox.net/BusyBox.html busybox.links libbb/loop.h \
+ docs/busybox.net/BusyBox.html busybox.links include/_usage.h \
$(DO_INSTALL_LIBS) $(LIBBUSYBOX_SONAME) \
.config.old busybox
- rm -rf _install testsuite/links
#define setlocale(x,y)
#endif
-const char *bb_applet_name __attribute__((externally_visible));
+const char *bb_applet_name ATTRIBUTE_EXTERNALLY_VISIBLE;
#ifdef CONFIG_FEATURE_INSTALLER
/*
#include <stdio.h>
#include "unarchive.h"
-extern void header_skip(const file_header_t *file_header __attribute__((unused)))
+extern void header_skip(const file_header_t *file_header ATTRIBUTE_UNUSED)
{
}
* Loosely based on original busybox unzip applet by Laurence Anderson.
* All options and features should work in this version.
*
- * 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 the GPL v2 or later, see the file LICENSE in this tarball.
*/
/* For reference see
unsigned short method; /* 4-5 */
unsigned short modtime; /* 6-7 */
unsigned short moddate; /* 8-9 */
- unsigned int crc32 __attribute__ ((packed)); /* 10-13 */
- unsigned int cmpsize __attribute__ ((packed)); /* 14-17 */
- unsigned int ucmpsize __attribute__ ((packed)); /* 18-21 */
+ unsigned int crc32 ATTRIBUTE_PACKED; /* 10-13 */
+ unsigned int cmpsize ATTRIBUTE_PACKED; /* 14-17 */
+ unsigned int ucmpsize ATTRIBUTE_PACKED; /* 18-21 */
unsigned short filename_len; /* 22-23 */
unsigned short extra_len; /* 24-25 */
- } formated __attribute__ ((packed));
+ } formated ATTRIBUTE_PACKED;
} zip_header_t;
static void unzip_skip(int fd, off_t skip)
/* stty -- change and print terminal line settings
Copyright (C) 1990-1999 Free Software Foundation, Inc.
- 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, or (at your option)
- any later version.
-
- 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 the GPL v2 or later, see the file LICENSE in this tarball.
+*/
/* Usage: stty [-ag] [-F device] [setting...]
Options:
static const char *device_name;
-static __attribute__ ((noreturn)) void perror_on_device(const char *fmt)
+static ATTRIBUTE_NORETURN void perror_on_device(const char *fmt)
{
bb_perror_msg_and_die(fmt, device_name);
}
}
#ifdef CONFIG_FINDFS
-static attribute_noreturn void do_findfs(int argc, char **argv)
+static ATTRIBUTE_NORETURN void do_findfs(int argc, char **argv)
{
if ((argc != 2) ||
(strncmp(argv[1], "LABEL=", 6) && strncmp(argv[1], "UUID=", 5)))
/* Allow UUID constants to be defined */
#ifdef __GNUC__
#define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \
- static const uuid_t name __attribute__ ((unused)) = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15}
+ static const uuid_t name ATTRIBUTE_UNUSED = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15}
#else
#define UUID_DEFINE(name,u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15) \
static const uuid_t name = {u0,u1,u2,u3,u4,u5,u6,u7,u8,u9,u10,u11,u12,u13,u14,u15}
*
* Copyright (C) 2002 by Dmitry Zakharov <dmit@crp.bank.gov.ua>
*
- * 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 the GPL v2 or later, see the file LICENSE in this tarball.
*/
#include <stdio.h>
static var *evaluate(node *, var *);
static rstream *next_input_file(void);
static int fmt_num(char *, int, const char *, double, int);
-static int awk_exit(int) attribute_noreturn;
+static int awk_exit(int) ATTRIBUTE_NORETURN;
/* ---- error handling ---- */
static const char EMSG_NO_MATH[] = "Math support is not compiled in";
#endif
-static void syntax_error(const char * const message) attribute_noreturn;
+static void syntax_error(const char * const message) ATTRIBUTE_NORETURN;
static void syntax_error(const char * const message)
{
bb_error_msg_and_die("%s:%i: %s", programname, lineno, message);
/*
* Busybox main internal header file
*
- *
- * 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
- *
- * Based in part on code from sash, Copyright (c) 1999 by David I. Bell
- * Permission has been granted to redistribute this code under the GPL.
- *
+ * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
*/
#ifndef _BB_INTERNAL_H_
#define _BB_INTERNAL_H_ 1
struct BB_applet {
const char *name;
int (*main) (int argc, char **argv);
- enum Location location:4;
- enum SUIDRoot need_suid:4;
+ __extension__ enum Location location:4;
+ __extension__ enum SUIDRoot need_suid:4;
};
/* From busybox.c */
/*
* Busybox main internal header file
*
- *
- * 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 the GPL v2 or later, see the file LICENSE in this tarball.
*
* Based in part on code from sash, Copyright (c) 1999 by David I. Bell
* Permission has been granted to redistribute this code under the GPL.
*
*/
-#ifndef __LIBCONFIG_H__
-#define __LIBCONFIG_H__ 1
+#ifndef __LIBBUSYBOX_H__
+#define __LIBBUSYBOX_H__ 1
#include <stdio.h>
#include <stdlib.h>
#include <features.h>
+#include "platform.h"
#include "bb_config.h"
#ifdef CONFIG_SELINUX
#include <selinux/selinux.h>
# include "sha1.h"
#endif
-/* Convenience macros to test the version of gcc. */
-#if defined __GNUC__ && defined __GNUC_MINOR__
-# define __GNUC_PREREQ(maj, min) \
- ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-#else
-# define __GNUC_PREREQ(maj, min) 0
-#endif
-
-/* __restrict is known in EGCS 1.2 and above. */
-#if !__GNUC_PREREQ (2,92)
-# define __restrict /* Ignore */
-#endif
-
-#define attribute_noreturn __attribute__ ((__noreturn__))
-
/* Some useful definitions */
#define FALSE ((int) 0)
#define TRUE ((int) 1)
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
-extern void bb_show_usage(void) __attribute__ ((noreturn, externally_visible));
+extern void bb_show_usage(void) ATTRIBUTE_NORETURN ATTRIBUTE_EXTERNALLY_VISIBLE;
extern void bb_error_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
extern void bb_error_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
extern void bb_perror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
extern void bb_herror_msg(const char *s, ...) __attribute__ ((format (printf, 1, 2)));
extern void bb_herror_msg_and_die(const char *s, ...) __attribute__ ((noreturn, format (printf, 1, 2)));
-extern void bb_perror_nomsg_and_die(void) __attribute__ ((noreturn));
+extern void bb_perror_nomsg_and_die(void) ATTRIBUTE_NORETURN;
extern void bb_perror_nomsg(void);
/* These two are used internally -- you shouldn't need to use them */
extern FILE *bb_xfopen(const char *path, const char *mode);
extern int bb_fclose_nonstdin(FILE *f);
-extern void bb_fflush_stdout_and_exit(int retval) __attribute__ ((noreturn));
+extern void bb_fflush_stdout_and_exit(int retval) ATTRIBUTE_NORETURN;
#define BB_GETOPT_ERROR 0x80000000UL
extern const char *bb_opt_complementally;
#include <dmalloc.h>
#endif
-#endif /* __LIBCONFIG_H__ */
+#endif /* __LIBBUSYBOX_H__ */
--- /dev/null
+/*
+ Copyright 2006, Bernhard Fischer
+
+ Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
+*/
+#ifndef __PLATFORM_H
+#define __PLATFORM_H 1
+
+/* Convenience macros to test the version of gcc. */
+#undef __GNUC_PREREQ
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define __GNUC_PREREQ(maj, min) \
+ ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+# define __GNUC_PREREQ(maj, min) 0
+#endif
+
+/* __restrict is known in EGCS 1.2 and above. */
+#if !__GNUC_PREREQ (2,92)
+# ifndef __restrict
+# define __restrict /* Ignore */
+# endif
+#endif
+
+/* Define macros for some gcc attributes. This permits us to use the
+ macros freely, and know that they will come into play for the
+ version of gcc in which they are supported. */
+
+#if !__GNUC_PREREQ (2,7)
+# ifndef __attribute__
+# define __attribute__(x)
+# endif
+#endif
+
+#if 0
+/* Attribute __malloc__ on functions was valid as of gcc 2.96. */
+#ifndef ATTRIBUTE_MALLOC
+# if __GNUC_PREREQ (2,96)
+# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
+# else
+# define ATTRIBUTE_MALLOC
+# endif /* GNUC >= 2.96 */
+#endif /* ATTRIBUTE_MALLOC */
+#endif
+
+#ifndef ATTRIBUTE_UNUSED
+#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
+#endif /* ATTRIBUTE_UNUSED */
+
+#ifndef ATTRIBUTE_NORETURN
+#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
+#endif /* ATTRIBUTE_NORETURN */
+
+#ifndef ATTRIBUTE_PACKED
+#define ATTRIBUTE_PACKED __attribute__ ((__packed__))
+#endif /* ATTRIBUTE_NORETURN */
+
+/* -fwhole-program makes all symbols local. The attribute externally_visible
+ forces a symbol global. */
+#ifndef ATTRIBUTE_EXTERNALLY_VISIBLE
+# if __GNUC_PREREQ (4,1)
+# define ATTRIBUTE_EXTERNALLY_VISIBLE __attribute__ ((__externally_visible__))
+# else
+# define ATTRIBUTE_EXTERNALLY_VISIBLE
+# endif /* GNUC >= 4.1 */
+#endif /* ATTRIBUTE_EXTERNALLY_VISIBLE */
+
+/* We use __extension__ in some places to suppress -pedantic warnings
+ about GCC extensions. This feature didn't work properly before
+ gcc 2.8. */
+#if !__GNUC_PREREQ (2,8)
+# ifndef __extension__
+# define __extension__
+# endif
+#endif
+
+
+/* include USAGE_APPLET_x helper macros for usage.h. */
+/*
+#include "_usage.h"
+*/
+#endif /* platform.h */
* Copyright (C) 1999 by Lineo, inc. and John Beppu
* Copyright (C) 1999,2000,2001 by John Beppu <beppu@codepoet.org>
*
- * 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 the GPL v2 or later, see the file LICENSE in this tarball.
*/
#ifndef _GNU_SOURCE
free(cmd);
}
-static void passwd_wrapper(const char *login) __attribute__ ((noreturn));
+static void passwd_wrapper(const char *login) ATTRIBUTE_NORETURN;
static void passwd_wrapper(const char *login)
{
struct chardata *cp);
static int caps_lock(const char *s);
static int bcode(const char *s);
-static void error(const char *fmt, ...) __attribute__ ((noreturn));
+static void error(const char *fmt, ...) ATTRIBUTE_NORETURN;
#ifdef SYSV_STYLE
#ifdef CONFIG_FEATURE_UTMP
return (1);
}
-static void config (int sig __attribute__((unused)))
+static void config (int sig ATTRIBUTE_UNUSED)
{
servtab_t *sep, *cp, **sepp;
sigset_t omask;
}
-static void reapchild (int sig __attribute__((unused)))
+static void reapchild (int sig ATTRIBUTE_UNUSED)
{
pid_t pid;
int save_errno = errno, status;
errno = save_errno;
}
-static void retry (int sig __attribute__((unused)))
+static void retry (int sig ATTRIBUTE_UNUSED)
{
servtab_t *sep;
}
}
-static void goaway (int sig __attribute__((unused)))
+static void goaway (int sig ATTRIBUTE_UNUSED)
{
servtab_t *sep;
/* Echo service -- echo data back */
/* ARGSUSED */
static void
-echo_dg (int s, servtab_t *sep __attribute__((unused)))
+echo_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
{
char buffer[BUFSIZE];
int i;
/* Discard service -- ignore data */
/* ARGSUSED */
static void
-discard_dg (int s, servtab_t *sep __attribute__((unused)))
+discard_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
{
char buffer[BUFSIZE];
/* Character generator */
/* ARGSUSED */
static void
-chargen_dg (int s, servtab_t *sep __attribute__((unused)))
+chargen_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
{
/* struct sockaddr_storage ss; */
struct sockaddr sa;
/* ARGSUSED */
static void
-machtime_stream (int s, servtab_t *sep __attribute__((unused)))
+machtime_stream (int s, servtab_t *sep ATTRIBUTE_UNUSED)
{
u_int result;
/* ARGSUSED */
static void
-machtime_dg (int s, servtab_t *sep __attribute__((unused)))
+machtime_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
{
u_int result;
/* struct sockaddr_storage ss; */
#ifdef CONFIG_FEATURE_INETD_SUPPORT_BILTIN_DAYTIME
/* Return human-readable time of day */
/* ARGSUSED */
-static void daytime_stream (int s, servtab_t *sep __attribute__((unused)))
+static void daytime_stream (int s, servtab_t *sep ATTRIBUTE_UNUSED)
{
char buffer[256];
time_t t;
/* Return human-readable time of day */
/* ARGSUSED */
void
-daytime_dg (int s, servtab_t *sep __attribute__((unused)))
+daytime_dg (int s, servtab_t *sep ATTRIBUTE_UNUSED)
{
char buffer[256];
time_t t;
+#ifndef _IP_COMMON_H
+#define _IP_COMMON_H 1
extern int preferred_family;
extern char * _SL_;
extern int print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg);
extern int ipaddr_list_or_flush(int argc, char **argv, int flush);
extern int iproute_monitor(int argc, char **argv);
-extern void iplink_usage(void) __attribute__((noreturn));
+extern void iplink_usage(void) ATTRIBUTE_NORETURN;
extern void ipneigh_reset_filter(void);
extern int do_ipaddr(int argc, char **argv);
extern int do_iproute(int argc, char **argv);
extern int do_ipmonitor(int argc, char **argv);
extern int do_multiaddr(int argc, char **argv);
extern int do_multiroute(int argc, char **argv);
+#endif /* ip_common.h */
return 0;
}
-static int print_route(struct sockaddr_nl *who __attribute__((unused)),
+static int print_route(struct sockaddr_nl *who ATTRIBUTE_UNUSED,
struct nlmsghdr *n, void *arg)
{
FILE *fp = (FILE*)arg;
#include "libnetlink.h"
#include "ll_map.h"
#include "rtm_map.h"
+#include "libbb.h"
extern int preferred_family;
extern int show_stats;
#define SPRINT_BSIZE 64
#define SPRINT_BUF(x) char x[SPRINT_BSIZE]
-extern void incomplete_command(void) __attribute__((noreturn));
+extern void incomplete_command(void) ATTRIBUTE_NORETURN;
#define NEXT_ARG() do { argv++; if (--argc <= 0) incomplete_command(); } while(0)
extern const char *format_host(int af, int len, void *addr, char *buf, int buflen);
extern const char *rt_addr_n2a(int af, int len, void *addr, char *buf, int buflen);
-void invarg(char *, char *) __attribute__((noreturn));
-void duparg(char *, char *) __attribute__((noreturn));
-void duparg2(char *, char *) __attribute__((noreturn));
+void invarg(char *, char *) ATTRIBUTE_NORETURN;
+void duparg(char *, char *) ATTRIBUTE_NORETURN;
+void duparg2(char *, char *) ATTRIBUTE_NORETURN;
int matches(char *arg, char *pattern);
extern int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits);
* Busybox port 2002 by Nick Fedchik <nick@fedchik.org.ua>
* Glenn McGrath <bug1@iinet.net.au>
*
- * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
+ * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
*/
#include <sys/syslog.h>
static unsigned long flags;
-static void serror(const char *s, ...) __attribute__ ((noreturn));
+static void serror(const char *s, ...) ATTRIBUTE_NORETURN;
static void serror(const char *s, ...)
{
struct outdata {
u_char seq; /* sequence number of this packet */
u_char ttl; /* ttl packet left with */
- struct timeval tv __attribute__((packed)); /* time packet left */
+ struct timeval tv ATTRIBUTE_PACKED; /* time packet left */
};
struct IFADDRLIST {
uint8_t tHaddr[6]; /* target's hardware address */
uint8_t tInaddr[4]; /* target's IP address */
uint8_t pad[18]; /* pad for min. Ethernet payload (60 bytes) */
-} __attribute__ ((packed));
+} ATTRIBUTE_PACKED;
/* function prototypes */
int arpping(uint32_t yiaddr, uint32_t ip, uint8_t *arp, char *interface);
*
* Russ Dill <Russ.Dill@asu.edu> July 2001
*
- * 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
*/
#include <sys/time.h>
};
#ifndef IN_BUSYBOX
-static void __attribute__ ((noreturn)) show_usage(void)
+static void ATTRIBUTE_NORETURN show_usage(void)
{
printf(
"Usage: udhcpc [OPTIONS]\n\n"
}
#else
#define show_usage bb_show_usage
-extern void show_usage(void) __attribute__ ((noreturn));
+extern void show_usage(void) ATTRIBUTE_NORETURN;
#endif
+/* vi: set sw=4 ts=4: */
+/*
+ Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
+ */
#include <fcntl.h>
#include <string.h>
#include <stdlib.h>
#ifndef IN_BUSYBOX
-static void __attribute__ ((noreturn)) show_usage(void)
+static void ATTRIBUTE_NORETURN show_usage(void)
{
printf(
"Usage: dumpleases -f <file> -[r|a]\n\n"
* Copyright (C) 2003 by Arthur van Hoff (avh@strangeberry.com)
* Copyright (C) 2004 by David Brownell
*
- * 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 the GPL v2 or later, see the file LICENSE in this tarball.
*/
/*
struct in_addr source_ip;
struct ether_addr target_addr;
struct in_addr target_ip;
-} __attribute__ ((__packed__));
+} ATTRIBUTE_PACKED;
/* 169.254.0.0 */
static const uint32_t LINKLOCAL_ADDR = 0xa9fe0000;
/**
* Print usage information.
*/
-static void __attribute__((noreturn))
+static void ATTRIBUTE_NORETURN
zcip_usage(const char *msg)
{
fprintf(stderr, "%s: %s\n", prog, msg);
* This code is derived from software contributed to Berkeley by
* Kenneth Almquist.
*
- * 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 the GPL v2 or later, see the file LICENSE in this tarball.
*
* Original BSD copyright notice is retained at the end of this file.
*/
/* EXSIG is turned off by evalbltin(). */
-static void exraise(int) __attribute__((__noreturn__));
-static void onint(void) __attribute__((__noreturn__));
+static void exraise(int) ATTRIBUTE_NORETURN;
+static void onint(void) ATTRIBUTE_NORETURN;
-static void sh_error(const char *, ...) __attribute__((__noreturn__));
-static void exerror(int, const char *, ...) __attribute__((__noreturn__));
+static void sh_error(const char *, ...) ATTRIBUTE_NORETURN;
+static void exerror(int, const char *, ...) ATTRIBUTE_NORETURN;
static void sh_warnx(const char *, ...);
static const char *pathopt; /* set by padvance */
static void shellexec(char **, const char *, int)
- __attribute__((__noreturn__));
+ ATTRIBUTE_NORETURN;
static char *padvance(const char **, const char *);
static void find_command(char *, struct cmdentry *, int, const char *);
static struct builtincmd *find_builtin(const char *);
static void onsig(int);
static int dotrap(void);
static void setinteractive(int);
-static void exitshell(void) __attribute__((__noreturn__));
+static void exitshell(void) ATTRIBUTE_NORETURN;
static int decode_signal(const char *, int);
/*
static void exverror(int, const char *, va_list)
- __attribute__((__noreturn__));
+ ATTRIBUTE_NORETURN;
/*
* Called to raise an exception. Since C doesn't include exceptions, we
static char *scanleft(char *, char *, char *, char *, int, int);
static char *scanright(char *, char *, char *, char *, int, int);
static void varunset(const char *, const char *, const char *, int)
- __attribute__((__noreturn__));
+ ATTRIBUTE_NORETURN;
#define pmatch(a, b) !fnmatch((a), (b), 0)
static int xxreadtoken(void);
static int readtoken1(int firstc, int syntax, char *eofmark, int striptabs);
static int noexpand(char *);
-static void synexpect(int) __attribute__((__noreturn__));
-static void synerror(const char *) __attribute__((__noreturn__));
+static void synexpect(int) ATTRIBUTE_NORETURN;
+static void synerror(const char *) ATTRIBUTE_NORETURN;
static void setprompt(int);
* maybe change map[] to use 2-bit entries
* (eventually) remove all the printf's
*
- * 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 the GPL v2 or later, see the file LICENSE in this tarball.
*/
#include <ctype.h> /* isalpha, isdigit */
#include <unistd.h> /* getpid */
/* really run the final data structures: */
static int setup_redirects(struct child_prog *prog, int squirrel[]);
static int run_list_real(struct pipe *pi);
-static void pseudo_exec(struct child_prog *child) __attribute__ ((noreturn));
+static void pseudo_exec(struct child_prog *child) ATTRIBUTE_NORETURN;
static int run_pipe_real(struct pipe *pi);
/* extended glob support: */
static int globhack(const char *src, int flags, glob_t *pglob);
* under the following liberal license: "We have placed this source code in the
* public domain. Use it in any project, free or commercial."
*
- * 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 the GPL v2 or later, see the file LICENSE in this tarball.
*/
/* This shell's parsing engine is officially at a dead-end. Future
static int get_command(FILE * source, char *command);
static int parse_command(char **command_ptr, struct job *job, int *inbg);
static int run_command(struct job *newjob, int inbg, int outpipe[2]);
-static int pseudo_exec(struct child_prog *cmd) __attribute__ ((noreturn));
+static int pseudo_exec(struct child_prog *cmd) ATTRIBUTE_NORETURN;
static int busy_loop(FILE * input);
*
* Copyright (C) 2001 by Gennady Feldman <gfeldman@gena01.com>.
* Changes: Made this a standalone busybox module which uses standalone
- * syslog() client interface.
+ * syslog() client interface.
*
* Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
*
*
* Maintainer: Gennady Feldman <gfeldman@gena01.com> as of Mar 12, 2001
*
- * 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 the GPL v2 or later, see the file LICENSE in this tarball.
*/
#include <stdio.h>
exit(EXIT_SUCCESS);
}
-static void doKlogd(const int console_log_level) __attribute__ ((noreturn));
+static void doKlogd(const int console_log_level) ATTRIBUTE_NORETURN;
static void doKlogd(const int console_log_level)
{
int priority = LOG_INFO;
*
* Maintainer: Gennady Feldman <gfeldman@gena01.com> as of Mar 12, 2001
*
- * 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 the GPL v2 or later, see the file LICENSE in this tarball.
*/
#include <stdio.h>
return n_read;
}
-static void doSyslogd(void) __attribute__ ((noreturn));
+static void doSyslogd(void) ATTRIBUTE_NORETURN;
static void doSyslogd(void)
{
struct sockaddr_un sunx;
*
* Copyright (C) 1992 A. V. Le Blanc (LeBlanc@mcc.ac.uk)
*
- * 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 1 or
- * (at your option) any later version.
+ * Licensed under the GPL v1 or later, see the file LICENSE in this tarball.
*
* Vladimir Oleynik <dzo@simtreas.ru> 2001,2002 Busybox port
*/
unsigned char end_cyl; /* end cylinder */
unsigned char start4[4]; /* starting sector counting from 0 */
unsigned char size4[4]; /* nr of sectors in partition */
-} __attribute__((__packed__));
+} ATTRIBUTE_PACKED;
enum failure {
ioctl_error, unable_to_open, unable_to_read, unable_to_seek,
static uint read_int(uint low, uint dflt, uint high, uint base, char *mesg);
#endif
static const char *partition_type(unsigned char type);
-static void fdisk_fatal(enum failure why) __attribute__ ((noreturn));
+static void fdisk_fatal(enum failure why) ATTRIBUTE_NORETURN;
static void get_geometry(void);
static int get_boot(enum action what);
#define mark_zone(x) (setbit(zone_map,(x)-FIRSTZONE+1),changed=1)
#define unmark_zone(x) (clrbit(zone_map,(x)-FIRSTZONE+1),changed=1)
-static void leave(int) __attribute__ ((noreturn));
+static void leave(int) ATTRIBUTE_NORETURN;
static void leave(int status)
{
if (termios_set)