- Main Page
- Data Structures
- Files

- File List
- Globals

# jasperserver/repository.c File Reference

`#include "repository.h"`
`#include "stringbuffer.h"`
`#include <stdio.h>`
`#include <string.h>`
`#include <libxml/encoding.h>`

Go to the source code of this file.

## Defines
#define | DEFAULT_ENCODING "ISO-8859-1"
## Functions
void | jasperserver_print_resource_descriptor (jasperserver_resource_descriptor_t *rd, int depth)
void | jasperserver_print_resource_property (jasperserver_resource_property_t *rp, int depth)
void | jasperserver_print_parameter (jasperserver_parameter_t *rp, int depth)
void | jasperserver_list_free (jasperserver_list_t *list, void(*freeFunc)(void *))
| This is a quick way to free an entire list of elements.
jasperserver_request_t * | jasperserver_request_new ()
| Instance a new request.
void | jasperserver_request_free (jasperserver_request_t *request)
| Free a request.
jasperserver_argument_t * | jasperserver_argument_new ()
| Instance a new argument.
void | jasperserver_argument_free (void *argument_ptr)
| Free an argument.
jasperserver_resource_descriptor_t * | jasperserver_resource_descriptor_new ()
| Instance a new resource_descriptor.
void | jasperserver_resource_descriptor_free (void *res_ptr)
| Free a resource_descriptor.
jasperserver_resource_property_t * | jasperserver_resource_property_new ()
| Instance a new resource_property.
void | jasperserver_resource_property_free (void *resp_ptr)
| Free a resource_property.
jasperserver_parameter_t * | jasperserver_parameter_new ()
| Instance a new parameter.
void | jasperserver_parameter_free (void *resp_ptr)
| Free a parameter.
jasperserver_operation_result_t * | jasperserver_operation_result_new ()
| Instance a new operation_result.
void | jasperserver_operation_result_free (void *op_ptr)
| Free a operation_result.
jasperserver_server_t * | jasperserver_server_new ()
| Instance a new server.
void | jasperserver_server_free (void *op_ptr)
void | jasperserver_list_append (jasperserver_list_t **list, jasperserver_list_t *node)
| Append node at the end of the list pointed by list.
jasperserver_resource_property_t * | jasperserver_get_property (jasperserver_resource_descriptor_t *resource, char *propName)
| Get a property with name 'propName' from the resource 'resource' This funciont looks inside the resource descriptor passed as first parameter for a parameter called 'propName'.
jasperserver_string_t * | jasperserver_get_property_value (jasperserver_resource_descriptor_t *resource, char *propName)
| Get the value of a property with name 'propName' from the resource 'resource' This funciont looks inside the resource descriptor passed as first parameter for a parameter called 'propName' and if found, return the property value.

## Define Documentation

#define DEFAULT_ENCODING "ISO-8859-1"

Definition at line 22 of file repository.c.

## Function Documentation

void jasperserver_argument_free | ( | void * | argument | ) |

Free an argument.

Free the memory allocated using jasperserver_argument_new.

Parameters:

  | argument | The argument to free (jasperserver_argument_t * assumed)

See also:
  jasperserver_argument_new()

Definition at line 118 of file repository.c.

jasperserver_argument_t* jasperserver_argument_new | ( |  | ) |

Instance a new argument.

This function initializes the argument.

It is responsability of the user free the memory allocated by this function using jasperserver_argument_free()

Returns:
  a pointer to a new argument

See also:
  jasperserver_argument_free()

Definition at line 97 of file repository.c.

jasperserver_resource_property_t* jasperserver_get_property | ( | jasperserver_resource_descriptor_t * | resource,
|  | char * | propName |
| ) |  |  |

Get a property with name 'propName' from the resource 'resource' This funciont looks inside the resource descriptor passed as first parameter for a parameter called 'propName'.

Parameters:

  | inputcontrol | The resource in which look for the property
  | propName | The name of the property to look for

Returns:
  The found property or NULL if a property with such name is not found.

Warning:
  Since the property returned belongs to the parent resource, DO NOT free the property by yourself.

See also:
  jasperserver_get_property_value()

Definition at line 434 of file repository.c.

jasperserver_string_t* jasperserver_get_property_value | ( | jasperserver_resource_descriptor_t * | resource,
|  | char * | propName |
| ) |  |  |

Get the value of a property with name 'propName' from the resource 'resource' This funciont looks inside the resource descriptor passed as first parameter for a parameter called 'propName' and if found, return the property value.

Parameters:

  | resource | The resource in which look for the property
  | propName | The name of the property to look for

Returns:
  The value of the property or NULL if a property with such name is not found.

Warning:
  Since the value of the property returned belongs to the parent resource, DO NOT free the property value by yourself.

See also:
  jasperserver_get_property()

Definition at line 449 of file repository.c.

void jasperserver_list_append | ( | jasperserver_list_t ** | list,
|  | jasperserver_list_t * | node |
| ) |  |  |

Append node at the end of the list pointed by list.

jasperserver_list_append takes the pointer to a pointer of the first element of a list. If traverse the list up to the end, and add the new node updating the field 'next' of the previous node.

Parameters:

  | list | It is a pointer to a pointer of a list
  | node | the element to append

Definition at line 361 of file repository.c.

