mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-22 16:04:18 +00:00
67 lines
3.0 KiB
Plaintext
67 lines
3.0 KiB
Plaintext
$TITLE ('SFOUND')
|
|
$SMALL
|
|
SFOUND_VAX: DO; /* PL/M-VAX VERSION OF SFOUND.A86 */
|
|
/*************************************************************************/
|
|
/* */
|
|
/* D I S C L A I M E R N O T I C E */
|
|
/* ------------------- ----------- */
|
|
/* */
|
|
/* This document and/or portions of the material and data furnished */
|
|
/* herewith, was developed under sponsorship of the U. S. Government. */
|
|
/* Neither the U.S. nor the U.S.D.O.E., nor the Leland Stanford Junior */
|
|
/* University, nor their employees, nor their respective contractors, */
|
|
/* subcontractors, or their employees, makes any warranty, express or */
|
|
/* implied, or assumes any liability or responsibility for accuracy, */
|
|
/* completeness or usefulness of any information, apparatus, product */
|
|
/* or process disclosed, or represents that its use will not infringe */
|
|
/* privately-owned rights. Mention of any product, its manufacturer, */
|
|
/* or suppliers shall not, nor is it intended to, imply approval, dis- */
|
|
/* approval, or fitness for any particular use. The U. S. and the */
|
|
/* University at all times retain the right to use and disseminate same */
|
|
/* for any purpose whatsoever. Such distribution shall be made by the */
|
|
/* National Energy Software Center at the Argonne National Laboratory */
|
|
/* and only subject to the distributee furnishing satisfactory proof */
|
|
/* that he has a valid license from the Intel Corporation in effect. */
|
|
/* */
|
|
/*************************************************************************/
|
|
|
|
/*****************************************************************/
|
|
/****** ******/
|
|
/****** WARNING WARNING WARNING WARNING ******/
|
|
/****** ******/
|
|
/****** This module cannot be called from another module ******/
|
|
/****** which was compiled under the LARGE control. ******/
|
|
/****** ******/
|
|
/*****************************************************************/
|
|
|
|
$INCLUDE (PLM$UDI:CUSTOMARY.LIT)
|
|
|
|
DECLARE SCANP ADDRESS EXTERNAL,
|
|
TARGET (1) BYTE EXTERNAL;
|
|
|
|
DECLARE TARLEN BYTE PUBLIC, /* length of target */
|
|
JOKER BYTE PUBLIC INITIAL ('?'),
|
|
GIVEUP ADDRESS PUBLIC;
|
|
|
|
SFOUND: PROCEDURE BYTE PUBLIC REENTRANT;
|
|
/* (Reentrant so local storage allocated on stack.) */
|
|
DECLARE P ADDRESS,
|
|
(CHAR BASED P) (1) BYTE,
|
|
I INTEGER;
|
|
|
|
P=SCANP;
|
|
DO P=SCANP TO GIVEUP-1;
|
|
DO I=0 TO TARLEN-1;
|
|
IF CHAR(I)<>TARGET(I) AND CHAR(I)<>JOKER THEN
|
|
GO TO TRY_NEXT_POSITION;
|
|
ENDIF
|
|
ENDDO
|
|
SCANP=.CHAR(TARLEN); /* position SCANP to last char matched+1 */
|
|
RETURN TRUE;
|
|
TRY_NEXT_POSITION:
|
|
ENDDO;
|
|
RETURN FALSE; /* target not found */
|
|
END SFOUND;
|
|
|
|
END SFOUND_VAX;
|