Library Context

## Functions

int | lightify_new (struct lightify_ctx **ctx, void *reserved)
int | lightify_free (struct lightify_ctx *ctx)
void * | lightify_get_userdata (struct lightify_ctx *ctx)
int | lightify_set_userdata (struct lightify_ctx *ctx, void *userdata)

## Detailed Description

## Function Documentation

int lightify_free | ( | struct lightify_ctx * | ctx | ) |

Free the context structure including all data objects associated.

Parameters

  ctx |

Returns
  0 on success, negative on errors (e.g wrong parameter)

Definition at line 475 of file context.c.

void* lightify_get_userdata | ( | struct lightify_ctx * | ctx | ) |

Get the stored userdata

Parameters

  ctx | context

Returns
  >=0 on success

See also
  lightify_set_userdata

Definition at line 400 of file context.c.

int lightify_new | ( | struct lightify_ctx ** | ctx,
|  | void * | reserved
| ) |  |

Create a new library context object

Parameters

  ctx | where to store the pointer of the object
  reserved | The second parameter, a pointer, is reserved for future use. Until then, provide NULL.

Returns
  0 on success, negative value on error.

Definition at line 428 of file context.c.

int lightify_set_userdata | ( | struct lightify_ctx * | ctx,
|  | void * | userdata
| ) |  |

Store a pointer in the library context.

This can be used for user-data to be associated with the context.

Parameters

  ctx | context
  userdata | pointer to be stored

Returns
  >=0 on success

See also
  lightify_get_userdata

Definition at line 406 of file context.c.