Clean up and review of header files for conformance to standards

This commit is contained in:
Gregory Nutt 2015-06-12 18:07:47 -06:00
parent 69571155bb
commit e1d36a7eca
10 changed files with 108 additions and 96 deletions

View file

@ -1,7 +1,7 @@
/****************************************************************************
* apps/include/netutils/dhcpc.h
*
* Copyright (C) 2007, 2009-2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009-2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* This logic was leveraged from uIP which also has a BSD-style license:
@ -69,14 +69,15 @@ struct dhcpc_state
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
EXTERN void *dhcpc_open(const void *mac_addr, int mac_len);
EXTERN int dhcpc_request(void *handle, struct dhcpc_state *presult);
EXTERN void dhcpc_close(void *handle);
FAR void *dhcpc_open(FAR const void *mac_addr, int mac_len);
int dhcpc_request(FAR void *handle, FAR struct dhcpc_state *presult);
void dhcpc_close(FAR void *handle);
#undef EXTERN
#ifdef __cplusplus

View file

@ -1,7 +1,7 @@
/****************************************************************************
* apps/include/netutils/dhcpd.h
*
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009, 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* This logic was leveraged from uIP which also has a BSD-style license:
@ -56,12 +56,13 @@
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
EXTERN int dhcpd_run(void);
int dhcpd_run(void);
#undef EXTERN
#ifdef __cplusplus

View file

@ -1,7 +1,7 @@
/****************************************************************************
* apps/include/netutils/ftpd.h
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -54,7 +54,7 @@
* CONFIG_DISABLE_PTHREAD - pthread support is required
* CONFIG_DISABLE_POLL - poll() support is required
*
* Other FTPD configuration options thay may be of interest:
* Other FTPD configuration options that may be of interest:
*
* CONFIG_FTPD_VENDORID - The vendor name to use in FTP communications.
* Default: "NuttX"
@ -117,7 +117,8 @@ typedef FAR void *FTPD_SESSION;
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -142,7 +143,7 @@ extern "C" {
*
****************************************************************************/
EXTERN FTPD_SESSION ftpd_open(void);
FTPD_SESSION ftpd_open(void);
/****************************************************************************
* Name: ftpd_adduser
@ -166,9 +167,9 @@ EXTERN FTPD_SESSION ftpd_open(void);
*
****************************************************************************/
EXTERN int ftpd_adduser(FTPD_SESSION handle, uint8_t accountflags,
FAR const char *user, FAR const char *passwd,
FAR const char *home);
int ftpd_adduser(FTPD_SESSION handle, uint8_t accountflags,
FAR const char *user, FAR const char *passwd,
FAR const char *home);
/****************************************************************************
* Name: ftpd_session
@ -186,13 +187,13 @@ EXTERN int ftpd_adduser(FTPD_SESSION handle, uint8_t accountflags,
*
* Returned Value:
* Zero is returned if the FTP worker was started. On failure, a negated
* errno value is returned to indicate why the servier terminated.
* errno value is returned to indicate why the server terminated.
* -ETIMEDOUT indicates that the user-provided timeout elapsed with no
* connection.
*
****************************************************************************/
EXTERN int ftpd_session(FTPD_SESSION handle, int timeout);
int ftpd_session(FTPD_SESSION handle, int timeout);
/****************************************************************************
* Name: ftpd_close
@ -208,7 +209,7 @@ EXTERN int ftpd_session(FTPD_SESSION handle, int timeout);
*
****************************************************************************/
EXTERN void ftpd_close(FTPD_SESSION handle);
void ftpd_close(FTPD_SESSION handle);
#undef EXTERN
#ifdef __cplusplus

View file

