summaryrefslogtreecommitdiff
path: root/firmware/common/strrchr.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2010-05-06 21:04:40 +0000
committerThomas Martitz <kugel@rockbox.org>2010-05-06 21:04:40 +0000
commit50a6ca39ad4ed01922aa4f755f0ca579788226cf (patch)
treec7881b015b220558167310345b162324c96be15a /firmware/common/strrchr.c
parentadb506df14aded06ed6e9ebf8540e6fd383ffd6a (diff)
downloadrockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.tar.gz
rockbox-50a6ca39ad4ed01922aa4f755f0ca579788226cf.zip
Move c/h files implementing/defining standard library stuff into a new libc directory, also standard'ify some parts of the code base (almost entirely #include fixes).
This is to a) to cleanup firmware/common and firmware/include a bit, but also b) for Rockbox as an application which should use the host system's c library and headers, separating makes it easy to exclude our files from the build. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25850 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/common/strrchr.c')
-rw-r--r--firmware/common/strrchr.c59
1 files changed, 0 insertions, 59 deletions
diff --git a/firmware/common/strrchr.c b/firmware/common/strrchr.c
deleted file mode 100644
index 31b0d049b3..0000000000
--- a/firmware/common/strrchr.c
+++ /dev/null
@@ -1,59 +0,0 @@
1/*
2FUNCTION
3 <<strrchr>>---reverse search for character in string
4
5INDEX
6 strrchr
7
8ANSI_SYNOPSIS
9 #include <string.h>
10 char * strrchr(const char *<[string]>, int <[c]>);
11
12TRAD_SYNOPSIS
13 #include <string.h>
14 char * strrchr(<[string]>, <[c]>);
15 char *<[string]>;
16 int *<[c]>;
17
18DESCRIPTION
19 This function finds the last occurence of <[c]> (converted to
20 a char) in the string pointed to by <[string]> (including the
21 terminating null character).
22
23RETURNS
24 Returns a pointer to the located character, or a null pointer
25 if <[c]> does not occur in <[string]>.
26
27PORTABILITY
28<<strrchr>> is ANSI C.
29
30<<strrchr>> requires no supporting OS subroutines.
31
32QUICKREF
33 strrchr ansi pure
34*/
35
36#include <string.h>
37
38char *
39_DEFUN (strrchr, (s, i),
40 _CONST char *s _AND
41 int i)
42{
43 _CONST char *last = NULL;
44
45 if (i)
46 {
47 while ((s=strchr(s, i)))
48 {
49 last = s;
50 s++;
51 }
52 }
53 else
54 {
55 last = strchr(s, i);
56 }
57
58 return (char *) last;
59}