Switching to C99 stdint.h types

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2340 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo
2009-12-14 23:32:23 +00:00
parent a350286c7c
commit eeec4073a9
85 changed files with 1405 additions and 1061 deletions
+8 -6
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* arpa/inet.h
* include/arpa/inet.h
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,9 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <netinet/in.h>
/****************************************************************************
@@ -89,10 +91,10 @@ extern "C" {
/* Functions to convert between nost and network byte ordering */
EXTERN uint32 ntohl (uint32 nl);
EXTERN uint16 ntohs (uint16 ns);
EXTERN uint32 htonl (uint32 hl);
EXTERN uint16 htons (uint16 hs);
EXTERN uint32_t ntohl(uint32_t nl);
EXTERN uint16_t ntohs(uint16_t ns);
EXTERN uint32_t htonl(uint32_t hl);
EXTERN uint16_t htons(uint16_t hs);
/* Functions to manipulate address representations */
+17 -17
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/assert.h
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -40,11 +40,11 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <nuttx/compiler.h>
#include <stdint.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* Macro Name: ASSERT, ASSERTCODE, et al. */
@@ -57,27 +57,27 @@
#ifdef CONFIG_HAVE_FILENAME
# define ASSERT(f) \
{ if (!(f)) up_assert((const ubyte *)__FILE__, (int)__LINE__); }
{ if (!(f)) up_assert((const uint8_t *)__FILE__, (int)__LINE__); }
# define ASSERTCODE(f, errCode) \
{ if (!(f)) up_assert_code((const ubyte *)__FILE__, (int)__LINE__, errCode); }
# define ASSERTCODE(f, code) \
{ if (!(f)) up_assert_code((const uint8_t *)__FILE__, (int)__LINE__, code); }
# ifdef CONFIG_DEBUG
# define DEBUGASSERT(f) \
{ if (!(f)) up_assert((const ubyte *)__FILE__, (int)__LINE__); }
{ if (!(f)) up_assert((const uint8_t *)__FILE__, (int)__LINE__); }
# else
# define DEBUGASSERT(f)
# endif /* CONFIG_DEBUG */
# define PANIC(errCode) \
up_assert_code((const ubyte *)__FILE__, (int)__LINE__, (errCode)|0x8000)
# define PANIC(code) \
up_assert_code((const uint8_t *)__FILE__, (int)__LINE__, (code)|0x8000)
#else
# define ASSERT(f) \
{ if (!(f)) up_assert(); }
# define ASSERTCODE(f, errCode) \
{ if (!(f)) up_assert_code(errCode); }
# define ASSERTCODE(f, code) \
{ if (!(f)) up_assert_code(code); }
# ifdef CONFIG_DEBUG
# define DEBUGASSERT(f) \
@@ -86,8 +86,8 @@
# define DEBUGASSERT(f)
# endif /* CONFIG_DEBUG */
# define PANIC(errCode) \
up_assert_code((errCode)|0x8000)
# define PANIC(code) \
up_assert_code((code)|0x8000)
#endif
@@ -107,12 +107,12 @@ extern "C" {
#endif
#ifdef CONFIG_HAVE_FILENAME
EXTERN void up_assert(const ubyte *filename, int linenum);
EXTERN void up_assert_code(const ubyte *filename, int linenum,
int error_code);
EXTERN void up_assert(FAR const uint8_t *filename, int linenum);
EXTERN void up_assert_code(FAR const uint8_t *filename, int linenum,
int errcode);
#else
EXTERN void up_assert(void);
EXTERN void up_assert_code(int error_code);
EXTERN void up_assert_code(int errcode);
#endif
#undef EXTERN
+2 -4
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/ctype.h
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -46,10 +46,8 @@
* Included Files
************************************************************/
#include <sys/types.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
************************************************************/
/****************************************************************************
+1 -16
View File
@@ -42,6 +42,7 @@
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <stddef.h>
//***************************************************************************
@@ -50,22 +51,6 @@
namespace std
{
// NuttX specific types
using ::sbyte;
using ::ubyte;
using ::uint8;
using ::boolean;
using ::sint16;
using ::uint16;
using ::sint32;
using ::uint32;
#ifdef CONFIG_HAVE_LONG_LONG
using ::sint64;
using ::uint64;
#endif
using ::irqstate_t;
// Standard types
using ::float32;
+7 -5
View File
@@ -42,10 +42,11 @@
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <sys/types.h>
#include <stdint.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* Debug macros to runtime filter the debug messages sent to the console. In
@@ -496,15 +497,16 @@ extern "C" {
* on or the other of the following.
*/
EXTERN int lib_rawprintf(const char *format, ...);
EXTERN int lib_rawprintf(FAR const char *format, ...);
#ifdef CONFIG_ARCH_LOWPUTC
EXTERN int lib_lowprintf(const char *format, ...);
EXTERN int lib_lowprintf(FAR const char *format, ...);
#endif
/* Dump a buffer of data */
EXTERN void lib_dumpbuffer(FAR const char *msg, FAR const ubyte *buffer, unsigned int buflen);
EXTERN void lib_dumpbuffer(FAR const char *msg, FAR const uint8_t *buffer,
unsigned int buflen);
/* If the cross-compiler's pre-processor does not support variable
* length arguments, then these additional APIs will be built.
+5 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/dirent.h
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,11 +41,13 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <limits.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* File type code for the d_type field in dirent struct.
@@ -75,7 +77,7 @@
struct dirent
{
ubyte d_type; /* type of file */
uint8_t d_type; /* type of file */
char d_name[NAME_MAX+1]; /* filename */
};
+7 -5
View File
@@ -41,7 +41,9 @@
********************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
/********************************************************************************
* Definitions
@@ -113,11 +115,11 @@
struct flock
{
sint16 l_type; /* Type of lock: F_RDLCK, F_WRLCK, F_UNLCK */
sint16 l_whence; /* How to interpret l_start: SEEK_SET, SEEK_CUR, SEEK_END */
off_t l_start; /* Starting offset for lock */
off_t l_len; /* Number of bytes to lock */
pid_t l_pid; /* PID of process blocking our lock (F_GETLK only) */
int16_t l_type; /* Type of lock: F_RDLCK, F_WRLCK, F_UNLCK */
int16_t l_whence; /* How to interpret l_start: SEEK_SET, SEEK_CUR, SEEK_END */
off_t l_start; /* Starting offset for lock */
off_t l_len; /* Number of bytes to lock */
pid_t l_pid; /* PID of process blocking our lock (F_GETLK only) */
};
/********************************************************************************
+2 -2
View File
@@ -1,7 +1,7 @@
/********************************************************************************
* include/limits.h
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,7 @@
#include <arch/limits.h>
/********************************************************************************
* Definitions
* Pre-processor Definitions
********************************************************************************/
/* Configurable limits required by POSIX
+6 -6
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/net/ethernet.h
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -40,7 +40,7 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <stdint.h>
/****************************************************************************
* Pre-Processor Definitions
@@ -54,14 +54,14 @@
struct ether_addr
{
uint8 ether_addr_octet[6]; /* 48-bit Ethernet address */
uint8_t ether_addr_octet[6]; /* 48-bit Ethernet address */
};
struct ether_header
{
uint8 ether_dhost[ETHER_ADDR_LEN]; /* Destination Ethernet address */
uint8 ether_shost[ETHER_ADDR_LEN]; /* Source Ethernet address */
uint16 ether_type; /* Ethernet packet type*/
uint8_t ether_dhost[ETHER_ADDR_LEN]; /* Destination Ethernet address */
uint8_t ether_shost[ETHER_ADDR_LEN]; /* Source Ethernet address */
uint16_t ether_type; /* Ethernet packet type*/
};
/****************************************************************************
+3 -3
View File
@@ -42,10 +42,10 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <stdint.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -54,7 +54,7 @@
struct dhcpc_state
{
uint16 lease_time[2];
uint16_t lease_time[2];
struct in_addr serverid;
struct in_addr ipaddr;
struct in_addr netmask;
+1 -3
View File
@@ -42,10 +42,8 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
+1 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* net/uip/httpd.h
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Based on uIP which also has a BSD style license:
@@ -44,8 +44,6 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
/****************************************************************************
* Public Function Prototypes
****************************************************************************/
-1
View File
@@ -33,7 +33,6 @@
#ifndef __UIP_RESOLV_H__
#define __UIP_RESOLV_H__
#include <sys/types.h>
#include <net/uip/uipopt.h>
#undef EXTERN
-2
View File
@@ -44,8 +44,6 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <net/uip/uipopt.h>
#include <net/uip/uip.h>
+5 -5
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/net/uip/tftp.h
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -40,11 +40,11 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <stdbool.h>
#include <arpa/inet.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -62,8 +62,8 @@ extern "C" {
#define EXTERN extern
#endif
EXTERN int tftpget(const char *remote, const char *local, in_addr_t addr, boolean binary);
EXTERN int tftpput(const char *local, const char *remote, in_addr_t addr, boolean binary);
EXTERN int tftpget(const char *remote, const char *local, in_addr_t addr, bool binary);
EXTERN int tftpput(const char *local, const char *remote, in_addr_t addr, bool binary);
#undef EXTERN
#ifdef __cplusplus
+2 -2
View File
@@ -41,7 +41,7 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/symtab.h>
/****************************************************************************
@@ -69,7 +69,7 @@ extern "C" {
*/
EXTERN FAR const struct symtab_s *g_thttpdsymtab;
EXTERN int g_thttpdnsymbols;
EXTERN int g_thttpdnsymbols;
/****************************************************************************
* Public Function Prototypes
+17 -16
View File
@@ -43,8 +43,9 @@
#define __UIP_ARCH_H
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <stdint.h>
#include <net/if.h>
#include <net/uip/uip.h>
@@ -56,7 +57,7 @@
#include <net/ethernet.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
@@ -121,30 +122,30 @@ struct uip_driver_s
* }
*/
uint8 d_buf[CONFIG_NET_BUFSIZE + 2];
uint8_t d_buf[CONFIG_NET_BUFSIZE + 2];
/* d_appdata points to the location where application data can be read from
* or written into a packet.
*/
uint8 *d_appdata;
uint8_t *d_appdata;
/* This is a pointer into d_buf where a user application may append
* data to be sent.
*/
uint8 *d_snddata;
uint8_t *d_snddata;
#ifdef CONFIG_NET_TCPURGDATA
/* This pointer points to any urgent TCP data that has been received. Only
* present if compiled with support for urgent data (CONFIG_NET_TCPURGDATA).
*/
uint8 *d_urgdata;
uint8_t *d_urgdata;
/* Length of the (received) urgent data */
uint16 d_urglen;
uint16_t d_urglen;
#endif
/* The length of the packet in the d_buf buffer.
@@ -160,13 +161,13 @@ struct uip_driver_s
* packet.
*/
uint16 d_len;
uint16_t d_len;
/* When d_buf contains outgoing xmit data, xmtlen is nonzero and represents
* the amount of appllcation data after d_snddata
*/
uint16 d_sndlen;
uint16_t d_sndlen;
/* Driver callbacks */
@@ -315,8 +316,8 @@ extern int uip_timer(struct uip_driver_s *dev, uip_poll_callback_t callback, int
* uip_add32 only.
*/
extern void uip_add32(const uint8 *op32, uint16 op16, uint8 *sum);
extern void uip_incr32(uint8 *op32, uint16 op16);
extern void uip_add32(const uint8_t *op32, uint16_t op16, uint8_t *sum);
extern void uip_incr32(uint8_t *op32, uint16_t op16);
/* Calculate the Internet checksum over a buffer.
*
@@ -337,7 +338,7 @@ extern void uip_incr32(uint8 *op32, uint16 op16);
* Return: The Internet checksum of the buffer.
*/
extern uint16 uip_chksum(uint16 *buf, uint16 len);
extern uint16_t uip_chksum(uint16_t *buf, uint16_t len);
/* Calculate the IP header checksum of the packet header in d_buf.
*
@@ -348,7 +349,7 @@ extern uint16 uip_chksum(uint16 *buf, uint16 len);
* buffer.
*/
extern uint16 uip_ipchksum(struct uip_driver_s *dev);
extern uint16_t uip_ipchksum(struct uip_driver_s *dev);
/* Calculate the TCP checksum of the packet in d_buf and d_appdata.
*
@@ -363,10 +364,10 @@ extern uint16 uip_ipchksum(struct uip_driver_s *dev);
* to by d_appdata.
*/
extern uint16 uip_tcpchksum(struct uip_driver_s *dev);
extern uint16_t uip_tcpchksum(struct uip_driver_s *dev);
extern uint16 uip_udpchksum(struct uip_driver_s *dev);
extern uint16 uip_icmpchksum(struct uip_driver_s *dev, int len);
extern uint16_t uip_udpchksum(struct uip_driver_s *dev);
extern uint16_t uip_icmpchksum(struct uip_driver_s *dev, int len);
#endif /* __UIP_ARCH_H */
+9 -8
View File
@@ -46,8 +46,9 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/compiler.h>
#include <stdint.h>
#include <net/ethernet.h>
#include <net/uip/uip.h>
@@ -72,9 +73,9 @@
struct uip_eth_hdr
{
uint8 dest[6]; /* Ethernet destination address (6 bytes) */
uint8 src[6]; /* Ethernet source address (6 bytes) */
uint16 type; /* Type code (2 bytes) */
uint8_t dest[6]; /* Ethernet destination address (6 bytes) */
uint8_t src[6]; /* Ethernet source address (6 bytes) */
uint16_t type; /* Type code (2 bytes) */
};
/* One entry in the ARP table (volatile!) */
@@ -83,7 +84,7 @@ struct arp_entry
{
in_addr_t at_ipaddr; /* IP address */
struct ether_addr at_ethaddr; /* Hardware address */
uint8 at_time;
uint8_t at_time;
};
/****************************************************************************
@@ -181,15 +182,15 @@ EXTERN void uip_arp_timer(void);
* address of an existing association.
*
* Input parameters:
* pipaddr - Refers to an IP address uint16[2] in network order
* ethaddr - Refers to a HW address uint8[IFHWADDRLEN]
* pipaddr - Refers to an IP address uint16_t[2] in network order
* ethaddr - Refers to a HW address uint8_t[IFHWADDRLEN]
*
* Assumptions
* Interrupts are disabled
*
****************************************************************************/
EXTERN void uip_arp_update(uint16 *pipaddr, uint8 *ethaddr);
EXTERN void uip_arp_update(uint16_t *pipaddr, uint8_t *ethaddr);
/****************************************************************************
* Name: uip_arp_find
+31 -30
View File
@@ -46,11 +46,12 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <net/uip/uipopt.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* ICMP/ICMP6 definitions */
@@ -115,12 +116,12 @@ struct uip_icmpip_hdr
/* IPv6 Ip header */
uint8 vtc; /* Bits 0-3: version, bits 4-7: traffic class (MS) */
uint8 tcf; /* Bits 0-3: traffic class (LS), bits 4-7: flow label (MS) */
uint16 flow; /* 16-bit flow label (LS) */
uint8 len[2]; /* 16-bit Payload length */
uint8 proto; /* 8-bit Next header (same as IPv4 protocol field) */
uint8 ttl; /* 8-bit Hop limit (like IPv4 TTL field) */
uint8_t vtc; /* Bits 0-3: version, bits 4-7: traffic class (MS) */
uint8_t tcf; /* Bits 0-3: traffic class (LS), bits 4-7: flow label (MS) */
uint16_t flow; /* 16-bit flow label (LS) */
uint8_t len[2]; /* 16-bit Payload length */
uint8_t proto; /* 8-bit Next header (same as IPv4 protocol field) */
uint8_t ttl; /* 8-bit Hop limit (like IPv4 TTL field) */
uip_ip6addr_t srcipaddr; /* 128-bit Source address */
uip_ip6addr_t destipaddr; /* 128-bit Destination address */
@@ -128,24 +129,24 @@ struct uip_icmpip_hdr
/* IPv4 IP header */
uint8 vhl; /* 8-bit Version (4) and header length (5 or 6) */
uint8 tos; /* 8-bit Type of service (e.g., 6=TCP) */
uint8 len[2]; /* 16-bit Total length */
uint8 ipid[2]; /* 16-bit Identification */
uint8 ipoffset[2]; /* 16-bit IP flags + fragment offset */
uint8 ttl; /* 8-bit Time to Live */
uint8 proto; /* 8-bit Protocol */
uint16 ipchksum; /* 16-bit Header checksum */
uint16 srcipaddr[2]; /* 32-bit Source IP address */
uint16 destipaddr[2]; /* 32-bit Destination IP address */
uint8_t vhl; /* 8-bit Version (4) and header length (5 or 6) */
uint8_t tos; /* 8-bit Type of service (e.g., 6=TCP) */
uint8_t len[2]; /* 16-bit Total length */
uint8_t ipid[2]; /* 16-bit Identification */
uint8_t ipoffset[2]; /* 16-bit IP flags + fragment offset */
uint8_t ttl; /* 8-bit Time to Live */
uint8_t proto; /* 8-bit Protocol */
uint16_t ipchksum; /* 16-bit Header checksum */
uint16_t srcipaddr[2]; /* 32-bit Source IP address */
uint16_t destipaddr[2]; /* 32-bit Destination IP address */
#endif /* CONFIG_NET_IPv6 */
/* ICMP header */
uint8 type; /* Defines the format of the ICMP message */
uint8 icode; /* Further qualifies the ICMP messsage */
uint16 icmpchksum; /* Checksum of ICMP header and data */
uint8_t type; /* Defines the format of the ICMP message */
uint8_t icode; /* Further qualifies the ICMP messsage */
uint16_t icmpchksum; /* Checksum of ICMP header and data */
/* Data following the ICMP header contains the data specific to the
* message type indicated by the Type and Code fields.
@@ -155,19 +156,19 @@ struct uip_icmpip_hdr
/* ICMP_ECHO_REQUEST and ICMP_ECHO_REPLY data */
uint16 id; /* Used to match requests with replies */
uint16 seqno; /* " " "" " " " " " " " " */
uint16_t id; /* Used to match requests with replies */
uint16_t seqno; /* " " "" " " " " " " " " */
#else /* !CONFIG_NET_IPv6 */
/* ICMP6_ECHO_REQUEST and ICMP6_ECHO_REPLY data */
uint8 flags;
uint8 reserved1;
uint8 reserved2;
uint8 reserved3;
uint8 icmp6data[16];
uint8 options[1];
uint8_t flags;
uint8_t reserved1;
uint8_t reserved2;
uint8_t reserved3;
uint8_t icmp6data[16];
uint8_t options[1];
#endif /* !CONFIG_NET_IPv6 */
};
@@ -201,7 +202,7 @@ extern "C" {
#define EXTERN extern
#endif
EXTERN int uip_ping(uip_ipaddr_t addr, uint16 id, uint16 seqno, uint16 datalen, int dsecs);
EXTERN int uip_ping(uip_ipaddr_t addr, uint16_t id, uint16_t seqno, uint16_t datalen, int dsecs);
#undef EXTERN
#ifdef __cplusplus
+9 -7
View File
@@ -50,12 +50,14 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <pthread.h>
#include <netinet/in.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* SOCK_DGRAM is the preferred socket type to use when we just want a
@@ -89,12 +91,12 @@
* Return: Non-zero If the IP address was parsed.
*/
extern boolean uiplib_ipaddrconv(const char *addrstr, ubyte *addr);
extern bool uiplib_ipaddrconv(const char *addrstr, uint8_t *addr);
/* Get and set IP/MAC addresses */
extern int uip_setmacaddr(const char *ifname, const uint8 *macaddr);
extern int uip_getmacaddr(const char *ifname, uint8 *macaddr);
extern int uip_setmacaddr(const char *ifname, const uint8_t *macaddr);
extern int uip_getmacaddr(const char *ifname, uint8_t *macaddr);
#ifdef CONFIG_NET_IPv6
extern int uip_gethostaddr(const char *ifname, struct in6_addr *addr);
@@ -110,12 +112,12 @@ extern int uip_setnetmask(const char *ifname, const struct in_addr *addr);
/* HTTP support */
extern int uip_parsehttpurl(const char *url, uint16 *port,
extern int uip_parsehttpurl(const char *url, uint16_t *port,
char *hostname, int hostlen,
char *filename, int namelen);
/* Generic server logic */
extern void uip_server(uint16 portno, pthread_startroutine_t handler, int stacksize);
extern void uip_server(uint16_t portno, pthread_startroutine_t handler, int stacksize);
#endif /* __NET_UIP_UIP_LIB_H */
+50 -49
View File
@@ -6,7 +6,7 @@
* of C macros that are used by uIP programs as well as internal uIP
* structures, TCP/IP header structures and function declarations.
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* This logic was leveraged from uIP which also has a BSD-style license:
@@ -52,11 +52,12 @@
#include <nuttx/config.h>
#ifdef CONFIG_NET_TCP
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <net/uip/uipopt.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* TCP definitions */
@@ -124,25 +125,25 @@ struct uip_conn
{
dq_entry_t node; /* Implements a doubly linked list */
uip_ipaddr_t ripaddr; /* The IP address of the remote host */
uint16 lport; /* The local TCP port, in network byte order */
uint16 rport; /* The remoteTCP port, in network byte order */
uint8 rcv_nxt[4]; /* The sequence number that we expect to
uint16_t lport; /* The local TCP port, in network byte order */
uint16_t rport; /* The remoteTCP port, in network byte order */
uint8_t rcv_nxt[4]; /* The sequence number that we expect to
* receive next */
uint8 snd_nxt[4]; /* The sequence number that was last sent by us */
uint16 len; /* Length of the data that was previously sent */
uint16 mss; /* Current maximum segment size for the
uint8_t snd_nxt[4]; /* The sequence number that was last sent by us */
uint16_t len; /* Length of the data that was previously sent */
uint16_t mss; /* Current maximum segment size for the
* connection */
uint16 initialmss; /* Initial maximum segment size for the
uint16_t initialmss; /* Initial maximum segment size for the
* connection */
uint8 crefs; /* Reference counts on this instance */
uint8 sa; /* Retransmission time-out calculation state
uint8_t crefs; /* Reference counts on this instance */
uint8_t sa; /* Retransmission time-out calculation state
* variable */
uint8 sv; /* Retransmission time-out calculation state
uint8_t sv; /* Retransmission time-out calculation state
* variable */
uint8 rto; /* Retransmission time-out */
uint8 tcpstateflags; /* TCP state and flags */
uint8 timer; /* The retransmission timer (units: half-seconds) */
uint8 nrtx; /* The number of retransmissions for the last
uint8_t rto; /* Retransmission time-out */
uint8_t tcpstateflags; /* TCP state and flags */
uint8_t timer; /* The retransmission timer (units: half-seconds) */
uint8_t nrtx; /* The number of retransmissions for the last
* segment sent */
/* Read-ahead buffering.
@@ -204,7 +205,7 @@ struct uip_conn
/* connection_event() is called on any of the subset of connection-related events */
FAR void *connection_private;
void (*connection_event)(FAR struct uip_conn *conn, uint16 flags);
void (*connection_event)(FAR struct uip_conn *conn, uint16_t flags);
};
/* The following structure is used to handle read-ahead buffering for TCP
@@ -217,8 +218,8 @@ struct uip_conn
struct uip_readahead_s
{
sq_entry_t rh_node; /* Supports a singly linked list */
uint16 rh_nbytes; /* Number of bytes available in this buffer */
uint8 rh_buffer[CONFIG_NET_TCP_READAHEAD_BUFSIZE];
uint16_t rh_nbytes; /* Number of bytes available in this buffer */
uint8_t rh_buffer[CONFIG_NET_TCP_READAHEAD_BUFSIZE];
};
#endif
@@ -271,12 +272,12 @@ struct uip_tcpip_hdr
/* IPv6 Ip header */
uint8 vtc; /* Bits 0-3: version, bits 4-7: traffic class (MS) */
uint8 tcf; /* Bits 0-3: traffic class (LS), 4-bits: flow label (MS) */
uint16 flow; /* 16-bit flow label (LS) */
uint8 len[2]; /* 16-bit Payload length */
uint8 proto; /* 8-bit Next header (same as IPv4 protocol field) */
uint8 ttl; /* 8-bit Hop limit (like IPv4 TTL field) */
uint8_t vtc; /* Bits 0-3: version, bits 4-7: traffic class (MS) */
uint8_t tcf; /* Bits 0-3: traffic class (LS), 4-bits: flow label (MS) */
uint16_t flow; /* 16-bit flow label (LS) */
uint8_t len[2]; /* 16-bit Payload length */
uint8_t proto; /* 8-bit Next header (same as IPv4 protocol field) */
uint8_t ttl; /* 8-bit Hop limit (like IPv4 TTL field) */
uip_ip6addr_t srcipaddr; /* 128-bit Source address */
uip_ip6addr_t destipaddr; /* 128-bit Destination address */
@@ -284,31 +285,31 @@ struct uip_tcpip_hdr
/* IPv4 IP header */
uint8 vhl; /* 8-bit Version (4) and header length (5 or 6) */
uint8 tos; /* 8-bit Type of service (e.g., 6=TCP) */
uint8 len[2]; /* 16-bit Total length */
uint8 ipid[2]; /* 16-bit Identification */
uint8 ipoffset[2]; /* 16-bit IP flags + fragment offset */
uint8 ttl; /* 8-bit Time to Live */
uint8 proto; /* 8-bit Protocol */
uint16 ipchksum; /* 16-bit Header checksum */
uint16 srcipaddr[2]; /* 32-bit Source IP address */
uint16 destipaddr[2]; /* 32-bit Destination IP address */
uint8_t vhl; /* 8-bit Version (4) and header length (5 or 6) */
uint8_t tos; /* 8-bit Type of service (e.g., 6=TCP) */
uint8_t len[2]; /* 16-bit Total length */
uint8_t ipid[2]; /* 16-bit Identification */
uint8_t ipoffset[2]; /* 16-bit IP flags + fragment offset */
uint8_t ttl; /* 8-bit Time to Live */
uint8_t proto; /* 8-bit Protocol */
uint16_t ipchksum; /* 16-bit Header checksum */
uint16_t srcipaddr[2]; /* 32-bit Source IP address */
uint16_t destipaddr[2]; /* 32-bit Destination IP address */
#endif /* CONFIG_NET_IPv6 */
/* TCP header */
uint16 srcport;
uint16 destport;
uint8 seqno[4];
uint8 ackno[4];
uint8 tcpoffset;
uint8 flags;
uint8 wnd[2];
uint16 tcpchksum;
uint8 urgp[2];
uint8 optdata[4];
uint16_t srcport;
uint16_t destport;
uint8_t seqno[4];
uint8_t ackno[4];
uint8_t tcpoffset;
uint8_t flags;
uint8_t wnd[2];
uint16_t tcpchksum;
uint8_t urgp[2];
uint8_t optdata[4];
};
/****************************************************************************
@@ -401,9 +402,9 @@ extern int uip_backlogdestroy(FAR struct uip_conn *conn);
extern int uip_backlogadd(FAR struct uip_conn *conn, FAR struct uip_conn *blconn);
#ifndef CONFIG_DISABLE_POLL
extern boolean uip_backlogavailable(FAR struct uip_conn *conn);
extern bool uip_backlogavailable(FAR struct uip_conn *conn);
#else
# define uip_backlogavailable(conn) (FALSE);
# define uip_backlogavailable(conn) (false);
#endif
extern FAR struct uip_conn *uip_backlogremove(FAR struct uip_conn *conn);
extern int uip_backlogdelete(FAR struct uip_conn *conn, FAR struct uip_conn *blconn);
@@ -412,7 +413,7 @@ extern int uip_backlogdelete(FAR struct uip_conn *conn, FAR struct uip_conn *blc
# define uip_backlogcreate(conn,nblg) (-ENOSYS)
# define uip_backlogdestroy(conn) (-ENOSYS)
# define uip_backlogadd(conn,blconn) (-ENOSYS)
# define uip_backlogavailable(conn) (FALSE);
# define uip_backlogavailable(conn) (false);
# define uip_backlogremove(conn) (NULL)
#endif
+32 -31
View File
@@ -6,7 +6,7 @@
* of C macros that are used by uIP programs as well as internal uIP
* structures, UDP header structures and function declarations.
*
* Copyright (C) 2007 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* This logic was leveraged from uIP which also has a BSD-style license:
@@ -50,11 +50,12 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <net/uip/uipopt.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* Header sizes */
@@ -74,10 +75,10 @@ struct uip_udp_conn
{
dq_entry_t node; /* Supports a doubly linked list */
uip_ipaddr_t ripaddr; /* The IP address of the remote peer */
uint16 lport; /* The local port number in network byte order */
uint16 rport; /* The remote port number in network byte order */
uint8 ttl; /* Default time-to-live */
uint8 crefs; /* Reference counts on this instance */
uint16_t lport; /* The local port number in network byte order */
uint16_t rport; /* The remote port number in network byte order */
uint8_t ttl; /* Default time-to-live */
uint8_t crefs; /* Reference counts on this instance */
/* Defines the list of UDP callbacks */
@@ -92,12 +93,12 @@ struct uip_udpip_hdr
/* IPv6 Ip header */
uint8 vtc; /* Bits 0-3: version, bits 4-7: traffic class (MS) */
uint8 tcf; /* Bits 0-3: traffic class (LS), 4-bits: flow label (MS) */
uint16 flow; /* 16-bit flow label (LS) */
uint8 len[2]; /* 16-bit Payload length */
uint8 proto; /* 8-bit Next header (same as IPv4 protocol field) */
uint8 ttl; /* 8-bit Hop limit (like IPv4 TTL field) */
uint8_t vtc; /* Bits 0-3: version, bits 4-7: traffic class (MS) */
uint8_t tcf; /* Bits 0-3: traffic class (LS), 4-bits: flow label (MS) */
uint16_t flow; /* 16-bit flow label (LS) */
uint8_t len[2]; /* 16-bit Payload length */
uint8_t proto; /* 8-bit Next header (same as IPv4 protocol field) */
uint8_t ttl; /* 8-bit Hop limit (like IPv4 TTL field) */
uip_ip6addr_t srcipaddr; /* 128-bit Source address */
uip_ip6addr_t destipaddr; /* 128-bit Destination address */
@@ -105,25 +106,25 @@ struct uip_udpip_hdr
/* IPv4 header */
uint8 vhl; /* 8-bit Version (4) and header length (5 or 6) */
uint8 tos; /* 8-bit Type of service (e.g., 6=TCP) */
uint8 len[2]; /* 16-bit Total length */
uint8 ipid[2]; /* 16-bit Identification */
uint8 ipoffset[2]; /* 16-bit IP flags + fragment offset */
uint8 ttl; /* 8-bit Time to Live */
uint8 proto; /* 8-bit Protocol */
uint16 ipchksum; /* 16-bit Header checksum */
uint16 srcipaddr[2]; /* 32-bit Source IP address */
uint16 destipaddr[2]; /* 32-bit Destination IP address */
uint8_t vhl; /* 8-bit Version (4) and header length (5 or 6) */
uint8_t tos; /* 8-bit Type of service (e.g., 6=TCP) */
uint8_t len[2]; /* 16-bit Total length */
uint8_t ipid[2]; /* 16-bit Identification */
uint8_t ipoffset[2]; /* 16-bit IP flags + fragment offset */
uint8_t ttl; /* 8-bit Time to Live */
uint8_t proto; /* 8-bit Protocol */
uint16_t ipchksum; /* 16-bit Header checksum */
uint16_t srcipaddr[2]; /* 32-bit Source IP address */
uint16_t destipaddr[2]; /* 32-bit Destination IP address */
#endif /* CONFIG_NET_IPv6 */
/* UDP header */
uint16 srcport;
uint16 destport;
uint16 udplen;
uint16 udpchksum;
uint16_t srcport;
uint16_t destport;
uint16_t udplen;
uint16_t udpchksum;
};
/* The structure holding the UDP statistics that are gathered if
@@ -133,10 +134,10 @@ struct uip_udpip_hdr
#ifdef CONFIG_NET_STATISTICS
struct uip_udp_stats_s
{
uip_stats_t drop; /* Number of dropped UDP segments */
uip_stats_t recv; /* Number of recived UDP segments */
uip_stats_t sent; /* Number of sent UDP segments */
uip_stats_t chkerr; /* Number of UDP segments with a bad checksum */
uip_stats_t drop; /* Number of dropped UDP segments */
uip_stats_t recv; /* Number of recived UDP segments */
uip_stats_t sent; /* Number of sent UDP segments */
uip_stats_t chkerr; /* Number of UDP segments with a bad checksum */
};
#endif
+7 -6
View File
@@ -50,14 +50,15 @@
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <queue.h>
#include <arpa/inet.h>
#include <net/uip/uipopt.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* The following flags may be set in the set of flags before calling the
@@ -350,9 +351,9 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len);
/* Convert an IPv4 address of the form uint16_t[2] to an in_addr_t */
#ifdef CONFIG_ENDIAN_BIG
# define uip_ip4addr_conv(addr) (((in_addr_t)((uint16_t*)addr)[0] << 16) | (in_addr_t)((uint16*)addr)[1])
# define uip_ip4addr_conv(addr) (((in_addr_t)((uint16_t*)addr)[0] << 16) | (in_addr_t)((uint16_t*)addr)[1])
#else
# define uip_ip4addr_conv(addr) (((in_addr_t)((uint16*)addr)[1] << 16) | (in_addr_t)((uint16_t*)addr)[0])
# define uip_ip4addr_conv(addr) (((in_addr_t)((uint16_t*)addr)[1] << 16) | (in_addr_t)((uint16_t*)addr)[0])
#endif
/* Construct an IPv6 address from eight 16-bit words.
@@ -452,8 +453,8 @@ extern void uip_send(struct uip_driver_s *dev, const void *buf, int len);
(((in_addr_t)(addr1) & (in_addr_t)(mask)) == \
((in_addr_t)(addr2) & (in_addr_t)(mask)))
#else
extern boolean uip_ipaddr_maskcmp(uip_addr_t addr1, uip_addr_t addr2,
uip_addr_t mask);
extern bool uip_ipaddr_maskcmp(uip_addr_t addr1, uip_addr_t addr2,
uip_addr_t mask);
#endif
/* Mask out the network part of an IP address.
+1 -1
View File
@@ -52,7 +52,7 @@
#include <sys/types.h>
/****************************************************************************
* Pre-processor definitions
* Pre-processor Definitions
****************************************************************************/
#ifndef CONFIG_WEBCLIENT_MAXHTTPLINE
+14 -13
View File
@@ -41,11 +41,12 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <nuttx/ioctl.h>
/****************************************************************************
* Public Definitions
* Pre-processor Definitions
****************************************************************************/
/* Three ioctls are available on all PF_INET sockets, but only if the NuttX
@@ -59,12 +60,12 @@
/* Values for the FLAGS field in struct arpreq */
#define ATF_COM 0x01 /* Lookup complete */
#define ATF_PERM 0x02 /* Permanent entry */
#define ATF_PUBL 0x04 /* Publish entry */
#define ATF_USETRAILERS 0x10 /* Trailers requested */
#define ATF_NETMASK 0x20 /* Use a netmask */
#define ATF_DONTPUB 0x40 /* Don't answer */
#define ATF_COM 0x01 /* Lookup complete */
#define ATF_PERM 0x02 /* Permanent entry */
#define ATF_PUBL 0x04 /* Publish entry */
#define ATF_USETRAILERS 0x10 /* Trailers requested */
#define ATF_NETMASK 0x20 /* Use a netmask */
#define ATF_DONTPUB 0x40 /* Don't answer */
/****************************************************************************
* Public Type Definitions
@@ -74,11 +75,11 @@
struct arpreq
{
struct sockaddr arp_pa; /* Protocol address */
struct sockaddr arp_ha; /* Hardware address */
struct sockaddr arp_netmask; /* Netmask of protocol address */
ubyte arp_flags; /* Flags */
ubyte arp_dev[IFNAMSIZ+1]; /* Device name (zero terminated)*/
struct sockaddr arp_pa; /* Protocol address */
struct sockaddr arp_ha; /* Hardware address */
struct sockaddr arp_netmask; /* Netmask of protocol address */
uint8_t arp_flags; /* Flags */
uint8_t arp_dev[IFNAMSIZ+1]; /* Device name (zero terminated)*/
};
/****************************************************************************
+2 -2
View File
@@ -41,11 +41,11 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <net/ethernet.h>
/****************************************************************************
* Public Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
+5 -2
View File
@@ -40,10 +40,13 @@
* Included Files
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
/****************************************************************************
* Public Macro Definitions
* Pre-processor Definitions
****************************************************************************/
/* Values for protocol argument to socket() */
@@ -79,7 +82,7 @@
/* IPv4 Internet address */
typedef uint32 in_addr_t;
typedef uint32_t in_addr_t;
struct in_addr
{
in_addr_t s_addr; /* Address (network byte order) */
+6 -3
View File
@@ -41,7 +41,10 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <sched.h>
#include <arch/arch.h>
@@ -284,7 +287,7 @@ EXTERN void up_release_pending(void);
*
****************************************************************************/
EXTERN void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority);
EXTERN void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority);
/****************************************************************************
* Name: _exit
@@ -383,12 +386,12 @@ EXTERN void up_allocate_heap(FAR void **heap_start, size_t *heap_size);
* Name: up_interrupt_context
*
* Description:
* Return TRUE is we are currently executing in
* Return true is we are currently executing in
* the interrupt handler context.
*
****************************************************************************/
EXTERN boolean up_interrupt_context(void);
EXTERN bool up_interrupt_context(void);
/****************************************************************************
* Name: up_enable_irq
+21 -18
View File
@@ -1,7 +1,7 @@
/************************************************************************************
* include/nuttx/can.h
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,16 +41,19 @@
************************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <semaphore.h>
#include <nuttx/fs.h>
/************************************************************************************
* Definitions
* Pre-processor Definitions
************************************************************************************/
/* Default configuration settings that may be overridden in the board configuration.
* file. The configured size is limited to 255 to fit into a ubyte.
* file. The configured size is limited to 255 to fit into a uint8_t.
*/
#if !defined(CONFIG_CAN_FIFOSIZE)
@@ -82,7 +85,7 @@
/* CAN message support */
#define CAN_MAXDATALEN 8
#define CAN_ID(hdr) ((uint16)(hdr) >> 5)
#define CAN_ID(hdr) ((uint16_t)(hdr) >> 5)
#define CAN_RTR(hdr) (((hdr) & 0x0010) != 0)
#define CAN_DLC(hdr) ((hdr) & 0x0f)
#define CAN_MSGLEN(hdr) (sizeof(struct can_msg_s) - (CAN_MAXDATALEN - CAN_DLC(hdr)))
@@ -122,8 +125,8 @@
struct can_msg_s
{
uint16 cm_hdr; /* The 16-bit CAN header */
ubyte cm_data[CAN_MAXDATALEN]; /* CAN message data (0-8 byte) */
uint16_t cm_hdr; /* The 16-bit CAN header */
uint8_t cm_data[CAN_MAXDATALEN]; /* CAN message data (0-8 byte) */
};
/* This structure defines a CAN message FIFO. */
@@ -131,8 +134,8 @@ struct can_msg_s
struct can_fifo_s
{
sem_t cf_sem; /* Counting semaphore */
ubyte cf_head; /* Index to the head [IN] index in the circular buffer */
ubyte cf_tail; /* Index to the tail [OUT] index in the circular buffer */
uint8_t cf_head; /* Index to the head [IN] index in the circular buffer */
uint8_t cf_tail; /* Index to the tail [OUT] index in the circular buffer */
/* Circular buffer of CAN messages */
struct can_msg_s cf_buffer[CONFIG_CAN_FIFOSIZE];
};
@@ -142,7 +145,7 @@ struct can_fifo_s
struct can_rtrwait_s
{
sem_t cr_sem; /* Wait for RTR response */
uint16 cr_id; /* The ID that is waited for */
uint16_t cr_id; /* The ID that is waited for */
FAR struct can_msg_s *cr_msg; /* This is where the RTR reponse goes */
};
@@ -176,11 +179,11 @@ struct can_ops_s
/* Call to enable or disable RX interrupts */
CODE void (*co_rxint)(FAR struct can_dev_s *dev, boolean enable);
CODE void (*co_rxint)(FAR struct can_dev_s *dev, bool enable);
/* Call to enable or disable TX interrupts */
CODE void (*co_txint)(FAR struct can_dev_s *dev, boolean enable);
CODE void (*co_txint)(FAR struct can_dev_s *dev, bool enable);
/* All ioctl calls will be routed through this method */
@@ -188,19 +191,19 @@ struct can_ops_s
/* Send a remote request */
CODE int (*co_remoterequest)(FAR struct can_dev_s *dev, uint16 id);
CODE int (*co_remoterequest)(FAR struct can_dev_s *dev, uint16_t id);
/* This method will send one message on the CAN */
CODE int (*co_send)(FAR struct can_dev_s *dev, FAR struct can_msg_s *msg);
/* Return TRUE if all message have been sent. If for example, the CAN
/* Return true if all message have been sent. If for example, the CAN
* hardware implements FIFOs, then this would mean the transmit FIFO is
* empty. This method is called when the driver needs to make sure that
* all characters are "drained" from the TX hardware before calling co_shutdown().
*/
CODE boolean (*co_txempty)(FAR struct can_dev_s *dev);
CODE bool (*co_txempty)(FAR struct can_dev_s *dev);
};
/* This is the device structure used by the driver. The caller of
@@ -214,8 +217,8 @@ struct can_ops_s
struct can_dev_s
{
ubyte cd_ocount; /* The number of times the device has been opened */
ubyte cd_npendrtr; /* Number of pending RTR messages */
uint8_t cd_ocount; /* The number of times the device has been opened */
uint8_t cd_npendrtr; /* Number of pending RTR messages */
sem_t cd_closesem; /* Locks out new opens while close is in progress */
sem_t cd_recvsem; /* Used to wakeup user waiting for space in cd_recv.buffer */
struct can_fifo_s cd_xmit; /* Describes transmit FIFO */
@@ -230,7 +233,7 @@ struct can_dev_s
struct canioctl_rtr_s
{
uint16 ci_id; /* The 11-bit ID to use in the RTR message */
uint16_t ci_id; /* The 11-bit ID to use in the RTR message */
FAR struct can_msg_s *ci_msg; /* The location to return the RTR response */
};
@@ -276,7 +279,7 @@ EXTERN int can_register(FAR const char *path, FAR struct can_dev_s *dev);
*
************************************************************************************/
EXTERN int can_receive(FAR struct can_dev_s *dev, uint16 hdr, FAR ubyte *data);
EXTERN int can_receive(FAR struct can_dev_s *dev, uint16_t hdr, FAR uint8_t *data);
/************************************************************************************
* Name: can_txdone
+4 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/clock.h
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,9 +41,10 @@
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
/****************************************************************************
* Definitions
* Pro-processor Definitions
****************************************************************************/
/* Timing constants */
@@ -103,7 +104,7 @@
/* Access to raw system clock ***********************************************/
#ifndef CONFIG_DISABLE_CLOCK
extern volatile uint32 g_system_timer;
extern volatile uint32_t g_system_timer;
#endif
/****************************************************************************
+22 -21
View File
@@ -40,7 +40,8 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <wdog.h>
/****************************************************************************
@@ -52,21 +53,21 @@
#ifdef CONFIG_C89x0_STATISTICS
struct cs89x0_statistics_s
{
uint32 tx_packets;
uint32 tx_errors;
uint32 tx_carriererrors;
uint32 tx_heartbeaterrors;
uint32 tx_windowerrors;
uint32 tx_abortederrors;
uint32 rx_missederrors;
uint32 rx_packets;
uint32 rx_errors;
uint32 rx_lengtherrors;
uint32 rx_crcerrors;
uint32 rx_frameerrors;
uint32 rx_dropped;
uint32 rx_missederrors;
uint32 collisions;
uint32_t tx_packets;
uint32_t tx_errors;
uint32_t tx_carriererrors;
uint32_t tx_heartbeaterrors;
uint32_t tx_windowerrors;
uint32_t tx_abortederrors;
uint32_t rx_missederrors;
uint32_t rx_packets;
uint32_t rx_errors;
uint32_t rx_lengtherrors;
uint32_t rx_crcerrors;
uint32_t rx_frameerrors;
uint32_t rx_dropped;
uint32_t rx_missederrors;
uint32_t collisions;
};
#endif
@@ -91,20 +92,20 @@ struct cs89x0_driver_s
#ifdef CONFIG_CS89x0_MEMMODE
FAR void *cs_ppbase; /* CS89x0 page packet base address */
#endif
ubyte cs_irq; /* CS89x00 IRQ number */
uint8_t cs_irq; /* CS89x00 IRQ number */
/* Driver internal state fields. These must be zeroed by before the
* instance of this structure is passed to cs89x0_initialize
*/
#ifdef CONFIG_CS89x0_XMITEARLY
ubyte txstart; /* Bits 6-7 of TxCMD controls Tx race */
uint8_t txstart; /* Bits 6-7 of TxCMD controls Tx race */
#endif
boolean cs_memmode; /* TRUE:memory mode FALSE: I/O mode */
boolean cs_bifup; /* TRUE:ifup FALSE:ifdown */
bool cs_memmode; /* true:memory mode false: I/O mode */
bool cs_bifup; /* true:ifup false:ifdown */
WDOG_ID cs_txpoll; /* TX poll timer */
WDOG_ID cs_txtimeout; /* TX timeout timer */
#ifdef CONFIG_CS89x0_XMITEARLY
uint32 cs_txunderrun; /* Count of Tx underrun errors */
uint32_t cs_txunderrun; /* Count of Tx underrun errors */
#endif
/* This holds the information visible to uIP/NuttX */
+4 -4
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/fat.h
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -40,10 +40,10 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <stdint.h>
/****************************************************************************
* Type Definitions
* Pre-processor Definitions
****************************************************************************/
/* File attribute bits in FAT directory entry */
@@ -62,7 +62,7 @@
* Type Definitions
****************************************************************************/
typedef ubyte fat_attrib_t;
typedef uint8_t fat_attrib_t;
/****************************************************************************
* Public Function Prototypes
+3 -3
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/fb.h
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -104,7 +104,7 @@
/* Packed YUV Formats *******************************************************/
#define FB_FMT_AYUV 19 /* BPP=32 Combined YUV and alpha */
#define FB_FMT_CLJR 20 /* BPP=8 4 pixels packed into a uint32.
#define FB_FMT_CLJR 20 /* BPP=8 4 pixels packed into a uint32_t.
* YUV 4:1:1 with l< 8 bits per YUV sample */
#define FB_FMT_CYUV 21 /* BPP=16 UYVY except that height is reversed */
#define FB_FMT_IRAW 22 /* BPP=? Intel uncompressed YUV.
@@ -196,7 +196,7 @@ struct fb_videoinfo_s
struct fb_planeinfo_s
{
FAR void *fbmem; /* Start of frame buffer memory */
uint32 fblen; /* Length of frame buffer memory in bytes */
uint32_t fblen; /* Length of frame buffer memory in bytes */
fb_coord_t stride; /* Length of a line in bytes */
uint8_t bpp; /* Bits per pixel */
};
+21 -17
View File
@@ -40,10 +40,14 @@
* Included Files
****************************************************************************/
#include <sys/types.h>
#include <semaphore.h>
#include <nuttx/config.h>
#include <nuttx/compiler.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <semaphore.h>
/****************************************************************************
* Definitions
****************************************************************************/
@@ -76,7 +80,7 @@ struct file_operations
off_t (*seek)(FAR struct file *filp, off_t offset, int whence);
int (*ioctl)(FAR struct file *filp, int cmd, unsigned long arg);
#ifndef CONFIG_DISABLE_POLL
int (*poll)(FAR struct file *filp, struct pollfd *fds, boolean setup);
int (*poll)(FAR struct file *filp, struct pollfd *fds, bool setup);
#endif
/* The two structures need not be common after this point */
@@ -87,11 +91,11 @@ struct file_operations
#ifndef CONFIG_DISABLE_MOUNTPOUNT
struct geometry
{
boolean geo_available; /* TRUE: The device is vailable */
boolean geo_mediachanged; /* TRUE: The media has changed since last query */
boolean geo_writeenabled; /* TRUE: It is okay to write to this device */
size_t geo_nsectors; /* Number of sectors on the device */
size_t geo_sectorsize; /* Size of one sector */
bool geo_available; /* true: The device is vailable */
bool geo_mediachanged; /* true: The media has changed since last query */
bool geo_writeenabled; /* true: It is okay to write to this device */
size_t geo_nsectors; /* Number of sectors on the device */
size_t geo_sectorsize; /* Size of one sector */
};
/* This structure is provided by block devices when they register with the
@@ -201,8 +205,8 @@ struct inode
{
FAR struct inode *i_peer; /* Pointer to same level inode */
FAR struct inode *i_child; /* Pointer to lower level inode */
sint16 i_crefs; /* References to inode */
uint16 i_flags; /* Flags for inode */
int16_t i_crefs; /* References to inode */
uint16_t i_flags; /* Flags for inode */
union inode_ops_u u; /* Inode operations */
#ifdef CONFIG_FILE_MODE
mode_t i_mode; /* Access mode flags */
@@ -230,8 +234,8 @@ struct file
#if CONFIG_NFILE_DESCRIPTORS > 0
struct filelist
{
sem_t fl_sem; /* Manage access to the file list */
sint16 fl_crefs; /* Reference count */
sem_t fl_sem; /* Manage access to the file list */
int16_t fl_crefs; /* Reference count */
struct file fl_files[CONFIG_NFILE_DESCRIPTORS];
};
#endif
@@ -268,7 +272,7 @@ struct file_struct
int fs_filedes; /* File descriptor associated with stream */
mode_t fs_oflags; /* Open mode flags */
#if CONFIG_NUNGET_CHARS > 0
uint8 fs_nungotten; /* The number of characters buffered for ungetc */
uint8_t fs_nungotten; /* The number of characters buffered for ungetc */
unsigned char fs_ungotten[CONFIG_NUNGET_CHARS];
#endif
#if CONFIG_STDIO_BUFFER_SIZE > 0
@@ -402,8 +406,8 @@ EXTERN void devzero_register(void);
* as a block device.
*/
EXTERN int losetup(const char *devname, const char *filename, uint16 sectsize,
off_t offset, boolean readonly);
EXTERN int losetup(const char *devname, const char *filename, uint16_t sectsize,
off_t offset, bool readonly);
EXTERN int loteardown(const char *devname);
/* Setup so that the block driver referenced by 'blkdev' can be accessed
@@ -412,14 +416,14 @@ EXTERN int loteardown(const char *devname);
* Access via a character device:
*/
EXTERN int bchdev_register(const char *blkdev, const char *chardev, boolean readonly);
EXTERN int bchdev_register(const char *blkdev, const char *chardev, bool readonly);
EXTERN int bchdev_unregister(const char *chardev);
/* Low level, direct access. NOTE: low-level access and character driver access
* are incompatible. One and only one access method should be implemented.
*/
EXTERN int bchlib_setup(const char *blkdev, boolean readonly, FAR void **handle);
EXTERN int bchlib_setup(const char *blkdev, bool readonly, FAR void **handle);
EXTERN int bchlib_teardown(FAR void *handle);
EXTERN ssize_t bchlib_read(FAR void *handle, FAR char *buffer, size_t offset, size_t len);
EXTERN ssize_t bchlib_write(FAR void *handle, FAR const char *buffer, size_t offset, size_t len);
+6 -5
View File
@@ -41,10 +41,11 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
/* I2C address calculation. Convert 7- and 10-bit address to 8-bit and
@@ -160,10 +161,10 @@
struct i2c_dev_s;
struct i2c_ops_s
{
uint32 (*setfrequency)(FAR struct i2c_dev_s *dev, uint32 frequency);
uint32_t (*setfrequency)(FAR struct i2c_dev_s *dev, uint32_t frequency);
int (*setaddress)(FAR struct i2c_dev_s *dev, int addr, int nbits);
int (*write)(FAR struct i2c_dev_s *dev, const ubyte *buffer, int buflen);
int (*read)(FAR struct i2c_dev_s *dev, ubyte *buffer, int buflen);
int (*write)(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen);
int (*read)(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen);
};
/* I2C private data. This structure only defines the initial fields of the
+1 -2
View File
@@ -41,13 +41,12 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
/****************************************************************************
* Pre-Processor Definitions
****************************************************************************/
/* Each NuttX ioctl commands are uint16's consisting of an 8-bit type
/* Each NuttX ioctl commands are uint16_t's consisting of an 8-bit type
* identifier and an 8-bit command number. All comman type identifiers are
* defined below:
*/
+2 -4
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/irq.h
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
****************************************************************************/
#ifndef __ASSEMBLY__
# include <sys/types.h>
# include <assert.h>
#endif
@@ -61,8 +60,7 @@
#ifndef __ASSEMBLY__
typedef int (*xcpt_t)(int irq, FAR void *context);
typedef int (*swint_t)(int code, int parm2, int parm3,
FAR void *context);
typedef int (*swint_t)(int code, int parm2, int parm3, FAR void *context);
#endif
/* Now include architecture-specific types */
-1
View File
@@ -41,7 +41,6 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
/****************************************************************************
* Pre-Processor Definitions
+13 -13
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/mkfat.h
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,10 +41,10 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
/****************************************************************************
* Definitions
* Pre-processor Definitions
****************************************************************************/
#define MKFATFS_DEFAULT_NFATS 2 /* 2: Default number of FATs */
@@ -82,16 +82,16 @@
struct fat_format_s
{
ubyte ff_nfats; /* Number of FATs */
ubyte ff_fattype; /* FAT size: 0 (autoselect), 12, 16, or 32 */
ubyte ff_clustshift; /* Log2 of sectors per cluster: 0-5, 0xff (autoselect) */
ubyte ff_volumelabel[11]; /* Volume label */
uint16 ff_backupboot; /* Sector number of the backup boot sector (0=use default)*/
uint16 ff_rootdirentries; /* Number of root directory entries */
uint16 ff_rsvdseccount; /* Reserved sectors */
uint32 ff_hidsec; /* Count of hidden sectors preceding fat */
uint32 ff_volumeid; /* FAT volume id */
uint32 ff_nsectors; /* Number of sectors from device to use: 0: Use all */
uint8_t ff_nfats; /* Number of FATs */
uint8_t ff_fattype; /* FAT size: 0 (autoselect), 12, 16, or 32 */
uint8_t ff_clustshift; /* Log2 of sectors per cluster: 0-5, 0xff (autoselect) */
uint8_t ff_volumelabel[11]; /* Volume label */
uint16_t ff_backupboot; /* Sector number of the backup boot sector (0=use default)*/
uint16_t ff_rootdirentries; /* Number of root directory entries */
uint16_t ff_rsvdseccount; /* Reserved sectors */
uint32_t ff_hidsec; /* Count of hidden sectors preceding fat */
uint32_t ff_volumeid; /* FAT volume id */
uint32_t ff_nsectors; /* Number of sectors from device to use: 0: Use all */
};
/****************************************************************************
+2 -1
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/mm.h
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,6 +41,7 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
/****************************************************************************
* Pre-Processor Definitions
-1
View File
@@ -41,7 +41,6 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
/****************************************************************************
* Pre-Processor Definitions
+8 -6
View File
@@ -42,7 +42,9 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
/****************************************************************************
* Pre-Processor Definitions
@@ -68,8 +70,8 @@
struct mtd_geometry_s
{
uint16 blocksize; /* Size of one read/write block */
uint16 erasesize; /* Size of one erase blocks -- must be a multiple
uint16_t blocksize; /* Size of one read/write block */
uint16_t erasesize; /* Size of one erase blocks -- must be a multiple
* of blocksize. */
size_t neraseblocks; /* Number of erase blocks */
};
@@ -90,9 +92,9 @@ struct mtd_dev_s
/* Read/write from the specified read/write blocks */
ssize_t (*bread)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks,
FAR ubyte *buffer);
FAR uint8_t *buffer);
ssize_t (*bwrite)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks,
FAR const ubyte *buffer);
FAR const uint8_t *buffer);
/* Some devices may support byte oriented reads (optional). Most MTD devices
* are inherently block oriented so byte-oriented writing is not supported. It
@@ -101,7 +103,7 @@ struct mtd_dev_s
*/
ssize_t (*read)(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes,
FAR ubyte *buffer);
FAR uint8_t *buffer);
/* Support other, less frequently used commands:
* - MTDIOC_GEOMETRY: Get MTD geometry
@@ -138,7 +140,7 @@ extern "C" {
*
****************************************************************************/
EXTERN int ftl_initialize(int minor, ubyte *buffer, FAR struct mtd_dev_s *mtd);
EXTERN int ftl_initialize(int minor, uint8_t *buffer, FAR struct mtd_dev_s *mtd);
/************************************************************************************
* Name: m25p_initialize
+4 -3
View File
@@ -44,6 +44,7 @@
#ifdef CONFIG_NET
#include <stdint.h>
#include <stdbool.h>
#include <stdarg.h>
#include <semaphore.h>
@@ -104,8 +105,8 @@ struct socket
#if CONFIG_NSOCKET_DESCRIPTORS > 0
struct socketlist
{
sem_t sl_sem; /* Manage access to the socket list */
sint16 sl_crefs; /* Reference count */
sem_t sl_sem; /* Manage access to the socket list */
int16_t sl_crefs; /* Reference count */
struct socket sl_sockets[CONFIG_NSOCKET_DESCRIPTORS];
};
#endif
@@ -162,7 +163,7 @@ EXTERN int netdev_ioctl(int sockfd, int cmd, struct ifreq *req);
#ifndef CONFIG_DISABLE_POLL
struct pollfd; /* Forward reference -- see poll.h */
EXTERN int net_poll(int sockfd, struct pollfd *fds, boolean setup);
EXTERN int net_poll(int sockfd, struct pollfd *fds, bool setup);
#endif
/* net_dup.c *****************************************************************/
+10 -8
View File
@@ -41,7 +41,9 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
#include <nuttx/fb.h>
#include <nuttx/nxglib.h>
@@ -100,7 +102,7 @@ struct nx_callback_s
* hwnd - Window handle
* rect - The rectangle that needs to be re-drawn (in window relative
* coordinates)
* more - TRUE: More re-draw requests will follow
* more - true: More re-draw requests will follow
* arg - User provided argument (see nx_openwindow, nx_constructwindow)
*
* Returned Value:
@@ -109,7 +111,7 @@ struct nx_callback_s
**************************************************************************/
void (*redraw)(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
boolean more, FAR void *arg);
bool more, FAR void *arg);
/**************************************************************************
* Name: position
@@ -156,7 +158,7 @@ struct nx_callback_s
#ifdef CONFIG_NX_MOUSE
void (*mousein)(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
ubyte buttons, FAR void *arg);
uint8_t buttons, FAR void *arg);
#endif
/**************************************************************************
@@ -177,7 +179,7 @@ struct nx_callback_s
**************************************************************************/
#ifdef CONFIG_NX_KBD
void (*kbdin)(NXWINDOW hwnd, ubyte nch, FAR const ubyte *ch, FAR void *arg);
void (*kbdin)(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch, FAR void *arg);
#endif
};
@@ -685,8 +687,8 @@ EXTERN int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest,
****************************************************************************/
#ifdef CONFIG_NX_KBD
EXTERN int nx_kbdchin(NXHANDLE handle, ubyte ch);
EXTERN int nx_kbdin(NXHANDLE handle, ubyte nch, FAR const ubyte *ch);
EXTERN int nx_kbdchin(NXHANDLE handle, uint8_t ch);
EXTERN int nx_kbdin(NXHANDLE handle, uint8_t nch, FAR const uint8_t *ch);
#endif
/****************************************************************************
@@ -700,7 +702,7 @@ EXTERN int nx_kbdin(NXHANDLE handle, ubyte nch, FAR const ubyte *ch);
****************************************************************************/
#ifdef CONFIG_NX_MOUSE
EXTERN int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, ubyte buttons);
EXTERN int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, uint8_t buttons);
#endif
#undef EXTERN
+12 -10
View File
@@ -41,6 +41,8 @@
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <nxflat.h>
#include <nuttx/sched.h>
@@ -63,9 +65,9 @@ struct nxflat_loadinfo_s
* text section instance in the system for each module.
*/
uint32 ispace; /* Address where hdr/text is loaded */
uint32 entryoffs; /* Offset from ispace to entry point */
uint32 isize; /* Size of ispace. */
uint32_t ispace; /* Address where hdr/text is loaded */
uint32_t entryoffs; /* Offset from ispace to entry point */
uint32_t isize; /* Size of ispace. */
/* Data Space (DSpace): This region contains all information that in referenced
* as data (other than the stack which is separately allocated). There will be
@@ -73,15 +75,15 @@ struct nxflat_loadinfo_s
*/
struct dspace_s *dspace; /* Allocated D-Space (data/bss/etc) */
uint32 datasize; /* Size of data segment in dspace */
uint32 bsssize; /* Size of bss segment in dspace */
uint32 stacksize; /* Size of stack (not allocated) */
uint32 dsize; /* Size of dspace (may be large than parts) */
uint32_t datasize; /* Size of data segment in dspace */
uint32_t bsssize; /* Size of bss segment in dspace */
uint32_t stacksize; /* Size of stack (not allocated) */
uint32_t dsize; /* Size of dspace (may be large than parts) */
/* This is temporary memory where relocation records will be loaded. */
uint32 relocstart; /* Start of array of struct flat_reloc */
uint16 reloccount; /* Number of elements in reloc array */
uint32_t relocstart; /* Start of array of struct flat_reloc */
uint16_t reloccount; /* Number of elements in reloc array */
/* File descriptors */
@@ -137,7 +139,7 @@ EXTERN int nxflat_verifyheader(const struct nxflat_hdr_s *header);
***********************************************************************/
EXTERN int nxflat_init(const char *filename,
struct nxflat_loadinfo_s *loadinfo);
struct nxflat_loadinfo_s *loadinfo);
/***********************************************************************
* Name: nxflat_uninit
+29 -28
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/nxfonts.h
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,8 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <nuttx/nxglib.h>
/****************************************************************************
@@ -56,12 +57,12 @@
struct nx_fontmetic_s
{
uint32 stride : 2; /* Width of one font row in bytes */
uint32 width : 6; /* Width of the font in bits */
uint32 height : 6; /* Height of the font in rows */
uint32 xoffset : 6; /* Top, left-hand corner X-offset in pixels */
uint32 yoffset : 6; /* Top, left-hand corner y-offset in pixels */
uint32 unused : 6;
uint32_t stride : 2; /* Width of one font row in bytes */
uint32_t width : 6; /* Width of the font in bits */
uint32_t height : 6; /* Height of the font in rows */
uint32_t xoffset : 6; /* Top, left-hand corner X-offset in pixels */
uint32_t yoffset : 6; /* Top, left-hand corner y-offset in pixels */
uint32_t unused : 6;
};
/* This structure binds the glyph metrics to the glyph bitmap */
@@ -69,7 +70,7 @@ struct nx_fontmetic_s
struct nx_fontbitmap_s
{
struct nx_fontmetic_s metric; /* Character metrics */
FAR const ubyte *bitmap; /* Pointer to the character bitmap */
FAR const uint8_t *bitmap; /* Pointer to the character bitmap */
};
/* This structure describes one contiguous grouping of glyphs that
@@ -79,8 +80,8 @@ struct nx_fontbitmap_s
struct nx_fontset_s
{
ubyte first; /* First bitmap character code */
ubyte nchars; /* Number of bitmap character codes */
uint8_t first; /* First bitmap character code */
uint8_t nchars; /* Number of bitmap character codes */
FAR const struct nx_fontbitmap_s *bitmap;
};
@@ -88,10 +89,10 @@ struct nx_fontset_s
struct nx_font_s
{
ubyte mxheight; /* Max height of one glyph in rows */
ubyte mxwidth; /* Max width of any glyph in pixels */
ubyte mxbits; /* Max number of bits per character code */
ubyte spwidth; /* The width of a space in pixels */
uint8_t mxheight; /* Max height of one glyph in rows */
uint8_t mxwidth; /* Max width of any glyph in pixels */
uint8_t mxbits; /* Max number of bits per character code */
uint8_t spwidth; /* The width of a space in pixels */
};
/****************************************************************************
@@ -137,7 +138,7 @@ EXTERN FAR const struct nx_font_s *nxf_getfontset(void);
*
****************************************************************************/
EXTERN FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16 ch);
EXTERN FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16_t ch);
/****************************************************************************
* Name: nxf_convert_*bpp
@@ -160,28 +161,28 @@ EXTERN FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16 ch);
*
****************************************************************************/
EXTERN int nxf_convert_2bpp(FAR ubyte *dest, uint16 height,
uint16 width, uint16 stride,
EXTERN int nxf_convert_2bpp(FAR uint8_t *dest, uint16_t height,
uint16_t width, uint16_t stride,
FAR const struct nx_fontbitmap_s *bm,
nxgl_mxpixel_t color);
EXTERN int nxf_convert_4bpp(FAR ubyte *dest, uint16 height,
uint16 width, uint16 stride,
EXTERN int nxf_convert_4bpp(FAR uint8_t *dest, uint16_t height,
uint16_t width, uint16_t stride,
FAR const struct nx_fontbitmap_s *bm,
nxgl_mxpixel_t color);
EXTERN int nxf_convert_8bpp(FAR ubyte *dest, uint16 height,
uint16 width, uint16 stride,
EXTERN int nxf_convert_8bpp(FAR uint8_t *dest, uint16_t height,
uint16_t width, uint16_t stride,
FAR const struct nx_fontbitmap_s *bm,
nxgl_mxpixel_t color);
EXTERN int nxf_convert_16bpp(FAR uint16 *dest, uint16 height,
uint16 width, uint16 stride,
EXTERN int nxf_convert_16bpp(FAR uint16_t *dest, uint16_t height,
uint16_t width, uint16_t stride,
FAR const struct nx_fontbitmap_s *bm,
nxgl_mxpixel_t color);
EXTERN int nxf_convert_24bpp(FAR uint32 *dest, uint16 height,
uint16 width, uint16 stride,
EXTERN int nxf_convert_24bpp(FAR uint32_t *dest, uint16_t height,
uint16_t width, uint16_t stride,
FAR const struct nx_fontbitmap_s *bm,
nxgl_mxpixel_t color);
EXTERN int nxf_convert_32bpp(FAR uint32 *dest, uint16 height,
uint16 width, uint16 stride,
EXTERN int nxf_convert_32bpp(FAR uint32_t *dest, uint16_t height,
uint16_t width, uint16_t stride,
FAR const struct nx_fontbitmap_s *bm,
nxgl_mxpixel_t color);
+15 -11
View File
@@ -41,7 +41,9 @@
****************************************************************************/
#include <nuttx/config.h>
#include <stdint.h>
#include <stdbool.h>
#include <fixedmath.h>
#include <nuttx/fb.h>
@@ -97,7 +99,7 @@ typedef uint8_t nxgl_mxpixel_t;
* to change:
*/
typedef sint16 nxgl_coord_t;
typedef int16_t nxgl_coord_t;
/* Describes a point on the display */
@@ -171,7 +173,8 @@ extern "C" {
*
****************************************************************************/
EXTERN void nxgl_rgb2yuv(ubyte r, ubyte g, ubyte b, ubyte *y, ubyte *u, ubyte *v);
EXTERN void nxgl_rgb2yuv(uint8_t r, uint8_t g, uint8_t b,
uint8_t *y, uint8_t *u, uint8_t *v);
/****************************************************************************
* Name: nxgl_yuv2rgb
@@ -181,7 +184,8 @@ EXTERN void nxgl_rgb2yuv(ubyte r, ubyte g, ubyte b, ubyte *y, ubyte *u, ubyte *v
*
****************************************************************************/
EXTERN void nxgl_yuv2rgb(ubyte y, ubyte u, ubyte v, ubyte *r, ubyte *g, ubyte *b);
EXTERN void nxgl_yuv2rgb(uint8_t y, uint8_t u, uint8_t v,
uint8_t *r, uint8_t *g, uint8_t *b);
/* Rasterizers **************************************************************/
@@ -421,23 +425,23 @@ EXTERN void nxgl_nonintersecting(FAR struct nxgl_rect_s result[4],
* Name: nxgl_rectoverlap
*
* Description:
* Return TRUE if the two rectangles overlap
* Return true if the two rectangles overlap
*
****************************************************************************/
EXTERN boolean nxgl_rectoverlap(FAR struct nxgl_rect_s *rect1,
FAR struct nxgl_rect_s *rect2);
EXTERN bool nxgl_rectoverlap(FAR struct nxgl_rect_s *rect1,
FAR struct nxgl_rect_s *rect2);
/****************************************************************************
* Name: nxgl_rectinside
*
* Description:
* Return TRUE if the point pt lies within rect.
* Return true if the point pt lies within rect.
*
****************************************************************************/
EXTERN boolean nxgl_rectinside(FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *pt);
EXTERN bool nxgl_rectinside(FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *pt);
/****************************************************************************
* Name: nxgl_rectsize
@@ -454,11 +458,11 @@ EXTERN void nxgl_rectsize(FAR struct nxgl_size_s *size,
* Name: nxgl_nullrect
*
* Description:
* Return TRUE if the area of the retangle is <= 0.
* Return true if the area of the retangle is <= 0.
*
****************************************************************************/
EXTERN boolean nxgl_nullrect(FAR const struct nxgl_rect_s *rect);
EXTERN bool nxgl_nullrect(FAR const struct nxgl_rect_s *rect);
/****************************************************************************
* Name: nxgl_runoffset
+1 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/nxtk.h
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008, 2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,7 +41,6 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <nuttx/nx.h>
+10 -9
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* nuttx/ramdisk.h
*
* Copyright (C) 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
@@ -41,13 +41,14 @@
****************************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <stdint.h>
#include <stdbool.h>
/****************************************************************************
* Type Definitions
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Type Definitions
****************************************************************************/
@@ -68,17 +69,17 @@ extern "C" {
* minor: Selects suffix of device named /dev/ramN, N={1,2,3...}
* nsectors: Number of sectors on device
* sectize: The size of one sector
* writeenabled: TRUE: can write to ram disk
* writeenabled: true: can write to ram disk
* buffer: RAM disk backup memory
*/
#ifdef CONFIG_FS_WRITABLE
EXTERN int ramdisk_register(int minor, ubyte *buffer, uint32 nsectors,
uint16 sectize, boolean writeenabled);
EXTERN int ramdisk_register(int minor, uint8_t *buffer, uint32_t nsectors,
uint16_t sectize, bool writeenabled);
#define romdisk_register(m,b,n,s) ramdisk_register(m,b,n,s,0)
#else
EXTERN int romdisk_register(int minor, ubyte *buffer, uint32 nsectors,
uint16 sectize);
EXTERN int romdisk_register(int minor, uint8_t *buffer, uint32_t nsectors,
uint16_t sectize);
#endif
#undef EXTERN
+13 -12
View File
@@ -45,8 +45,9 @@
**********************************************************************/
#include <nuttx/config.h>
#include <sys/types.h>
#include <sys/types.h>
#include <stdint.h>
#include <semaphore.h>
#include <nuttx/wqueue.h>
@@ -65,9 +66,9 @@
* reload the read-ahead buffer, when appropriate.
*/
typedef ssize_t (*rwbreload_t)(FAR void *dev, FAR ubyte *buffer,
typedef ssize_t (*rwbreload_t)(FAR void *dev, FAR uint8_t *buffer,
off_t startblock, size_t nblocks);
typedef ssize_t (*rwbflush_t)(FAR void *dev, FAR const ubyte *buffer,
typedef ssize_t (*rwbflush_t)(FAR void *dev, FAR const uint8_t *buffer,
off_t startblock, size_t nblocks);
/* This structure holds the state of the buffers. In typical usage,
@@ -104,7 +105,7 @@ struct rwbuffer_s
/* Supported geometry */
uint16 blocksize; /* The size of one block */
uint16_t blocksize; /* The size of one block */
size_t nblocks; /* The total number blocks supported */
FAR void *dev; /* Device state passed to callout functions */
@@ -114,7 +115,7 @@ struct rwbuffer_s
*/
#ifdef CONFIG_FS_WRITEBUFFER
uint16 wrmaxblocks; /* The number of blocks to buffer in memory */
uint16_t wrmaxblocks; /* The number of blocks to buffer in memory */
rwbflush_t wrflush; /* Callout to flush the write buffer */
#endif
@@ -124,7 +125,7 @@ struct rwbuffer_s
*/
#ifdef CONFIG_FS_READAHEAD
uint16 rhmaxblocks; /* The number of blocks to buffer in memory */
uint16_t rhmaxblocks; /* The number of blocks to buffer in memory */
rwbreload_t rhreload; /* Callout to reload the read-ahead buffer */
#endif
@@ -136,8 +137,8 @@ struct rwbuffer_s
#ifdef CONFIG_FS_WRITEBUFFER
sem_t wrsem; /* Enforces exclusive access to the write buffer */
struct work_s work; /* Delayed work to flush buffer after adelay with no activity */
ubyte *wrbuffer; /* Allocated write buffer */
uint16 wrnblocks; /* Number of blocks in write buffer */
uint8_t *wrbuffer; /* Allocated write buffer */
uint16_t wrnblocks; /* Number of blocks in write buffer */
off_t wrblockstart; /* First block in write buffer */
off_t wrexpectedblock; /* Next block expected */
#endif
@@ -146,8 +147,8 @@ struct rwbuffer_s
#ifdef CONFIG_FS_READAHEAD
sem_t rhsem; /* Enforces exclusive access to the write buffer */
ubyte *rhbuffer; /* Allocated read-ahead buffer */
uint16 rhnblocks; /* Number of blocks in read-ahead buffer */
uint8_t *rhbuffer; /* Allocated read-ahead buffer */
uint16_t rhnblocks; /* Number of blocks in read-ahead buffer */
off_t rhblockstart; /* First block in read-ahead buffer */
#endif
};
@@ -176,10 +177,10 @@ EXTERN void rwb_uninitialize(FAR struct rwbuffer_s *rwb);
/* Buffer transfers */
EXTERN ssize_t rwb_read(FAR struct rwbuffer_s *rwb, off_t startblock,
size_t blockcount, FAR ubyte *rdbuffer);
size_t blockcount, FAR uint8_t *rdbuffer);
EXTERN ssize_t rwb_write(FAR struct rwbuffer_s *rwb,
off_t startblock, size_t blockcount,
FAR const ubyte *wrbuffer);
FAR const uint8_t *wrbuffer);
EXTERN int rwb_mediaremoved(FAR struct rwbuffer_s *rwb);
#undef EXTERN

Some files were not shown because too many files have changed in this diff Show More