Loading...
Searching...
No Matches
Recipe Definition

## Macros

#define | cpl_get_license(PACKAGE_NAME, YEAR)
| Generate the recipe copyright and license text (GPL v.2).
#define | CPL_RECIPE_DEFINE(RECIPE_NAME, RECIPE_VERSION, RECIPE_FILL_PARAMS, RECIPE_AUTHOR, RECIPE_AUTHOR_EMAIL, RECIPE_YEAR, RECIPE_SYNOPSIS, RECIPE_DESCRIPTION)
| Define a standard CPL recipe.
#define | cpl_recipe_define(RECIPE_NAME, RECIPE_VERSION, RECIPE_AUTHOR, RECIPE_EMAIL, RECIPE_YEAR, RECIPE_SYNOPSIS, RECIPE_DESCRIPTION)
| Define a standard CPL recipe.

## Detailed Description

This module implements the support for recipe defition.

Synopsis:
  #include <cpl_recipedefine.h>

## Macro Definition Documentation

## cpl_get_license

#define cpl_get_license | ( |  | PACKAGE_NAME,
|  |  | YEAR )

Generate the recipe copyright and license text (GPL v.2).

Parameters

  PACKAGE_NAME | The name as a string literal, e.g. from config.h
  YEAR | The year(s) as a string literal

Returns
  The recipe copyright and license text as a string literal

Example:

const char * eso_gpl_license = cpl_get_license(PACKAGE_NAME, "2005, 2008");
cpl_get_license
#define cpl_get_license(PACKAGE_NAME, YEAR)
Generate the recipe copyright and license text (GPL v.2).
Definition cpl_recipedefine.h:51

## CPL_RECIPE_DEFINE

#define CPL_RECIPE_DEFINE | ( |  | RECIPE_NAME,
|  |  | RECIPE_VERSION,
|  |  | RECIPE_FILL_PARAMS,
|  |  | RECIPE_AUTHOR,
|  |  | RECIPE_AUTHOR_EMAIL,
|  |  | RECIPE_YEAR,
|  |  | RECIPE_SYNOPSIS,
|  |  | RECIPE_DESCRIPTION )

Define a standard CPL recipe.

Parameters

  RECIPE_NAME | The name as an identifier
  RECIPE_VERSION | The binary version number
  RECIPE_FILL_PARAMS | A function call to fill the recipe parameterlist. Must evaluate to zero if and only if successful
  RECIPE_AUTHOR | The author as a string literal
  RECIPE_AUTHOR_EMAIL | The author email as a string literal
  RECIPE_YEAR | The copyright year as a string literal
  RECIPE_SYNOPSIS | The synopsis as a string literal
  RECIPE_DESCRIPTION | The man-page as a string literal

Deprecated
  Use cpl_recipe_define()

## cpl_recipe_define

#define cpl_recipe_define | ( |  | RECIPE_NAME,
|  |  | RECIPE_VERSION,
|  |  | RECIPE_AUTHOR,
|  |  | RECIPE_EMAIL,
|  |  | RECIPE_YEAR,
|  |  | RECIPE_SYNOPSIS,
|  |  | RECIPE_DESCRIPTION )

Define a standard CPL recipe.

Parameters

  RECIPE_NAME | The name as an identifier
  RECIPE_VERSION | The binary version number
  RECIPE_AUTHOR | The author as a string literal
  RECIPE_EMAIL | The contact email as a string literal
  RECIPE_YEAR | The copyright year as a string literal
  RECIPE_SYNOPSIS | The synopsis as a string literal
  RECIPE_DESCRIPTION | The man-page as a string literal

A CPL-based recipe may use this macro to define its four mandatory functions: cpl_plugin_get_info(), <recipe>_create(), <recipe>_exec() and <recipe>_destroy(), as well as declaring the actual data reduction function, <recipe>() as

static int <recipe>(cpl_frameset *, const cpl_parameterlist *);
cpl_frameset
struct _cpl_frameset_ cpl_frameset
The frame set data type.
Definition cpl_frameset.h:41
cpl_parameterlist
struct _cpl_parameterlist_ cpl_parameterlist
The opaque parameter list data type.
Definition cpl_parameterlist.h:37

The macro also declares the recipe-specific function that fills the recipe parameterlist with the supported parameters as

static cpl_error_code <recipe>_fill_parameterlist(cpl_parameterlist *self);
cpl_error_code
enum _cpl_error_code_ cpl_error_code
The cpl_error_code type definition.
Definition cpl_error.h:453

A recipe that invokes cpl_recipe_define() must define this function.

The macro cpl_recipe_define() may be used by defining a macro, e.g. in my_recipe.h:

#define MY_RECIPE_DEFINE(NAME, SYNOPSIS, DESCRIPTION) \
cpl_recipe_define(NAME, MY_BINARY_VERSION, \
"Firstname Lastname", "2006, 2008", SYNOPSIS, DESCRIPTION)

- and then by invoking this macro in each recipe:

#include "my_recipe.h"
MY_RECIPE_DEFINE(instrume_img_dark,
"Dark recipe",
"instrume_img_dark -- imaging dark recipe.\n"
" ... recipe man-page\n");
static
cpl_error_code instrume_img_dark_fill_parameterlist(cpl_parameterlist *self);
{
// Fill the parameterlist with the parameters supported by the recipe.
retun CPL_ERROR_NONE;
}
CPL_ERROR_NONE
@ CPL_ERROR_NONE
Definition cpl_error.h:396