# 2.11BSD#431 - /usr/src/lib/libc/pdp/gen/rindex.s

##### Functions

    _rindex           X
    _strrchr          X

       1: /*
       2:  * Copyright (c) 1987 Regents of the University of California.
       3:  * All rights reserved.  The Berkeley software License Agreement
       4:  * specifies the terms and conditions for redistribution.
       5:  */
       6:
       7: #ifdef LIBC_SCCS
       8:         <@(#)rindex.s	1.2 (2.11BSD) 1996/1/12\0>
       9:         .even
      10: #endif LIBC_SCCS
      11:
      12: /*
      13:  * Find the last occurence of c in the string cp.
      14:  * Return pointer to match or null pointer.
      15:  *
      16:  * char *
      17:  * rindex(cp, c)
      18:  *	char *cp, c;
      19:  */
      20: #include "DEFS.h"
      21:
      22:         .globl  _strrchr
      23: _strrchr = _rindex ^ .
      24:
      25: ENTRY(rindex)
      26:         mov     2(sp),r0        / r0 = cp
      27:         mov     4(sp),r1        / r1 = c
      28:         beq     3f              / check for special case of c == '\0'
      29:         mov     r2,-(sp)        / need an extra register to keep track of
      30:         clr     r2              /   last occurance of c (not found == 0)
      31: 1:
      32:         cmpb    (r0),r1         / look for c ...
      33:         beq     2f
      34:         tstb    (r0)+           / but don't pass end of string ...
      35:         bne     1b
      36:         mov     r2,r0           / fell off the end of the string - return
      37:         mov     (sp)+,r2        /   last occurance of c
      38:         rts     pc
      39: 2:
      40:         mov     r0,r2           / remember position of c and bounce back into
      41:         inc     r0              /   loop one position further
      42:         br      1b
      43: 3:
      44:         tstb    (r0)+           / just find end of string
      45:         bne     3b
      46:         dec     r0              / back up to '\0'
      47:         rts     pc              /   and return pointer

#### Defined functions

_rindex defined in line 25; used 180 times

- in line 23
- in /usr/include/string.h line 16
- in /usr/src/bin/ar/misc.c line 118
- in /usr/src/bin/chpass/chpass.c line 405
- in /usr/src/bin/chpass/field.c line 234
- in /usr/src/bin/cp.c line 29, 97
- in /usr/src/bin/csh/sh.file.c line 304
- in /usr/src/bin/csh/sh.h line 433
- in /usr/src/bin/diff/diff.h line 82
- in /usr/src/bin/diff/diffreg.c line 305
- in /usr/src/bin/disklabel/disklabel.c line 495
- in /usr/src/bin/du.c line 23, 64
- in /usr/src/bin/ln.c line 14, 71
- in /usr/src/bin/login/login.c line 176, 431
- in /usr/src/bin/make/doname.c line 187
- in /usr/src/bin/make/dosys.c line 35, 46
- in /usr/src/bin/rcp.c line 451, 510
- in /usr/src/bin/rmail.c line 69
- in /usr/src/bin/tar.c line 113, 675, 882
- in /usr/src/bin/tcsh/sh.h line 220
- in /usr/src/bin/who.c line 45
- in /usr/src/bin/write.c line 77
- in /usr/src/games/fortune/unstr.c line 29, 91
- in /usr/src/games/hunt/hunt.c line 552-554(2)
- in /usr/src/games/robots/main.c line 30, 44
- in /usr/src/games/sail/externs.h line 278
- in /usr/src/games/sail/main.c line 29
- in /usr/src/games/warp/intrp.c line 512
- in /usr/src/games/warp/warp.h line 325
- in /usr/src/include/strings.h line 21
- in /usr/src/lib/cpp/cpp.c line 1139, 1146
- in /usr/src/lib/libc/gen/ttyslot.c line 19, 33
- in /usr/src/libexec/ftpd/ftpd.c line 1245
- in /usr/src/libexec/getty/main.c line 418, 429
- in /usr/src/libexec/rexecd/rexecd.c line 32, 191
- in /usr/src/libexec/rshd/rshd.c line 377
- in /usr/src/local/cxref/basename.c line 18-20(2)
- in /usr/src/local/mkovmake/mkovmake.c line 21-24(4)
- in /usr/src/new/OLD/buildcore.c line 29, 40
- in /usr/src/new/PORT/B/src/bed/b.h line 60
- in /usr/src/new/PORT/B/src/bed/main.c line 63
- in /usr/src/new/PORT/hexdump/hexdump.c line 45-47(2)
- in /usr/src/new/ansi/vmsprep.c line 88
- in /usr/src/new/jove/externs.h line 584, 630
- in /usr/src/new/notes/src/structs.h line 397
- in /usr/src/new/rn/common.h line 697
- in /usr/src/new/rn/intrp.c line 663, 787
- in /usr/src/new/rn/ngsrch.c line 53
- in /usr/src/new/rn/util.c line 417
- in /usr/src/old/compact/compact.c line 76
- in /usr/src/old/compact/uncompact.c line 70
- in /usr/src/old/cu/cu.c line 239-248(3)
- in /usr/src/old/dump/dumpmain.c line 230, 251
- in /usr/src/old/v6/v6.c line 165, 178, 264
- in /usr/src/sbin/dump/dumpmain.c line 386, 407
- in /usr/src/sbin/fsck/main.c line 324, 344
- in /usr/src/sbin/newfs/newfs.c line 64, 117
- in /usr/src/sbin/quotacheck/preen.c line 313, 332
- in /usr/src/sbin/reboot/reboot.c line 41-43(2)
- in /usr/src/sys/autoconfig/main.c line 34-37(2)
- in /usr/src/sys/conf/netbind.c line 24, 71
- in /usr/src/ucb/Mail/aux.c line 362, 556
- in /usr/src/ucb/PORT/pascal/pdx/library.c line 66
- in /usr/src/ucb/ctags.c line 235, 292, 298, 648
- in /usr/src/ucb/finger/net.c line 43-46(2)
- in /usr/src/ucb/ftp/cmds.c line 1234
- in /usr/src/ucb/ftp/ftp.c line 744, 1664
- in /usr/src/ucb/ftp/ftp_var.h line 107
- in /usr/src/ucb/gcore.c line 37, 47
- in /usr/src/ucb/indent/indent.c line 1064-1066(2)
- in /usr/src/ucb/man/apropos.c line 54, 92
- in /usr/src/ucb/rdist/main.c line 72
- in /usr/src/ucb/rdist/server.c line 229, 763, 981
- in /usr/src/ucb/rlogin.c line 38, 78
- in /usr/src/ucb/rsh.c line 35, 60
- in /usr/src/ucb/sccs.c line 757-762(2), 1108, 1133
- in /usr/src/ucb/sendbug/bugfiler.c line 61
- in /usr/src/ucb/sendbug/unixtomh.c line 193
- in /usr/src/ucb/talk/get_names.c line 49
- in /usr/src/ucb/tftp/main.c line 114, 516
- in /usr/src/ucb/tset/tset.c line 404, 651
- in /usr/src/ucb/vacation.c line 217-221(2)
- in /usr/src/ucb/w.c line 90
- in /usr/src/ucb/window/lcmd1.c line 68
- in /usr/src/ucb/window/lcmd2.c line 232
- in /usr/src/ucb/window/main.c line 51, 95
- in /usr/src/usr.bin/at/atq.c line 502
- in /usr/src/usr.bin/find/find.c line 51, 125, 1164
- in /usr/src/usr.bin/patch/patch.c line 294-295(2)
- in /usr/src/usr.bin/ranlib/misc.c line 87
- in /usr/src/usr.bin/refer/refer2.c line 95
- in /usr/src/usr.bin/tip/cmds.c line 546, 637
- in /usr/src/usr.bin/tip/hunt.c line 14, 35
- in /usr/src/usr.bin/tip/tip.h line 241
- in /usr/src/usr.bin/tip/value.c line 47
- in /usr/src/usr.bin/xinstall/xinstall.c line 185
- in /usr/src/usr.lib/libU77/system_.c line 49, 61
- in /usr/src/usr.sbin/catman/catman.c line 134, 170
- in /usr/src/usr.sbin/lpr/filters/necf.c line 39
- in /usr/src/usr.sbin/lpr/lp.h line 92
- in /usr/src/usr.sbin/lpr/lpr.c line 70, 256, 403, 546
- in /usr/src/usr.sbin/lpr/printjob.c line 546, 914, 1177
- in /usr/src/usr.sbin/quotaon/quotaon.c line 70
- in /usr/src/usr.sbin/sendmail.MX/src/envelope.c line 282-283(2)
- in /usr/src/usr.sbin/sendmail.MX/src/main.c line 279
- in /usr/src/usr.sbin/sendmail.MX/src/recipient.c line 285
- in /usr/src/usr.sbin/sendmail/aux/rmail.c line 84
- in /usr/src/usr.sbin/sendmail/src/envelope.c line 276-277(2)
- in /usr/src/usr.sbin/sendmail/src/main.c line 274
- in /usr/src/usr.sbin/sendmail/src/recipient.c line 292
- in /usr/src/usr.sbin/vipw/vipw.c line 238

_strrchr declared in line 22; defined in line 23; used 23 times

- in line 22
- in /usr/include/string.h line 21
- in /usr/src/games/atc/input.c line 285, 293
- in /usr/src/include/string.h line 25
- in /usr/src/include/strings.h line 26
- in /usr/src/lib/libc/pdp/csu/crt0.s line 76, 117
- in /usr/src/libexec/fingerd/fingerd.c line 133
- in /usr/src/libexec/tcpd/inetcf.c line 309
- in /usr/src/libexec/tcpd/scaffold.c line 209
- in /usr/src/libexec/tcpd/tcpd.c line 64
- in /usr/src/libexec/tcpd/tcpdmatch.c line 103
- in /usr/src/libexec/tcpd/try-from.c line 51
- in /usr/src/local/mtools/mcopy.c line 168, 177-179(2)
- in /usr/src/new/kermit5.188/ckuus5.c line 448
- in /usr/src/new/notes/src/parms.h line 177-180(2)
- in /usr/src/new/notes/src/structs.h line 394
- in /usr/src/usr.bin/m4/misc.c line 201-203(2)

Last modified: 1996-01-12 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 1684 |