2011-06-02 01:09:29 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* apps/examples/ftpc/ftpc.h
|
|
|
|
*
|
2021-06-15 09:09:58 +02:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2011-06-02 01:09:29 +02:00
|
|
|
*
|
2021-06-15 09:09:58 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-06-02 01:09:29 +02:00
|
|
|
*
|
2021-06-15 09:09:58 +02:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2011-06-02 01:09:29 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __APPS_EXAMPLES_FTPC_FTPC_H
|
|
|
|
#define __APPS_EXAMPLES_FTPC_FTPC_H
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
2016-07-11 18:11:18 +02:00
|
|
|
#include "netutils/ftpc.h"
|
2011-06-02 01:09:29 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
2015-10-02 22:06:11 +02:00
|
|
|
* Pre-processor Definitions
|
2011-06-02 01:09:29 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* Maximum size of one command line */
|
|
|
|
|
|
|
|
#ifndef CONFIG_FTPC_LINELEN
|
|
|
|
# define CONFIG_FTPC_LINELEN 80
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* If CONFIG_STDIO_LINEBUFFER is defined, the STDIO buffer will be flushed
|
|
|
|
* on each new line. Otherwise, STDIO needs to be explicitly flushed to
|
|
|
|
* see the output in context.
|
|
|
|
*/
|
|
|
|
|
2020-08-13 16:17:42 +02:00
|
|
|
#if defined(CONFIG_FILE_STREAM) && CONFIG_STDIO_BUFFER_SIZE > 0 && \
|
2019-02-11 20:10:10 +01:00
|
|
|
!defined(CONFIG_STDIO_LINEBUFFER)
|
2011-06-02 01:09:29 +02:00
|
|
|
# define FFLUSH() fflush(stdout)
|
|
|
|
#else
|
|
|
|
# define FFLUSH()
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Types
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
typedef int (*cmd_t)(SESSION handle, int argc, char **argv);
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* FTP command handlers */
|
|
|
|
|
2011-06-02 20:36:20 +02:00
|
|
|
extern int cmd_rlogin(SESSION handle, int argc, char **argv);
|
|
|
|
extern int cmd_rquit(SESSION handle, int argc, char **argv);
|
|
|
|
extern int cmd_rchdir(SESSION handle, int argc, char **argv);
|
2011-06-02 01:09:29 +02:00
|
|
|
extern int cmd_rpwd(SESSION handle, int argc, char **argv);
|
2011-06-02 20:36:20 +02:00
|
|
|
extern int cmd_rcdup(SESSION handle, int argc, char **argv);
|
|
|
|
extern int cmd_rmkdir(SESSION handle, int argc, char **argv);
|
|
|
|
|
|
|
|
extern int cmd_rrmdir(SESSION handle, int argc, char **argv);
|
|
|
|
extern int cmd_runlink(SESSION handle, int argc, char **argv);
|
|
|
|
extern int cmd_rchmod(SESSION handle, int argc, char **argv);
|
|
|
|
extern int cmd_rrename(SESSION handle, int argc, char **argv);
|
|
|
|
extern int cmd_rsize(SESSION handle, int argc, char **argv);
|
|
|
|
extern int cmd_rtime(SESSION handle, int argc, char **argv);
|
|
|
|
extern int cmd_ridle(SESSION handle, int argc, char **argv);
|
|
|
|
extern int cmd_rnoop(SESSION handle, int argc, char **argv);
|
2011-06-02 01:09:29 +02:00
|
|
|
extern int cmd_rhelp(SESSION handle, int argc, char **argv);
|
|
|
|
extern int cmd_rls(SESSION handle, int argc, char **argv);
|
2011-06-02 20:36:20 +02:00
|
|
|
extern int cmd_rget(SESSION handle, int argc, char **argv);
|
|
|
|
extern int cmd_rput(SESSION handle, int argc, char **argv);
|
2011-06-02 01:09:29 +02:00
|
|
|
|
|
|
|
#endif /* __APPS_EXAMPLES_FTPC_FTPC_H */
|