liblightify
groups.c File Reference
#include "liblightify-private.h"
#include "node.h"
#include "context.h"
#include "groups.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
Include dependency graph for groups.c:

Go to the source code of this file.

Data Structures

struct  lightify_group
 

Functions

int lightify_group_new (struct lightify_ctx *ctx, struct lightify_group **newgroup)
 
int lightify_group_remove (struct lightify_group *grp)
 
int lightify_group_set_name (struct lightify_group *grp, const unsigned char *name)
 
const LIGHTIFY_EXPORT char * lightify_group_get_name (struct lightify_group *grp)
 
int lightify_group_set_id (struct lightify_group *grp, int id)
 
LIGHTIFY_EXPORT int lightify_group_get_id (struct lightify_group *grp)
 
LIGHTIFY_EXPORT struct lightify_grouplightify_group_get_next (struct lightify_ctx *ctx, struct lightify_group *current)
 
LIGHTIFY_EXPORT struct lightify_grouplightify_group_get_previous (struct lightify_ctx *ctx, struct lightify_group *current)
 
LIGHTIFY_EXPORT struct lightify_nodelightify_group_get_next_node (struct lightify_group *grp, struct lightify_node *lastnode)
 

Detailed Description

Group support.

Definition in file groups.c.

Function Documentation

◆ lightify_group_new()

int lightify_group_new ( struct lightify_ctx ctx,
struct lightify_group **  newgroup 
)

Generate a new group object

Parameters
ctxLibrary context
newgroupwhere to store new pointer of new group
Returns
negative on error. >=0 is success.

Definition at line 60 of file groups.c.

◆ lightify_group_remove()

int lightify_group_remove ( struct lightify_group grp)

Remove group from linked list and free memory associated.

Parameters
grpto operate on
Returns
negative on error. >=0 is success.

Definition at line 84 of file groups.c.

◆ lightify_group_set_id()

int lightify_group_set_id ( struct lightify_group grp,
int  id 
)

Set Group's ID

Parameters
grpto operate on
idto set
Returns
negative on error. >=0 is success.

Definition at line 122 of file groups.c.

◆ lightify_group_set_name()

int lightify_group_set_name ( struct lightify_group grp,
const unsigned char *  name 
)

Set Group's name

Parameters
grpto operate on
nameto set
Returns
negative on error. >=0 is success.
Note
a maximum lenght of 16 chars is enforced.
a copy of the name is allocated and stored.

Definition at line 104 of file groups.c.