2002-07-18 Theodore A. Roth
* doc/api/doxygen.config.in: Config tweaks.
* doc/api/main_page.dox: New file.
* include/inttypes.h: Updated comments for doxygen.
* include/string.h: Updated comments for doxygen.
* include/avr/signal.h: Updated comments for doxygen.
* libc/string/memccpy.S: Updated comments for doxygen.
* libc/string/memchr.S: Updated comments for doxygen.
* libc/string/memcmp.S: Updated comments for doxygen.
* libc/string/memcpy.S: Updated comments for doxygen.
* libc/string/memmove.S: Updated comments for doxygen.
* libc/string/memset.S: Updated comments for doxygen.
* libc/string/strcasecmp.S: Updated comments for doxygen.
* libc/string/strcat.S: Updated comments for doxygen.
* libc/string/strchr.S: Updated comments for doxygen.
* libc/string/strcmp.S: Updated comments for doxygen.
* libc/string/strcpy.S: Updated comments for doxygen.
* libc/string/strlcat.c: Updated comments for doxygen.
* libc/string/strlcpy.c: Updated comments for doxygen.
* libc/string/strlen.S: Updated comments for doxygen.
* libc/string/strlwr.S: Updated comments for doxygen.
* libc/string/strncasecmp.S: Updated comments for doxygen.
* libc/string/strncat.S: Updated comments for doxygen.
* libc/string/strncmp.S: Updated comments for doxygen.
* libc/string/strncpy.S: Updated comments for doxygen.
* libc/string/strnlen.S: Updated comments for doxygen.
* libc/string/strrchr.S: Updated comments for doxygen.
* libc/string/strrev.S: Updated comments for doxygen.
* libc/string/strstr.S: Updated comments for doxygen.
* libc/string/strupr.S: Updated comments for doxygen.
* libm/fplib/dtostrf.S: Change comment so doxygen isn't confused.
Index: doc/api/doxygen.config.in
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/doc/api/doxygen.config.in,v
retrieving revision 1.1
diff -u -r1.1 doxygen.config.in
--- doc/api/doxygen.config.in 16 Jul 2002 20:11:37 -0000 1.1
+++ doc/api/doxygen.config.in 19 Jul 2002 06:28:56 -0000
@@ -185,7 +185,7 @@
# If set to NO, the detailed description appears after the member
# documentation.
-DETAILS_AT_TOP = NO
+DETAILS_AT_TOP = YES
# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
# member inherits the documentation from any documented member that it
@@ -203,7 +203,7 @@
# alphabetically by member name. If set to NO the members will appear in
# declaration order.
-SORT_MEMBER_DOCS = NO
+SORT_MEMBER_DOCS = YES
# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
# tag is set to YES, then doxygen will reuse the documentation of the first
@@ -215,7 +215,7 @@
# The TAB_SIZE tag can be used to set the number of spaces in a tab.
# Doxygen uses this value to replace tabs by spaces in code fragments.
-TAB_SIZE = 4
+TAB_SIZE = 8
# The GENERATE_TODOLIST tag can be used to enable (YES) or
# disable (NO) the todo list. This list is created by putting \todo
@@ -322,7 +322,7 @@
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = @top_srcdir@/include @top_srcdir@/libc @top_srcdir@/libm
+INPUT = @top_srcdir@/include @top_srcdir@/libc @top_srcdir@/libm @top_srcdir@/doc/api
# If the value of the INPUT tag contains directories, you can use the
# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
@@ -331,7 +331,7 @@
# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp
# *.h++ *.idl *.odl
-FILE_PATTERNS = *.c *.h
+FILE_PATTERNS = *.c *.h *.S *.dox
# The RECURSIVE tag can be used to turn specify whether or not subdirectories
# should be searched for input files as well. Possible values are YES and NO.
@@ -404,7 +404,7 @@
# If the SOURCE_BROWSER tag is set to YES then a list of source files will
# be generated. Documented entities will be cross-referenced with these sources.
-SOURCE_BROWSER = YES
+SOURCE_BROWSER = NO
# Setting the INLINE_SOURCES tag to YES will include the body
# of functions and classes directly in the documentation.
@@ -415,13 +415,13 @@
# then for each documented function all documented
# functions referencing it will be listed.
-REFERENCED_BY_RELATION = YES
+REFERENCED_BY_RELATION = NO
# If the REFERENCES_RELATION tag is set to YES (the default)
# then for each documented function all documented entities
# called/used by that function will be listed.
-REFERENCES_RELATION = YES
+REFERENCES_RELATION = NO
#---------------------------------------------------------------------------
# configuration options related to the alphabetical class index
@@ -520,7 +520,7 @@
# top of each HTML page. The value NO (the default) enables the index and
# the value YES disables it.
-DISABLE_INDEX = NO
+DISABLE_INDEX = YES
# This tag can be used to set the number of enum values (range [1..20])
# that doxygen will group on one line in the generated HTML documentation.
@@ -661,7 +661,7 @@
# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
# generate man pages
-GENERATE_MAN = NO
+GENERATE_MAN = YES
# The MAN_OUTPUT tag is used to specify where the man pages will be put.
# If a relative path is entered the value of OUTPUT_DIRECTORY will be
Index: doc/api/main_page.dox
===================================================================
RCS file: doc/api/main_page.dox
diff -N doc/api/main_page.dox
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ doc/api/main_page.dox 19 Jul 2002 06:28:56 -0000
@@ -0,0 +1,37 @@
+/* Copyright (c) 2002, Theodore Roth
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in
+ the documentation and/or other materials provided with the
+ distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE. */
+
+/* $Id$ */
+
+/** \mainpage AVR Libc
+
+The AVR Libc package provides a subset of the standard C library for Atmel AVR
+8-bit RISC microcontrollers..........
+
+There's a lot of work to be done on this. This file will produce the
+index.html (for html output) or the first chapter (in \f$\mbox{\LaTeX}\f$
+output).
+
+*/
Index: include/inttypes.h
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/include/inttypes.h,v
retrieving revision 1.1
diff -u -r1.1 inttypes.h
--- include/inttypes.h 5 Jul 2002 20:38:44 -0000 1.1
+++ include/inttypes.h 19 Jul 2002 06:28:56 -0000
@@ -33,8 +33,15 @@
#ifndef __INTTYPES_H_
#define __INTTYPES_H_
-/* Use [u]intN_t if you need exactly N bits.
- XXX - doesn't handle the -mint8 option. */
+/** \defgroup avr_inttypes Integer Types
+ \code #include \endcode
+
+ Use [u]intN_t if you need exactly N bits.
+
+ \note These should probably not be used if avr-gcc's \c -mint8 option is
+ used.
+
+ @{ */
typedef signed char int8_t;
typedef unsigned char uint8_t;
@@ -50,5 +57,7 @@
typedef int16_t intptr_t;
typedef uint16_t uintptr_t;
+
+/* @} */
#endif
Index: include/string.h
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/include/string.h,v
retrieving revision 1.1
diff -u -r1.1 string.h
--- include/string.h 5 Jul 2002 20:38:44 -0000 1.1
+++ include/string.h 19 Jul 2002 06:28:57 -0000
@@ -45,6 +45,12 @@
extern "C" {
#endif
+/** \defgroup avr_string Strings
+ \code #include \endcode
+
+ The string functions perform string operations on NULL terminated
+ strings. */
+
extern void *memccpy(void *, const void *, int, size_t);
extern void *memchr(const void *, int, size_t) __ATTR_PURE__;
extern int memcmp(const void *, const void *, size_t) __ATTR_PURE__;
Index: include/avr/signal.h
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/include/avr/signal.h,v
retrieving revision 1.1
diff -u -r1.1 signal.h
--- include/avr/signal.h 5 Jul 2002 20:38:44 -0000 1.1
+++ include/avr/signal.h 19 Jul 2002 06:28:57 -0000
@@ -26,6 +26,15 @@
#ifndef _AVR_SIGNAL_H_
#define _AVR_SIGNAL_H_
+/** \defgroup avr_signals Signals and Interrupts
+ \code #include \endcode
+
+ FIXME: discuss the SIGNAL() and INTERRUPT() macros. Rich Neswold's
+ document has a good discussion of this. */
+
+/** \def SIGNAL(signame)
+ \ingroup avr_signals */
+
#ifdef __cplusplus
#define SIGNAL(signame) \
extern "C" void signame(void); \
@@ -36,6 +45,9 @@
void signame (void) __attribute__ ((signal)); \
void signame (void)
#endif
+
+/** \def INTERRUPT(signame)
+ \ingroup avr_signals */
#ifdef __cplusplus
#define INTERRUPT(signame) \
Index: libc/string/memccpy.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/memccpy.S,v
retrieving revision 1.1
diff -u -r1.1 memccpy.S
--- libc/string/memccpy.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/memccpy.S 19 Jul 2002 06:28:57 -0000
@@ -40,7 +40,15 @@
#define ret_hi r25
#define ret_lo r24
-; void *memccpy(void *dest, const void *src, int val, size_t len)
+/** \ingroup avr_string
+ \fn void *memccpy(void *dest, const void *src, int val, size_t len)
+ \brief Copy memory area.
+
+ The memccpy() function copies no more than n bytes from memory area src to
+ memory area dest, stopping when the character c is found.
+
+ \returns The memccpy() function returns a pointer to the next character in
+ dest after c, or NULL if c was not found in the first n characters of src. */
.text
.global _U(memccpy)
Index: libc/string/memchr.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/memchr.S,v
retrieving revision 1.1
diff -u -r1.1 memchr.S
--- libc/string/memchr.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/memchr.S 19 Jul 2002 06:28:57 -0000
@@ -38,7 +38,21 @@
#define ret_hi r25
#define ret_lo r24
-; void *memchr(const void *src, int val, size_t len)
+/** \ingroup avr_string
+ \fn void *memchr(const void *src, int val, size_t len)
+ \brief Scan memory for a character.
+
+ The memchr() function scans the first n bytes of the memory area pointed
+ to by s for the character c. The first byte to match c (interpreted as an
+ unsigned character) stops the operation.
+
+ The memrchr() function is like the memchr() function, except that it
+ searches backwards from the end of the n bytes pointed to by s instead of
+ forwards from the front.
+
+ \returns The memchr() and memrchr() functions return a pointer to the
+ matching byte or NULL if the character does not occur in the given memory
+ area. */
.text
.global _U(memchr)
Index: libc/string/memcmp.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/memcmp.S,v
retrieving revision 1.1
diff -u -r1.1 memcmp.S
--- libc/string/memcmp.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/memcmp.S 19 Jul 2002 06:28:57 -0000
@@ -38,7 +38,18 @@
#define ret_hi r25
#define ret_lo r24
-; int memcmp(const void *s1, const void *s2, size_t len)
+/** \ingroup avr_string
+ \fn int memcmp(const void *s1, const void *s2, size_t len)
+ \brief Compare memory areas
+
+ The memcmp() function compares the first n bytes of the memory areas s1
+ and s2. It returns an integer less than, equal to, or greater than zero
+ if s1 is found, respectively, to be less than, to match, or be greater
+ than s2.
+
+ \returns The memcmp() function returns an integer less than, equal to, or
+ greater than zero if the first n bytes of s1 is found, respectively, to be
+ less than, to match, or be greater than the first n bytes of s2. */
.text
.global _U(memcmp)
Index: libc/string/memcpy.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/memcpy.S,v
retrieving revision 1.1
diff -u -r1.1 memcpy.S
--- libc/string/memcpy.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/memcpy.S 19 Jul 2002 06:28:57 -0000
@@ -35,7 +35,15 @@
#define len_hi r21
#define len_lo r20
-; void *memcpy(void *dest, const void *src, size_t len)
+/** \ingroup avr_string
+ \fn void *memcpy(void *dest, const void *src, size_t len)
+ \brief Copy a memory area.
+
+ The memcpy() function copies n bytes from memory area src to memory area
+ dest. The memory areas may not overlap. Use memmove(3) if the memory
+ areas do overlap.
+
+ \returns The memcpy() function returns a pointer to dest. */
.text
.global _U(memcpy)
Index: libc/string/memmove.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/memmove.S,v
retrieving revision 1.1
diff -u -r1.1 memmove.S
--- libc/string/memmove.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/memmove.S 19 Jul 2002 06:28:57 -0000
@@ -35,7 +35,14 @@
#define len_hi r21
#define len_lo r20
-; void *memmove(void *dest, const void *src, size_t len)
+/** \ingroup avr_string
+ \fn void *memmove(void *dest, const void *src, size_t len)
+ \brief Copy memory area.
+
+ The memmove() function copies n bytes from memory area src to memory area
+ dest. The memory areas may overlap.
+
+ \returns The memmove() function returns a pointer to dest. */
.extern _U(memcpy)
.text
Index: libc/string/memset.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/memset.S,v
retrieving revision 1.1
diff -u -r1.1 memset.S
--- libc/string/memset.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/memset.S 19 Jul 2002 06:28:57 -0000
@@ -35,7 +35,14 @@
#define len_hi r21
#define len_lo r20
-; void *memset(void *dest, int val, size_t len)
+/** \ingroup avr_string
+ \fn void *memset(void *dest, int val, size_t len)
+ \brief Fill memory with a constant byte.
+
+ The memset() function fills the first n bytes of the memory area pointed
+ to by s with the constant byte c.
+
+ \returns The memset() function returns a pointer to the memory area s. */
.text
.global _U(memset)
Index: libc/string/strcasecmp.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strcasecmp.S,v
retrieving revision 1.1
diff -u -r1.1 strcasecmp.S
--- libc/string/strcasecmp.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strcasecmp.S 19 Jul 2002 06:28:57 -0000
@@ -46,7 +46,18 @@
#define tmp r22
#define cht r21
-; int strcasecmp(const char *s1, const char *s2)
+/** \ingroup avr_string
+ \fn int strcasecmp(const char *s1, const char *s2)
+ \brief Compare two strings ignoring case.
+
+ The strcasecmp() function compares the two strings s1 and s2, ignoring the
+ case of the characters. It returns an integer less than, equal to, or
+ greater than zero if s1 is found, respectively, to be less than, to match,
+ or be greater than s2.
+
+ \returns The strcasecmp() function returns an integer less than, equal to,
+ or greater than zero if s1 is found, respectively, to be less than, to
+ match, or be greater than s2. */
.text
.global _U(strcasecmp)
Index: libc/string/strcat.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strcat.S,v
retrieving revision 1.1
diff -u -r1.1 strcat.S
--- libc/string/strcat.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strcat.S 19 Jul 2002 06:28:57 -0000
@@ -33,7 +33,17 @@
#define src_hi r23
#define src_lo r22
-; char *strcat(char *dest, const char *src)
+/** \ingroup avr_string
+ \fn char *strcat(char *dest, const char *src)
+ \brief Concatenate two strings.
+
+ The strcat() function appends the src string to the dest string
+ overwriting the `\0' character at the end of dest, and then adds a
+ terminating `\0' character. The strings may not overlap, and the dest
+ string must have enough space for the result.
+
+ \returns The strcat() function returns a pointer to the resulting string
+ dest. */
.text
.global _U(strcat)
Index: libc/string/strchr.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strchr.S,v
retrieving revision 1.1
diff -u -r1.1 strchr.S
--- libc/string/strchr.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strchr.S 19 Jul 2002 06:28:57 -0000
@@ -36,7 +36,18 @@
#define ret_hi r25
#define ret_lo r24
-; char *strchr(const char *src, int val)
+/** \ingroup avr_string
+ \fn char *strchr(const char *src, int val)
+ \brief Locate character in string.
+
+ The strchr() function returns a pointer to the first occurrence of the
+ character c in the string s.
+
+ Here "character" means "byte" - these functions do not work with wide or
+ multi-byte characters.
+
+ \returns The strchr() function returns a pointer to the matched character
+ or NULL if the character is not found. */
.text
.global _U(strchr)
Index: libc/string/strcmp.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strcmp.S,v
retrieving revision 1.1
diff -u -r1.1 strcmp.S
--- libc/string/strcmp.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strcmp.S 19 Jul 2002 06:28:59 -0000
@@ -36,7 +36,17 @@
#define ret_hi r25
#define ret_lo r24
-; int strcmp(const char *s1, const char *s2)
+/** \ingroup avr_string
+ \fn int strcmp(const char *s1, const char *s2)
+ \brief Compare two strings.
+
+ The strcmp() function compares the two strings s1 and s2. It returns an
+ integer less than, equal to, or greater than zero if s1 is found,
+ respectively, to be less than, to match, or be greater than s2.
+
+ \returns The strcmp() function returns an integer less than, equal to, or
+ greater than zero if s1 is found, respectively, to be less than, to match,
+ or be greater than s2. */
.text
.global _U(strcmp)
Index: libc/string/strcpy.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strcpy.S,v
retrieving revision 1.1
diff -u -r1.1 strcpy.S
--- libc/string/strcpy.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strcpy.S 19 Jul 2002 06:28:59 -0000
@@ -33,7 +33,23 @@
#define src_hi r23
#define src_lo r22
-; char *strcpy(char *dest, const char *src)
+/** \ingroup avr_string
+ \fn char *strcpy(char *dest, const char *src)
+ \brief Copy a string.
+
+ The strcpy() function copies the string pointed to by src (including the
+ terminating `\0' character) to the array pointed to by dest. The strings
+ may not overlap, and the destination string dest must be large enough to
+ receive the copy.
+
+ \returns The strncpy() function returns a pointer to the destination
+ string dest.
+
+ \note If the destination string of a strcpy() is not large enough (that
+ is, if the programmer was stupid/lazy, and failed to check the size before
+ copying) then anything might happen. Overflowing fixed length strings is
+ a favourite cracker technique. */
+
; 9 words, (14 + strlen(src) * 7) cycles
.text
Index: libc/string/strlcat.c
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strlcat.c,v
retrieving revision 1.1
diff -u -r1.1 strlcat.c
--- libc/string/strlcat.c 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strlcat.c 19 Jul 2002 06:28:59 -0000
@@ -36,18 +36,19 @@
#endif
#include
-/*
- * Appends src to string dst of size siz (unlike strncat, siz is the
- * full size of dst, not space left). At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
- * Returns strlen(src) + MIN(siz, strlen(initial dst)).
- * If retval >= siz, truncation occurred.
- */
+/** \ingroup avr_string
+ \fn size_t strlcat (char *dst, const char *src, size_t siz)
+ \brief Concatenate two strings.
+
+ Appends src to string dst of size siz (unlike strncat(), siz is the
+ full size of dst, not space left). At most siz-1 characters
+ will be copied. Always NULL terminates (unless siz <= strlen(dst)).
+
+ \returns The strlcat() function returns strlen(src) + MIN(siz,
+ strlen(initial dst)). If retval >= siz, truncation occurred. */
+
size_t
-strlcat(dst, src, siz)
- char *dst;
- const char *src;
- size_t siz;
+strlcat (char *dst, const char *src, size_t siz)
{
register char *d = dst;
register const char *s = src;
Index: libc/string/strlcpy.c
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strlcpy.c,v
retrieving revision 1.1
diff -u -r1.1 strlcpy.c
--- libc/string/strlcpy.c 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strlcpy.c 19 Jul 2002 06:28:59 -0000
@@ -36,16 +36,18 @@
#endif
#include
-/*
- * Copy src to string dst of size siz. At most siz-1 characters
- * will be copied. Always NUL terminates (unless siz == 0).
- * Returns strlen(src); if retval >= siz, truncation occurred.
- */
+/** \ingroup avr_string
+ \fn size_t strlcpy (char *dst, const char *src, size_t siz)
+ \brief Copy a string.
+
+ Copy src to string dst of size siz. At most siz-1 characters will be
+ copied. Always NULL terminates (unless siz == 0).
+
+ \returns The strlcpy() function returns strlen(src). If retval >= siz,
+ truncation occurred. */
+
size_t
-strlcpy(dst, src, siz)
- char *dst;
- const char *src;
- size_t siz;
+strlcpy (char *dst, const char *src, size_t siz)
{
register char *d = dst;
register const char *s = src;
Index: libc/string/strlen.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strlen.S,v
retrieving revision 1.1
diff -u -r1.1 strlen.S
--- libc/string/strlen.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strlen.S 19 Jul 2002 06:28:59 -0000
@@ -31,7 +31,15 @@
#define src_hi r25
#define src_lo r24
-; size_t strlen(const char *src)
+/** \ingroup avr_string
+ \fn size_t strlen(const char *src)
+ \brief Calculate the length of a string.
+
+ The strlen() function calculates the length of the string s, not including
+ the terminating `\0' character.
+
+ \returns The strlen() function returns the number of characters in s. */
+
; 10 words, (14 + strlen(src) * 5) cycles
.text
Index: libc/string/strlwr.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strlwr.S,v
retrieving revision 1.1
diff -u -r1.1 strlwr.S
--- libc/string/strlwr.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strlwr.S 19 Jul 2002 06:28:59 -0000
@@ -40,6 +40,17 @@
#define temp r21
; char *strlwr(char *string)
+/** \ingroup avr_string
+ \fn char *strlwr(char *string)
+ \brief Convert a string to lower case.
+
+ The strlwr() function will convert a string to lower case. Only the upper
+ case alphabetic characters [A .. Z] are converted. Non-alphabetic
+ characters will not be changed.
+
+ \returns The strlwr() function returns a pointer to the converted
+ string. The pointer is the same as that passed in since the operation is
+ perform in place. */
.text
.global _U(strlwr)
Index: libc/string/strncasecmp.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strncasecmp.S,v
retrieving revision 1.1
diff -u -r1.1 strncasecmp.S
--- libc/string/strncasecmp.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strncasecmp.S 19 Jul 2002 06:28:59 -0000
@@ -47,7 +47,16 @@
#define ret_hi r25
#define ret_lo r24
-; int strncasecmp(const char *s1, const char *s2, size_t len)
+/** \ingroup avr_string
+ \fn int strncasecmp(const char *s1, const char *s2, size_t len)
+ \brief Compare two strings ignoring case.
+
+ The strncasecmp() function is similar to strcasecmp(), except it only
+ compares the first n characters of s1.
+
+ \returns The strncasecmp() function returns an integer less than, equal to,
+ or greater than zero if s1 (or the first n bytes thereof) is found,
+ respectively, to be less than, to match, or be greater than s2. */
.text
.global _U(strncasecmp)
Index: libc/string/strncat.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strncat.S,v
retrieving revision 1.1
diff -u -r1.1 strncat.S
--- libc/string/strncat.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strncat.S 19 Jul 2002 06:28:59 -0000
@@ -35,7 +35,15 @@
#define len_hi r21
#define len_lo r20
-; char *strncat(char *dest, const char *src, size_t len)
+/** \ingroup avr_string
+ \fn char *strncat(char *dest, const char *src, size_t len)
+ \brief Concatenate two strings.
+
+ The strncat() function is similar to strcat(), except that only the first
+ n characters of src are appended to dest.
+
+ \returns The strncat() function returns a pointer to the resulting string
+ dest. */
.text
.global _U(strncat)
Index: libc/string/strncmp.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strncmp.S,v
retrieving revision 1.1
diff -u -r1.1 strncmp.S
--- libc/string/strncmp.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strncmp.S 19 Jul 2002 06:28:59 -0000
@@ -38,7 +38,16 @@
#define ret_hi r25
#define ret_lo r24
-; int strncmp(const char *s1, const char *s2, size_t len)
+/** \ingroup avr_string
+ \fn int strncmp(const char *s1, const char *s2, size_t len)
+ \brief Compare two strings.
+
+ The strncmp() function is similar to strcmp(), except it only compares the
+ first (at most) n characters of s1 and s2.
+
+ \returns The strncmp() function returns an integer less than, equal to, or
+ greater than zero if s1 (or the first n bytes thereof) is found,
+ respectively, to be less than, to match, or be greater than s2. */
.text
.global _U(strncmp)
Index: libc/string/strncpy.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strncpy.S,v
retrieving revision 1.1
diff -u -r1.1 strncpy.S
--- libc/string/strncpy.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strncpy.S 19 Jul 2002 06:28:59 -0000
@@ -35,7 +35,19 @@
#define len_hi r21
#define len_lo r20
-; char *strncpy(char *dest, const char *src, size_t len)
+/** \ingroup avr_string
+ \fn char *strncpy(char *dest, const char *src, size_t len)
+ \brief Copy a string.
+
+ The strncpy() function is similar to strcpy(), except that not more than n
+ bytes of src are copied. Thus, if there is no null byte among the first n
+ bytes of src, the result will not be null-terminated.
+
+ In the case where the length of src is less than that of n, the remainder
+ of dest will be padded with nulls.
+
+ \returns The strncpy() function returns a pointer to the destination
+ string dest. */
.text
.global _U(strncpy)
Index: libc/string/strnlen.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strnlen.S,v
retrieving revision 1.1
diff -u -r1.1 strnlen.S
--- libc/string/strnlen.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strnlen.S 19 Jul 2002 06:28:59 -0000
@@ -33,7 +33,18 @@
#define len_hi r23
#define len_lo r22
-; size_t strnlen(const char *src, size_t len)
+/** \ingroup avr_string
+ \fn size_t strnlen(const char *src, size_t len)
+ \brief Determine the length of a fixed-size string.
+
+ The strnlen function returns the number of characters in the string
+ pointed to by s, not including the terminating '\0' character, but at most
+ maxlen. In doing this, strnlen looks only at the first maxlen characters
+ at s and never beyond s+maxlen.
+
+ \returns The strnlen function returns strlen(s), if that is less than
+ maxlen, or maxlen if there is no '\0' character among the first maxlen
+ characters pointed to by s. */
.text
.global _U(strnlen)
Index: libc/string/strrchr.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strrchr.S,v
retrieving revision 1.1
diff -u -r1.1 strrchr.S
--- libc/string/strrchr.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strrchr.S 19 Jul 2002 06:28:59 -0000
@@ -36,7 +36,18 @@
#define ret_hi r25
#define ret_lo r24
-; char *strrchr(const char *src, int val)
+/** \ingroup avr_string
+ \fn char *strrchr(const char *src, int val)
+ \brief Locate character in string.
+
+ The strrchr() function returns a pointer to the last occurrence of the
+ character c in the string s.
+
+ Here "character" means "byte" - these functions do not work with wide or
+ multi-byte characters.
+
+ \returns The strrchr() function returns a pointer to the matched character
+ or NULL if the character is not found. */
.text
.global _U(strrchr)
Index: libc/string/strrev.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strrev.S,v
retrieving revision 1.1
diff -u -r1.1 strrev.S
--- libc/string/strrev.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strrev.S 19 Jul 2002 06:28:59 -0000
@@ -40,7 +40,14 @@
#define ltemp r23
#define rtemp r22
-; char *strrev(char *string)
+/** \ingroup avr_string
+ \fn char *strrev(char *string)
+ \brief Reverse a string.
+
+ The strrev() function reverses the order of the string.
+
+ \returns The strrev() function returns a pointer to the beginning of the
+ reversed string. */
.text
.global _U(strrev)
Index: libc/string/strstr.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strstr.S,v
retrieving revision 1.1
diff -u -r1.1 strstr.S
--- libc/string/strstr.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strstr.S 19 Jul 2002 06:28:59 -0000
@@ -44,7 +44,15 @@
#define ret_hi r25
#define ret_lo r24
-;char *strstr(const char *s1, const char *s2)
+/** \ingroup avr_string
+ \fn char *strstr(const char *s1, const char *s2)
+ \brief Locate a substring.
+
+ The strstr() function finds the first occurrence of the substring needle
+ in the string haystack. The terminating `\0' characters are not compared.
+
+ \returns The strstr() function returns a pointer to the beginning of the
+ substring, or NULL if the substring is not found. */
.text
.global _U(strstr)
Index: libc/string/strupr.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libc/string/strupr.S,v
retrieving revision 1.1
diff -u -r1.1 strupr.S
--- libc/string/strupr.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libc/string/strupr.S 19 Jul 2002 06:28:59 -0000
@@ -40,7 +40,17 @@
#define str_lo r24
#define temp r21
-; char *strupr(char *string)
+/** \ingroup avr_string
+ \fn char *strupr(char *string)
+ \brief Convert a string to upper case.
+
+ The strupr() function will convert a string to upper case. Only the lower
+ case alphabetic characters [a .. z] are converted. Non-alphabetic
+ characters will not be changed.
+
+ \returns The strupr() function returns a pointer to the converted
+ string. The pointer is the same as that passed in since the operation is
+ perform in place. */
.text
.global _U(strupr)
Index: libm/fplib/dtostrf.S
===================================================================
RCS file: /cvsroot/avr-libc/avr-libc/libm/fplib/dtostrf.S,v
retrieving revision 1.1
diff -u -r1.1 dtostrf.S
--- libm/fplib/dtostrf.S 5 Jul 2002 20:38:44 -0000 1.1
+++ libm/fplib/dtostrf.S 19 Jul 2002 06:28:59 -0000
@@ -179,7 +179,9 @@
brpl _adjust_1
com p_width ; make width positive
inc p_width
-_adjust_1: ; strlen = Y - Z
+ ; Need // in next line to stop doxygen
+ ; from thinking strlen is a variable.
+_adjust_1: ; // strlen = Y - Z
mov rA3, YH
mov rA2, YL
mov rA1, ZH