ToolTalk User's Guide

Adding Files to Scoped Patterns

To match TT_SESSION-scoped messages and TT_SESSION-scoped patterns that have the same file attributes, you can add file attributes to TT_SESSION-scoped patterns with the tt_pattern_file_add call, as shown in Example 3–10.


Note –

The file attribute values do not affect the scope of the pattern.



Example 3–10 Adding Two File Attributes to a Session-Scoped Pattern

Obtain procid  

tt_open(); 

Create pattern 

Tt_pattern pat = tt_create_pattern(); 

Add scope to pattern 

tt_pattern_scope_add(pat, TT_SESSION); 

Add session to pattern 

tt_pattern_session_add(tt_default_session()); 

Add first file attribute to pattern 

tt_pattern_file_add(pat, file1); 

Add second file attribute to pattern 

tt_pattern_file_add(pat, file2);  

Register pattern 

tt_pattern_register(pat);