home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume8
/
libhoward
/
part08
/
smpdtl.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-10-01
|
2KB
|
74 lines
/*
* smpdtl - look up character in digit table
*/
#ifndef lint
static char _cpyrgt[] = "Copyright 1989 Howard Lee Gayle";
#endif lint
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 1,
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdio.h>
#include <howard/port.h>
#include <howard/version.h>
MODVER ("@(#)$Header: smpdtl.c,v 1.6 89/08/14 17:37:31 howard Exp $");
#include <errno.h>
#include <string.h>
#include <howard/registers.i>
#include <howard/simultipre.i>
#include <howard/smp.h>
PUBLIC int smpdtl (c, dt)
R2 rcharT c; /* Character to look up.*/
R3 bStrT *dt; /* Digit table.*/
/* Function:
* Search digit table dt for character c.
* Algorithm:
* Linear search.
* Returns:
* Index into dt on success, -1 on error.
* Notes:
*
*/
{
R1 bStrT *p; /* Steps through dt.*/
for (p = dt; (NULBSTR != *p) && (NULCSTR == strchr ((cStrT) *p, c)); ++p)
;
return ((NULBSTR == *p) ? -1 : p - dt);
}
#ifdef TEST
#include <howard/usage.h>
MAINVER ("@(#)$Header: smpdtl.c,v 1.6 89/08/14 17:37:31 howard Exp $");
USAGE ("");
#include <howard/malf.h>
PUBLIC int main ()
{
malf1 ("Testing done in a2smp");
#ifdef lint
return (SUCCESS);
#endif
}
#endif