OilPrototype

OilPrototype — Functions to manipulate prototype information.

Functions

Types and Values

struct OilPrototype

Description

Functions

oil_prototype_from_string ()

OilPrototype *
oil_prototype_from_string (const char *s);

Converts the string s containing C prototype that follows Liboil parameter naming rules into a OilPrototype. If the string cannot be converted, NULL is returned.

Parameters

s

a string

 

Returns

the OilPrototype. When it is no longer needed, free the prototype using oil_prototype_free().


oil_prototype_to_string ()

char *
oil_prototype_to_string (OilPrototype *proto);

Converts a prototype into the corresponding C style declaration.

Parameters

proto

the OilPrototype

 

Returns

a string that should be freed using free() when it is no longer needed.


oil_prototype_to_arg_string ()

char *
oil_prototype_to_arg_string (OilPrototype *proto);

Converts a prototype into the corresponding C argument list.

Parameters

proto

the OilPrototype

 

Returns

a string that should be freed using free() when it is no longer needed.


oil_prototype_free ()

void
oil_prototype_free (OilPrototype *proto);

Frees memory associated with proto .

Parameters

proto

the OilPrototype

 

oil_prototype_append_param ()

void
oil_prototype_append_param (OilPrototype *proto,
                            OilParameter *param);

Appends param to the list of parameters contained in proto . The contents of param are copied.

Parameters

proto

the OilPrototype

 

param

an OilParameter

 

Types and Values

struct OilPrototype

struct OilPrototype {
  int n_params;
  OilParameter *params;
  OilFunctionClass *klass;
};

An opaque structure describing the C function prototype of an OilFunctionClass .