Difference between revisions of "Scl function"

From STRIDE Wiki
Jump to: navigation, search
(Syntax)
(Syntax)
Line 5: Line 5:
 
== Syntax ==
 
== Syntax ==
  
  #pragma scl_function(function-name [,<intercept>])
+
  #pragma scl_function(function-name [,context, name-mangling, group-id])
  
  
Line 19: Line 19:
 
| ''context''
 
| ''context''
 
| String
 
| String
| Context in which the function is going to be intercepted.
+
| Context in which the function is going to be intercepted. Optional.
 
|-
 
|-
 
| ''name-mangling''
 
| ''name-mangling''
 
| String
 
| String
| Type of [[Name_Mangling_Conflicts|name mangling]] to be used when intercepted.
+
| Type of [[Name_Mangling|name mangling]] to be used when intercepted. Optional.
 
|-
 
|-
 
| ''group-id''
 
| ''group-id''
 
| String
 
| String
| User defined identifier representing the group to which this function belongs when solving name mangling conflicts.
+
| User defined identifier representing the group to which this function belongs when solving name mangling conflicts. Optional.
 
|}
 
|}
  

Revision as of 17:07, 19 March 2009

The scl_function pragma

The scl_function pragma allows the user to capture the function. All interfaces that STRIDE works with must be captured.

Syntax

#pragma scl_function(function-name [,context, name-mangling, group-id])


Parameters Type Description
function-name String Name of the function to define (no quotes)
context String Context in which the function is going to be intercepted. Optional.
name-mangling String Type of name mangling to be used when intercepted. Optional.
group-id String User defined identifier representing the group to which this function belongs when solving name mangling conflicts. Optional.

Notes

  • Identifier must be declared as a function designator with external linkage.
  • A compilation error is reported if an attempt is made to capture a function more than once (with either scl_func or scl_function).

Example

int f(int x); 

#pragma scl_function(f)