@ -2,7 +2,7 @@
* apps/include/netutils/ipmsfilter.h
* User interface to add/remove IP multicast address
*
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2009, 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -61,7 +61,8 @@
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -84,13 +85,12 @@ extern "C" {
* MCAST_EXCLUDE: Remove multicast address
*
* Return:
* 0 on sucess; Negated errno on failure
* 0 on success; Negated errno on failure
*
****************************************************************************/
EXTERN int ipmsfilter(FAR const char *ifname,
FAR const struct in_addr *multiaddr,
uint32_t fmode);
int ipmsfilter(FAR const char *ifname, FAR const struct in_addr *multiaddr,
uint32_t fmode);
#undef EXTERN
#if defined(__cplusplus)

View file

@ -56,6 +56,7 @@
#define TTYNAMSIZ 16
#define PAP_USERNAME_SIZE 16
#define PAP_PASSWORD_SIZE 16
/****************************************************************************
* Public Types
****************************************************************************/
@ -75,15 +76,18 @@ struct chat_script_s
struct pppd_settings_s
{
/* Serial Interface */
char ttyname[TTYNAMSIZ];
#ifdef CONFIG_NETUTILS_PPPD_PAP
/* PAP Authentication Settings */
char pap_username[PAP_USERNAME_SIZE];
char pap_password[PAP_PASSWORD_SIZE];
#endif /* CONFIG_NETUTILS_PPPD_PAP */
/* Chat Scripts */
struct chat_script_s *connect_script;
struct chat_script_s *disconnect_script;
};
@ -94,7 +98,8 @@ struct pppd_settings_s
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -117,7 +122,7 @@ extern "C" {
*
****************************************************************************/
EXTERN int pppd(struct pppd_settings_s *ppp_settings);
int pppd(struct pppd_settings_s *ppp_settings);
#undef EXTERN
#ifdef __cplusplus

View file

@ -1,7 +1,7 @@
/****************************************************************************
* apps/include/netutils/telnetd.h
*
* Copyright (C) 2007, 2011-2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2011-2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -45,11 +45,11 @@
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/* CONFIG_TELNETD_CONSOLE - Use the first telnet session as the default
/* CONFIG_TELNETD_CONSOLE - Use the first Telnet session as the default
* console.
* CONFIG_TELNETD_RXBUFFER_SIZE - The size of the telnet receive buffer.
* CONFIG_TELNETD_RXBUFFER_SIZE - The size of the Telnet receive buffer.
* Default: 256 bytes.
* CONFIG_TELNETD_TXBUFFER_SIZE - The size of the telnet transmit buffer.
* CONFIG_TELNETD_TXBUFFER_SIZE - The size of the Telnet transmit buffer.
* Default: 256 bytes.
* CONFIG_TELNETD_DUMPBUFFER - dumping of all input/output buffers.
*/
@ -67,7 +67,7 @@
****************************************************************************/
/* An instance of the struct telnetd_config_s structure must be passed to
* telnetd_start in order to configure the new telnet daemon.
* telnetd_start in order to configure the new Telnet daemon.
*/
struct telnetd_config_s
@ -75,10 +75,10 @@ struct telnetd_config_s
/* These fields describe the telnet daemon */
int d_port; /* The port to listen on (in network byte order) */
int d_priority; /* The execution priority of the telnet daemon task */
int d_stacksize; /* The stack size needed by the telnet daemon task */
int d_priority; /* The execution priority of the Telnet daemon task */
int d_stacksize; /* The stack size needed by the Telnet daemon task */
/* These fields describe the priority of each thread created by the telnet
/* These fields describe the priority of each thread created by the Telnet
* daemon.
*/
@ -94,7 +94,8 @@ struct telnetd_config_s
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -103,22 +104,22 @@ extern "C" {
* Name: telnetd_start
*
* Description:
* Start the telnet daemon.
* Start the Telnet daemon.
*
* Parameters:
* config A pointer to a configuration structure that characterizes the
* telnet daemon. This configuration structure may be defined
* Telnet daemon. This configuration structure may be defined
* on the caller's stack because it is not retained by the
* daemon.
*
* Return:
* The process ID (pid) of the new telnet daemon is returned on
* The process ID (pid) of the new Telnet daemon is returned on
* success; A negated errno is returned if the daemon was not successfully
* started.
*
****************************************************************************/
EXTERN int telnetd_start(FAR struct telnetd_config_s *config);
int telnetd_start(FAR struct telnetd_config_s *config);
#undef EXTERN
#ifdef __cplusplus

View file

@ -2,7 +2,7 @@
* apps/include/netutils/webclient.h
* Header file for the HTTP client
*
* Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009, 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Based remotely on the uIP webclient which also has a BSD style license:
@ -75,7 +75,7 @@
* Public types
****************************************************************************/
/* wget calls a user provided function of the follwoing type to process
/* wget calls a user provided function of the following type to process
* each received chuck of the incoming file data. If the system has a file
* system, then it may just write the data to a file. Or it may buffer the
* file in memory. To facilitate this latter case, the caller may modify
@ -104,18 +104,19 @@ typedef void (*wget_callback_t)(FAR char **buffer, int offset,
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
#ifdef WGET_USE_URLENCODE
EXTERN char *web_post_str(FAR char *buffer, int *size, FAR char *name,
FAR char *value);
EXTERN char *web_posts_str(FAR char *buffer, int *size, FAR char **name,
FAR char **value, int len);
EXTERN int web_post_strlen(FAR char *name, FAR char *value);
EXTERN int web_posts_strlen(FAR char **name, FAR char **value, int len);
FAR char *web_post_str(FAR char *buffer, FAR int *size, FAR char *name,
FAR char *value);
FAR char *web_posts_str(FAR char *buffer, FAR int *size, FAR char **name,
FAR char **value, int len);
int web_post_strlen(FAR char *name, FAR char *value);
int web_posts_strlen(FAR char **name, FAR char **value, int len);
#endif
/****************************************************************************
@ -127,7 +128,7 @@ EXTERN int web_posts_strlen(FAR char **name, FAR char **value, int len);
* Note: If the function is passed a host name, it must already be in
* the resolver cache in order for the function to connect to the web
* server. It is therefore up to the calling module to implement the
* resolver calls and the signal handler used for reporting a resolv
* resolver calls and the signal handler used for reporting a resolve
* query answer.
*
* Input Parameters
@ -147,13 +148,12 @@ EXTERN int web_posts_strlen(FAR char **name, FAR char **value, int len);
*
****************************************************************************/
EXTERN int wget(FAR const char *url, FAR char *buffer, int buflen,
wget_callback_t callback, FAR void *arg);
int wget(FAR const char *url, FAR char *buffer, int buflen,
wget_callback_t callback, FAR void *arg);
EXTERN int wget_post(FAR const char *url, FAR const char *posts,
FAR char *buffer, int buflen, wget_callback_t callback,
FAR void *arg);
int wget_post(FAR const char *url, FAR const char *posts, FAR char *buffer,
int buflen, wget_callback_t callback, FAR void *arg);
#undef EXTERN
#ifdef __cplusplus