OilPrototype

## OilPrototype OilPrototype — Functions to manipulate prototype information. |

## Synopsis

                        OilPrototype;
    OilPrototype*       oil_prototype_from_string           (const char *s);
    char*               oil_prototype_to_string             (OilPrototype *proto);
    char*               oil_prototype_to_arg_string         (OilPrototype *proto);
    void                oil_prototype_free                  (OilPrototype *proto);
    void                oil_prototype_append_param          (OilPrototype *proto,
                                                             OilParameter *param);

## Description

## Details

### OilPrototype

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

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

### 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.

`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.

`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.

`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`.

`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.

`proto` : | the OilPrototype
`param` : | an OilParameter