home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / clib / strlen.c < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-09  |  805 b   |  50 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: strlen.c,v 1.5 1996/12/11 11:22:36 aros Exp $
  4.  
  5.     Desc: ANSI C function strlen()
  6.     Lang: english
  7. */
  8.  
  9. /*****************************************************************************
  10.  
  11.     NAME */
  12. #include <string.h>
  13.  
  14.     size_t strlen (
  15.  
  16. /*  SYNOPSIS */
  17.     const char * ptr)
  18.  
  19. /*  FUNCTION
  20.     Calculate the length of a string (without the terminating 0 byte).
  21.  
  22.     INPUTS
  23.     ptr - The string to get its length for
  24.  
  25.     RESULT
  26.     The length of the string.
  27.  
  28.     NOTES
  29.  
  30.     EXAMPLE
  31.  
  32.     BUGS
  33.  
  34.     SEE ALSO
  35.  
  36.     INTERNALS
  37.  
  38.     HISTORY
  39.     29.07.1996 digulla created
  40.  
  41. ******************************************************************************/
  42. {
  43.     const char * start = ptr;
  44.  
  45.     while (*ptr) ptr ++;
  46.  
  47.     return (((long)ptr) - ((long)start));
  48. } /* strlen */
  49.  
  50.