Scl function: Difference between revisions

From STRIDE Wiki
Jump to navigation Jump to search
Line 21: Line 21:
| ''context''
| ''context''
| String
| String
| Optional. Context in which the function is going to be intercepted. Possible values are ''"REFERENCE"'' - intercept at the function call or ''"DEFINITION"'' - intercept at the function definition. These options are equivalent to the [[Intercept_Module#Owner.2FUser|user and owner delegate options]] that are in place for generating [[Intercept_Module#Delegate|delegates]].
| Optional. Context in which the function is going to be intercepted. Possible values are ''"REFERENCE"'' - intercept at the function call or ''"DEFINITION"'' - intercept at the function definition. These attribute is equivalent to the [[Intercept_Module#Owner.2FUser|User/Owner option]] that is in place for generating [[Intercept_Module#Delegate|delegates]].
|-
|-
| ''name-mangling''
| ''name-mangling''
| String
| String
| Optional. Type of [[Name_Mangling|name mangling]] to be used when intercepted. Possible values are ''"EXPLICIT"'' or ''"IMPLICIT"''.  
| Optional. Type of [[Name_Mangling|name mangling]] to be used when intercepted. Possible values are ''"EXPLICIT"'' or ''"IMPLICIT"''. These attribute is equivalent to the [[Intercept_Module#Implicit.2FExplicit|Implicit/Explicit
option]] that is in place for generating delegates.
 
|-
|-
| ''group-id''
| ''group-id''
| String
| String
| Optional. User defined identifier representing the group to which this function belongs when solving name mangling conflicts.  
| Optional. User defined identifier representing the group to which this function belongs when solving name mangling conflicts. These attribute is equivalent to the [[Intercept_Module#Group_ID|Group ID
option]] that is in place for generating delegates.
|}
|}



Revision as of 23:25, 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.

When captured for the purpose of interception optional arguments allow specification of how would it be done.

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 Optional. Context in which the function is going to be intercepted. Possible values are "REFERENCE" - intercept at the function call or "DEFINITION" - intercept at the function definition. These attribute is equivalent to the User/Owner option that is in place for generating delegates.
name-mangling String Optional. Type of name mangling to be used when intercepted. Possible values are "EXPLICIT" or "IMPLICIT". These attribute is equivalent to the Implicit/Explicit option that is in place for generating delegates.
group-id String Optional. User defined identifier representing the group to which this function belongs when solving name mangling conflicts. These attribute is equivalent to the Group ID option that is in place for generating delegates.

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)

void depend(void);

#pragma scl_function(depend, "DEFINITION", "IMPLICIT", "TEST_GROUP")