home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 6
/
Aminet 6 - June 1995.iso
/
Aminet
/
dev
/
gcc
/
libnixV0_8.lha
/
gnu
/
libnix-sources.lha
/
sources
/
nix
/
string
/
strrchr.c
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1994-12-12
|
401 b
|
35 lines
#include <stdio.h>
#include <string.h>
#include <stabs.h>
#ifndef mc68000
char *strrchr(const char *s,int c)
{ char *c1=NULL;
do
if(*s==(char)c)
c1=(char *)s;
while(*s++!='\0');
return c1;
}
#else
asm("
.globl _strrchr
_strrchr:
movel sp@(4:W),a1
movel sp@(8:W),d1
moveq #0,d0
L2: cmpb a1@,d1
jne L1
movel a1,d0
L1: tstb a1@+
jne L2
rts
");
#endif
ALIAS(rindex,strrchr);