Returns: | |||
_ NULL | : if memory allocation could not be performed | ||
a new XCLE_Signature object.. |
Errors: | |||
_ ENOMEM | : if no memory was available |
Args: | |||
_ sig | : the original object to copy |
Returns: | |||
_ NULL | : if no memory was available or an invalid signature was passed as argument | ||
a complete copy of the 'sig' object. |
Errors: | |||
_ EINVAL | : if 'sig' was NULL or invalid | ||
_ ENOMEM | : if no memory was available |
Args: | |||
_ sig | : XCLE_Signature to free |
Args: | |||
_ sig | : the XCLE_Signature object to query |
Returns: | |||
_ -1 | : if an invalid signature was passed as argument | ||
the number of signatures in 'sig'. |
Errors: | |||
_ EINVAL | : if 'sig' was NULL or invalid |
Args: | |||
_ sig | : the XCLE_Signature object to query | ||
_ sign | : the index number of the signature |
Returns: | |||
_ -1 | : if an error occured | ||
the number of arguments for the signature at index 'sign'. |
Errors: | |||
_ EINVAL | : if 'sig' was NULL or invalid, or 'sign' was greater than the number of signatures in 'sig' |
Args: | |||
_ sig | : the XCLE_Signature object to query | ||
_ sign | : the index number of the signature |
Returns: | |||
_ -1 | : if an error occured | ||
the number of returns for the signature at index 'sign'. |
Errors: | |||
_ EINVAL | : if 'sig' was NULL or invalid, or 'sign' was greater than the number of signatures in 'sig' |
Args: | |||
_ sig | : the XCLE_Signature object to query | ||
_ sign | : the index number of the signature | ||
_ argn | : the index number of the argument |
Returns: | |||
_ -1 | : if an error occured | ||
the type of the 'argn'th argument for the signature at index 'sign'. |
Errors: | |||
_ EINVAL | : if 'sig' was NULL or invalid, or 'sign' was greater than the number of signatures in 'sig', or 'argn' was greater than the number of arguments for this signature |
Args: | |||
_ sig | : the XCLE_Signature object to query | ||
_ sign | : the index number of the signature | ||
_ retn | : the index number of the return |
Returns: | |||
_ -1 | : if an error occured | ||
the type of the 'retn'th return for the signature at index 'sign'. |
Errors: | |||
_ EINVAL | : if 'sig' was NULL or invalid, or 'sign' was greater than the number of signatures in 'sig', or 'argn' was greater than the number of arguments for this signature |
Args: | |||
_ cod | : XCLE_Code object to query |
Returns: | |||
_ NULL | : if no memory was available, or the XCLE_Code object was NULL or invalid | ||
the signatures contained in 'cod'. |
Errors: | |||
_ ENOMEM | : if no memory was available | ||
_ EINVAL | : if 'cod' was NULL or invalid |
Args: | |||
_ sig | : XCLE_Signature to modify | ||
_ argc | : number of arguments | ||
_ argt | : number of returns | ||
_ retc | : argument types list | ||
_ rett | : returns types list |
Returns: | |||
_ -1 | : if an error occured | ||
the modified 'sig' object. |
Errors: | |||
_ ENOMEM | : if no memory was available | ||
_ EINVAL | : if 'sig' was NULL or invalid |
Note: | |||
Upon allocation with XCLE_SignatureAlloc, an XCLE_Signature starts with no registered | |||
signature. As such, it will mean literally 'accepts no argument configuration, does not | |||
return', i.e. something that can not be executed. XCLE_SignatureAdd must be used at least | |||
once to make an XCLE_Signature usable. It can be used several times, meaning several | |||
input/output configurations are acceptable. |
Args: | |||
_ sig | : XCLE_Signature to test | ||
_ argc | : number of arguments | ||
_ argt | : number of returns | ||
_ retc | : types of arguments | ||
_ rett | : types of returns |
Returns: | |||
_ -1 | : if an argument was invalid | ||
the index of a matching signature in 'sig'. |
Errors: | |||
_ EINVAL | : if 'sig' was NULL or invalid |
Note: | |||
XCLE_SignatureMatch is exactly looking for the index of a signature added using | |||
XCLE_SignatureAdd with the same 'argc', 'argt', 'retc' and 'rett' arguments values. |
Args: | |||
_ sig | : XCLE_Signature to modify | ||
_ sign | : index number of the signature to delete |
Returns: | |||
_ -1 | : if an argument was invalid | ||
the modified 'sig' argument. |
Errors: | |||
_ EINVAL | : if 'sig' was NULL or invalid |
Note: | |||
This deletes one signature from the list, changing the index numbers of other | |||
signatures. XCLE_SignatureDel thus invalidates any previous signature index | |||
obtained from 'sig' with the XCLE_SignatureMatch function, and decreases of 1 | |||
the return value of XCLE_SignatureNum. |
Args: | |||
_ sig | : XCLE_Signature to display | ||
_ out | : output character buffer, of size at least 'len' | ||
_ len | : maximum number of characters to write |
Returns: | |||
_ -1 | : if an argument was invalid | ||
the maximum number of characters needed to write completely the XCLE_Signature if 'out' is NULL, otherwise the number of characters written in 'out'. |
Errors: | |||
_ EINVAL | : if 'sig' was NULL or invalid |
Args: | |||
_ sig | : XCLE_Signature to write | ||
_ wrt | : handler for the real write operation | ||
_ dat | : user-set data pointer to pass the handler | ||
_ fmt | : data formatting information |
Returns: | |||
_ NULL | : if some error occurred | ||
else total number of character needed, if 'wrt' is NULL, the total number of characters printed otherwise. |
Errors: | |||
_ EINVAL | : if a NULL XCLE_Signature was passed as argument | ||
_ ENOMEM | : if no memory was available | ||
or any error generated by the 'wrt' handler |
Note: | |||
See [XCLE_Mod_write] for details on the XCLE_WriteHandler and XCLE_WriteFormat types. |
Args: | |||
_ sig | : XCLE_Signature to print | ||
_ fd | : file descriptor |
Returns: | |||
_ -1 | : if an argument was invalid, or a write error occured | ||
else the number of characters written on 'fd'. |
Errors: | |||
_ EINVAL | : if 'sig' was NULL or invalid | ||
_ any error generated by the 'write' system call on 'fd' |
Args: | |||
_ sig | : XCLE_Signature to print | ||
_ os | : output stream |
Returns: | |||
_ -1 | : if an argument was invalid, or a write error occured | ||
else the number of characters written on 'os'. |
Errors: | |||
_ EINVAL | : if 'sig' was NULL or invalid | ||
_ any error generated by the 'fwrite' system call on 'os' |
Args: | |||
_ sg1 | : candidate-subset XCLE_Signature | ||
_ sg2 | : candidate-superset XCLE_Signature |
Returns: | |||
_ -1 | : if an argument was invalid | ||
_ 0 | : if some signatures in 'sg1' were not in 'sg2' | ||
_ 1 | : if ALL signatures in 'sg1' were also in 'sg2' |
Errors: | |||
_ EINVAL | : if 'sg1' or 'sg2' were NULL or invalid |
Note: | |||
XCLE_SignatureIsSub is a partial order relation: XCLE_SignatureIsSub(sg1,sg2)==0 does not mean XCLE_SignatureIsSub(sg2,sg1)==1. The reverse is true, however, except when 'sg1' and 'sg2' are equal. When comparing type specifications, a type mask is a subset of another if any non-zero bit in the first one is also non-zero in the second one. |
Args: | |||
_ sg1 | : first XCLE_Signature to test | ||
_ sg2 | : second XCLE_Signature to test |
Returns: | |||
_ 0 | : if only one argument was NULL, or the argument differed | ||
_ 1 | : if both 'sg1' and 'sg2' were NULL, or they were equal |
Note: | |||
Testing equality for XCLE_Signature objects means ensuring that every signature found in 'sg1' is also in 'sg2', and vice-versa. This means strict equality, and matching but not equal type masks count as distinct. |
Args: | |||
_ sg1 | : first XCLE_Signature | ||
_ sg2 | : second XCLE_Signature |
Returns: | |||
_ -1 | : if one of the arguments was NULL or invalid | ||
_ 0 | : if 'sg2' is not compatible with 'sg1' | ||
_ 1 | : if one argument signature in 'sg2' was compatible with one return signature in 'sg1' |
Errors: | |||
_ EINVAL | : if 'sg1' or 'sg2' were NULL or invalid | ||
_ ENOMEM | : if no memory was available |
Note: | |||
Compatibility of 'sg2' with 'sg1' means than at least one signature in 'sg1' is compatible with at least one signature in 'sg2', i.e. a signature in 'sg1' which asks for, either:. | |||
_ less arguments than a counterpart in 'sg1', and that all argument types match return types in that signature | |||
_ more arguments than a counterpart in 'sg1', and that all return types match argument types in this signature | |||
In both cases, overflow types (types that are in a position bigger than the smaller of the argument and return counts) are ignored. |
Args: | |||
_ sg1 | : first XCLE_Signature | ||
_ sg2 | : second XCLE_Signature |
Returns: | |||
_ NULL | : if an error occured | ||
else . |
Errors: | |||
_ EINVAL | : if 'sg1' or 'sg2' were NULL or invalid | ||
_ ENOMEM | : if no memory was available |
Note: | |||
Chaining two signatures meaning keeping only compatible couples of signatures in 'sg1' and 'sg2', and discarding matching return sections in 'sg1' signatures, and argument sections in 'sg2' signatures. Overflow arguments from 'sg2' are added to argument signatures in the results, and overflow returns from 'sg1' are added to retrurn signatures in the results. |
Args: | |||
_ lst | : XCLE_List to profile |
Returns: | |||
_ NULL | : if an error occured | ||
else the chain of all extracted signatures from elements in 'lst'. |
Errors: | |||
_ EINVAL | : if 'lst' was NULL or invalid | ||
_ ENOMEM | : if no memory was available |
Note: | |||
Each element in the list is converted into a signature. All types except XCLE_Code have a signle signature, taking no argument and returning that type. Signatures are extracted from XCLE_Code object using XCLE_SignatureExtract. The chain is then computed from the left onward, in associative manner. |