1INSTR(3)                     MBK UTILITY FUNCTIONS                    INSTR(3)
2
3
4

NAME

6       instr - find an occurrence of a string in a string, starting at a spec‐
7       ified character.
8

SYNOPSIS

10       #include "mut.h"
11       char ∗instr(s, find, from)
12       char ∗s, ∗find, from;
13

PARAMETERS

15       s                   Pointer to the string to be searched for  the  pat‐
16                           tern
17
18       find                Pointer to the string to be found, the pattern
19
20       from                Character to be searched backwards before searching
21                           for the pattern
22

DESCRIPTION

24       instr searches the first occurrence of the string find in the string s,
25       starting its search at the last occurrence of the from character in the
26       string s.
27
28       If either s or find is NULL, the function returns  NULL.   If  from  is
29       (char)0, the pattern is searched from the beginning of s.
30       This  quite  exotic  behaviour  is useful to search the occurrence of a
31       name in a string resulting from a flatten, when only a terminal  object
32       name is to be taken into account.
33

RETURN VALUES

35       instr  return  NULL  either  if  the pattern find is not present in the
36       searched string s, or if one at least of these two string are NULL.  If
37       the pattern is found, a value different from NULL is returned.
38

EXAMPLE

40       #include "mut.h"
41       /* check for the pattern 'ck' anywhere in the string */
42       #define contains_ck(name)instr(name, "ck", ' ')
43       /* check for the pattern 'ck' in the signal name, not instance ones */
44       #define isclock(ptsig) instr(getsigname(ptsig), "ck", SEPAR)
45

SEE ALSO

47       mbk(1), isvdd(3), isvss(3).
48
49
50
51
52
53
54ASIM/LIP6                       October 1, 1997                       INSTR(3)
Impressum