void jasperserver_list_free | ( | jasperserver_list_t * | list,
|  | void(*)(void *) | freeFunc |
| ) |  |  |

This is a quick way to free an entire list of elements.

jasperserver_list_free takes a pointer to list and call itself on list->next. Each node is freed using the function passed. Example:

        jasperserver_list_free( (jasperserver_list_t *)request->arguments, jasperserver_argument_free);

Parameters:

  | list | It is a pointer to a list
  | freeFunc | the address of the function to use to free each node

Definition at line 39 of file repository.c.

void jasperserver_operation_result_free | ( | void * | op_ptr | ) |

Free a operation_result.

Free the memory allocated using jasperserver_operation_result_new.

This method frees recursively all the elements of the operation_result and relative lists.

Parameters:

  | operation_result | The operation_result to free (jasperserver_operation_result_t* assumed)

See also:
  jasperserver_operation_result_new()

Definition at line 291 of file repository.c.

jasperserver_operation_result_t* jasperserver_operation_result_new | ( |  | ) |

Instance a new operation_result.

This function initializes the operation_result.

It is responsability of the user free the memory allocated by this function using jasperserver_operation_result_free()

Returns:
  a pointer to a new operation_result

See also:
  jasperserver_operation_result_free()

Definition at line 271 of file repository.c.

void jasperserver_parameter_free | ( | void * | parameter | ) |

Free a parameter.

Free the memory allocated using jasperserver_parameter_new.

This method frees recursively all the elements of the parameter and relative lists.

Parameters:

  | parameter | The parameter to free (jasperserver_parameter_t* assumed)

See also:
  jasperserver_parameter_new()

Definition at line 264 of file repository.c.

jasperserver_parameter_t* jasperserver_parameter_new | ( |  | ) |

Instance a new parameter.

This function initializes the parameter.

It is responsability of the user free the memory allocated by this function using jasperserver_parameter_free()

Returns:
  a pointer to a new parameter

See also:
  jasperserver_parameter_free()

Definition at line 257 of file repository.c.

void jasperserver_print_parameter | ( | jasperserver_parameter_t * | rp,
|  | int | depth |
| ) |  |  |

Definition at line 424 of file repository.c.

void jasperserver_print_resource_descriptor | ( | jasperserver_resource_descriptor_t * | rd,
|  | int | depth |
| ) |  |  |

Definition at line 381 of file repository.c.

void jasperserver_print_resource_property | ( | jasperserver_resource_property_t * | rp,
|  | int | depth |
| ) |  |  |

Definition at line 409 of file repository.c.

void jasperserver_request_free | ( | jasperserver_request_t * | request | ) |

Free a request.

Free the memory allocated using jasperserver_request_new.

This method frees recursively all the elements of the request and relative lists.

Parameters:

  | request | The request to free

See also:
  jasperserver_request_new()

Definition at line 70 of file repository.c.

jasperserver_request_t* jasperserver_request_new | ( |  | ) |

Instance a new request.

This function initializes the request. The resource field is set to NULL, the operation is set to OPERATION_LIST, locale is set to "en" and arguments to NULL.

It is responsability of the user free the memory allocated by this function using jasperserver_request_free()

Returns:
  a pointer to a new request

See also:
  jasperserver_request_free()

Definition at line 49 of file repository.c.

void jasperserver_resource_descriptor_free | ( | void * | resource_descriptor | ) |

Free a resource_descriptor.

Free the memory allocated using jasperserver_resource_descriptor_new.

This method frees recursively all the elements of the resource_descriptor and relative lists.

Parameters:

  | resource_descriptor | The resource_descriptor to free (jasperserver_resource_descriptor_t * assumed)

See also:
  jasperserver_resource_descriptor_new()

Definition at line 173 of file repository.c.

jasperserver_resource_descriptor_t* jasperserver_resource_descriptor_new | ( |  | ) |

Instance a new resource_descriptor.

This function initializes the resource_descriptor.

It is responsability of the user free the memory allocated by this function using jasperserver_resource_descriptor_free()

Returns:
  a pointer to a new resource_descriptor

See also:
  jasperserver_resource_descriptor_free()

Definition at line 137 of file repository.c.

void jasperserver_resource_property_free | ( | void * | resource_property | ) |

Free a resource_property.

Free the memory allocated using jasperserver_resource_property_new.

This method frees recursively all the elements of the resource_property and relative lists.

Parameters:

  | resource_property | The resource_property to free (jasperserver_resource_property_t* assumed)

See also:
  jasperserver_resource_property_new()

Definition at line 233 of file repository.c.

jasperserver_resource_property_t* jasperserver_resource_property_new | ( |  | ) |

Instance a new resource_property.

This function initializes the resource_property.

It is responsability of the user free the memory allocated by this function using jasperserver_resource_property_free()

Returns:
  a pointer to a new resource_property

See also:
  jasperserver_resource_property_free()

Definition at line 212 of file repository.c.

void jasperserver_server_free | ( | void * | op_ptr | ) |

Definition at line 337 of file repository.c.

jasperserver_server_t* jasperserver_server_new | ( |  | ) |

Instance a new server.

This function initializes the server.

It is responsability of the user free the memory allocated by this function using jasperserver_server_free()

Returns:
  a pointer to a new server

See also:
  jasperserver_server_free()

Definition at line 316 of file repository.c.