Commit a2b18545 authored by Niels Möller's avatar Niels Möller

* Changed include file ordering, to follow the same conventions as

lsh and nettle: .c-files include config.h first, then system
files, and finally sftp files. .h-files never include config.h,
and they include system files before sftp files.

Rev: src/sftp/ChangeLog:1.49
Rev: src/sftp/buffer.c:1.18
Rev: src/sftp/buffer.h:1.12
Rev: src/sftp/client.c:1.6
Rev: src/sftp/commands.c:1.15
Rev: src/sftp/dc.c:1.6
Rev: src/sftp/dc.h:1.4
Rev: src/sftp/filemode.c:1.2
Rev: src/sftp/gnu_stuff.c:1.8
Rev: src/sftp/gnu_stuff.h:1.4
Rev: src/sftp/idcache.c:1.4
Rev: src/sftp/io_input.c:1.3
Rev: src/sftp/io_output.c:1.3
Rev: src/sftp/lsftp.c:1.6
Rev: src/sftp/lsftp.h:1.2
Rev: src/sftp/misc_fun.c:1.4
Rev: src/sftp/misc_fun.h:1.3
Rev: src/sftp/rl.c:1.9
Rev: src/sftp/rl.h:1.4
Rev: src/sftp/sftp-server.c:1.21
Rev: src/sftp/sftp-test-client.c:1.14
Rev: src/sftp/sftp_bind.c:1.15
Rev: src/sftp/sftp_bind.h:1.9
Rev: src/sftp/sftp_c.c:1.8
Rev: src/sftp/sftp_c.h:1.6
Rev: src/sftp/str_utils.c:1.7
Rev: src/sftp/str_utils.h:1.4
Rev: src/sftp/werror.c:1.3
Rev: src/sftp/werror.h:1.3
Rev: src/sftp/xmalloc.c:1.3
parent 4b8ee237
2003-05-16 Niels Mller <nisse@cuckoo.hack.org>
* Changed include file ordering, to follow the same conventions as
lsh and nettle: .c-files include config.h first, then system
files, and finally sftp files. .h-files never include config.h,
and they include system files before sftp files.
* dump-hex.c: Include config.h, to get alloca defined properly.
* configure.ac: Use LSH_FUNC_ALLOCA.
2003-03-02 Niels Mller <nisse@cuckoo.hack.org>
* buffer.c (sftp_put_uint64): Fixed WRITE_UINT32 search&replace
......
......@@ -21,10 +21,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "buffer.h"
#include "xmalloc.h"
#include "sftp.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <stdarg.h>
......@@ -36,6 +35,10 @@
#include <stdlib.h>
#include "buffer.h"
#include "xmalloc.h"
#include "sftp.h"
/* Input */
......
......@@ -24,12 +24,6 @@
#ifndef SFTP_BUFFER_H_INCLUDED
#define SFTP_BUFFER_H_INCLUDED
/* Basic configuration */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
/* For off_t */
#include <sys/types.h>
......
......@@ -23,6 +23,12 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <string.h>
#include "client.h"
#include "buffer.h"
......@@ -31,8 +37,6 @@
#include "sftp.h"
#include <string.h>
/* We never have several pending calls at once. */
static uint32_t
sftp_client_new_id(void)
......
......@@ -24,6 +24,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "commands.h"
int ls_longlist = 1;
......
......@@ -24,6 +24,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "dc.h"
static int dc_entries = 0;
......
......@@ -27,10 +27,6 @@
#ifndef LSFTP_DC_H
#define LSFTP_DC_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <sys/time.h>
......
......@@ -15,8 +15,9 @@
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#if HAVE_CONFIG_H
# include <config.h>
# include "config.h"
#endif
#include <sys/types.h>
......
......@@ -23,12 +23,17 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "gnu_stuff.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "gnu_stuff.h"
void lsftp_welcome()
{
printf( "Welcome to %s %s by Pontus Sköld, Niels Möller and various.\n", PACKAGE, VERSION );
......
......@@ -26,10 +26,6 @@
#ifndef LSFTP_GNU_STUFF_H
#define LSFTP_GNU_STUFF_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
void help_option(void);
......
......@@ -20,6 +20,10 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "idcache.h"
#include "xmalloc.h"
......
......@@ -18,15 +18,19 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "io.h"
#include "xmalloc.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <errno.h>
#include <unistd.h>
#include "io.h"
#include "xmalloc.h"
#define SFTP_MAX_STRINGS 2
struct sftp_input
......
......@@ -18,9 +18,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "io.h"
#include "xmalloc.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <errno.h>
......@@ -28,6 +28,10 @@
#include <unistd.h>
#include "io.h"
#include "xmalloc.h"
struct sftp_output
{
int fd;
......
......@@ -24,6 +24,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "lsftp.h"
#include "werror.h"
......
......@@ -26,13 +26,6 @@
#ifndef LSFTP_LSFTP_H
#define LSFTP_LSFTP_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "rl.h"
#include "str_utils.h"
#include "gnu_stuff.h"
#include <stdio.h>
#include "sftp_bind.h"
......@@ -40,6 +33,10 @@
#include <sys/types.h>
#include <unistd.h>
#include "rl.h"
#include "str_utils.h"
#include "gnu_stuff.h"
extern int lsftp_rl_line_done;
extern char* lsftp_rl_line;
......
......@@ -23,9 +23,14 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "misc_fun.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdlib.h>
#include "misc_fun.h"
#ifndef HAVE_GETENV
char** environ;
#endif
......
......@@ -26,10 +26,6 @@
#ifndef LSFTP_MISC_FUN_H
#define LSFTP_MISC_FUN_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
......
......@@ -24,6 +24,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
int lsftp_rl_line_done = 0;
char* lsftp_rl_line = 0;
......
......@@ -27,10 +27,6 @@
#ifndef LSFTP_RL_H
#define LSFTP_RL_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
......
......@@ -50,13 +50,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "io.h"
#include "sftp.h"
#include "filemode.h"
#include "idcache.h"
#include "xmalloc.h"
#include "werror.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <stdarg.h>
......@@ -75,6 +71,14 @@
#include <grp.h>
#include <time.h>
#include "io.h"
#include "sftp.h"
#include "filemode.h"
#include "idcache.h"
#include "xmalloc.h"
#include "werror.h"
const char *werror_program_name = "sftp-server";
#define SFTP_VERSION 3
......
......@@ -20,11 +20,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#include "io.h"
#include "sftp.h"
#include "xmalloc.h"
#include "client.h"
#include "werror.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include <stdlib.h>
......@@ -37,6 +35,13 @@
#include <sys/stat.h>
#include "io.h"
#include "sftp.h"
#include "xmalloc.h"
#include "client.h"
#include "werror.h"
#define SFTP_XFER_BLOCKSIZE 16384
#define SFTP_VERSION 3
......
......@@ -27,6 +27,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "sftp_bind.h"
#include "io.h"
......
......@@ -30,11 +30,6 @@
#ifndef LSFTP_SFTP_BIND_H
#define LSFTP_SFTP_BIND_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#define LSH_CLIENT "lsh"
#define LSH_GATEWAY "lshg"
#define LSH_PROGENV "LSFTP_RSH"
......
......@@ -27,6 +27,10 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include "sftp_c.h"
void
......
......@@ -33,10 +33,6 @@
#define SFTP_VERSION 3
#define SFTP_BLOCKSIZE 16384
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <sys/types.h>
#ifdef HAVE_INTTYPES_H
......
......@@ -23,10 +23,15 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "str_utils.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <string.h>
#include <stdlib.h>
#include "str_utils.h"
char* lsftp_quote( const char* s )
{
/* Maximum size needed = len(s)*2+1 */
......
......@@ -27,10 +27,6 @@
#ifndef LSFTP_STR_UTILS_H
#define LSFTP_STR_UTILS_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
......
......@@ -5,7 +5,9 @@
* $id$
*/
#include "werror.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdarg.h>
#include <stdio.h>
......@@ -13,6 +15,8 @@
#include <unistd.h>
#include "werror.h"
void
werror(const char *format, ...)
{
......
......@@ -8,8 +8,10 @@
#ifndef SFTP_WERROR_H_INCLUDED
#define SFTP_WERROR_H_INCLUDED
#if 0
/* For types and config stuff */
#include "buffer.h"
#endif
extern const char *werror_program_name;
......
/* xmalloc.c
*/
#include "xmalloc.h"
#if HAVE_CONFIG_H
# include "config.h"
#endif
#include <stdio.h>
#include <string.h>
#include "xmalloc.h"
void *
xmalloc(size_t size)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment