/mnt/hgfs/jamie_On_My_Mac/store/version_control/svn/integralive/library/trunk/src/model.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <curl/curl.h>
#include <curl/types.h>
#include <curl/easy.h>
#include "cJSON.h"
#include "JSON_checker.h"
#include "Integra/integra_model.h"
#include "debug.h"

Data Structures

struct  _t_memory_chunk

Defines

#define LOGIN_HANDLER   "login_handler"

Typedefs

typedef struct _t_memory_chunk t_memory_chunk

Functions

int get_valuestr (char *valuestr)
void licenses_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void default_values_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void attributes_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void module_attributes_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void softwares_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void definitions_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void legal_values_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void attribute_units_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void control_attributes_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void attribute_scales_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void implementation_dependencys_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void attribute_types_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void tags_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void value_labels_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void attribute_scopes_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void databases_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void targets_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void control_classs_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void definition_tags_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void uris_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
void implementations_get_json (t_memory_chunk *chunk, struct curl_slist *headers, const char *document_url)
int get_id_max (cJSON *items, int n_items)
void free_chunk_memory (t_memory_chunk *chunk)
void authenticate (char *login_url)
void validate_json (const char *test_string, size_t len)
void licenses_populate (cJSON *json, ntg_license ***licenses, int *n_items, int *n_allocated)
void default_values_populate (cJSON *json, ntg_default_value ***default_values, int *n_items, int *n_allocated)
void attributes_populate (cJSON *json, ntg_attribute ***attributes, int *n_items, int *n_allocated)
void module_attributes_populate (cJSON *json, ntg_module_attribute ***module_attributes, int *n_items, int *n_allocated)
void softwares_populate (cJSON *json, ntg_software ***softwares, int *n_items, int *n_allocated)
void definitions_populate (cJSON *json, ntg_definition ***definitions, int *n_items, int *n_allocated)
void legal_values_populate (cJSON *json, ntg_legal_value ***legal_values, int *n_items, int *n_allocated)
void attribute_units_populate (cJSON *json, ntg_attribute_unit ***attribute_units, int *n_items, int *n_allocated)
void control_attributes_populate (cJSON *json, ntg_control_attribute ***control_attributes, int *n_items, int *n_allocated)
void attribute_scales_populate (cJSON *json, ntg_attribute_scale ***attribute_scales, int *n_items, int *n_allocated)
void implementation_dependencys_populate (cJSON *json, ntg_implementation_dependency ***implementation_dependencys, int *n_items, int *n_allocated)
void attribute_types_populate (cJSON *json, ntg_attribute_type ***attribute_types, int *n_items, int *n_allocated)
void tags_populate (cJSON *json, ntg_tag ***tags, int *n_items, int *n_allocated)
void value_labels_populate (cJSON *json, ntg_value_label ***value_labels, int *n_items, int *n_allocated)
void attribute_scopes_populate (cJSON *json, ntg_attribute_scope ***attribute_scopes, int *n_items, int *n_allocated)
void databases_populate (cJSON *json, ntg_database ***databases, int *n_items, int *n_allocated)
void targets_populate (cJSON *json, ntg_target ***targets, int *n_items, int *n_allocated)
void control_classs_populate (cJSON *json, ntg_control_class ***control_classs, int *n_items, int *n_allocated)
void definition_tags_populate (cJSON *json, ntg_definition_tag ***definition_tags, int *n_items, int *n_allocated)
void uris_populate (cJSON *json, ntg_uri ***uris, int *n_items, int *n_allocated)
void implementations_populate (cJSON *json, ntg_implementation ***implementations, int *n_items, int *n_allocated)
int ntg_populate (char *base_url, ntg_model *model)

Define Documentation

#define LOGIN_HANDLER   "login_handler"

Referenced by ntg_populate().


Typedef Documentation


Function Documentation

void attribute_scales_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void attribute_scales_populate ( cJSON json,
ntg_attribute_scale ***  attribute_scales,
int *  n_items,
int *  n_allocated 
)
void attribute_scopes_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void attribute_scopes_populate ( cJSON json,
ntg_attribute_scope ***  attribute_scopes,
int *  n_items,
int *  n_allocated 
)
void attribute_types_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void attribute_types_populate ( cJSON json,
ntg_attribute_type ***  attribute_types,
int *  n_items,
int *  n_allocated 
)
void attribute_units_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void attribute_units_populate ( cJSON json,
ntg_attribute_unit ***  attribute_units,
int *  n_items,
int *  n_allocated 
)
void attributes_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void attributes_populate ( cJSON json,
ntg_attribute ***  attributes,
int *  n_items,
int *  n_allocated 
)
void authenticate ( char *  login_url  ) 

Referenced by ntg_populate().

void control_attributes_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void control_attributes_populate ( cJSON json,
ntg_control_attribute ***  control_attributes,
int *  n_items,
int *  n_allocated 
)
void control_classs_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void control_classs_populate ( cJSON json,
ntg_control_class ***  control_classs,
int *  n_items,
int *  n_allocated 
)
void databases_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void databases_populate ( cJSON json,
ntg_database ***  databases,
int *  n_items,
int *  n_allocated 
)
void default_values_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void default_values_populate ( cJSON json,
ntg_default_value ***  default_values,
int *  n_items,
int *  n_allocated 
)
void definition_tags_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void definition_tags_populate ( cJSON json,
ntg_definition_tag ***  definition_tags,
int *  n_items,
int *  n_allocated 
)
void definitions_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void definitions_populate ( cJSON json,
ntg_definition ***  definitions,
int *  n_items,
int *  n_allocated 
)
void free_chunk_memory ( t_memory_chunk chunk  ) 
int get_id_max ( cJSON items,
int  n_items 
)
int get_valuestr ( char *  valuestr  ) 
void implementation_dependencys_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void implementation_dependencys_populate ( cJSON json,
ntg_implementation_dependency ***  implementation_dependencys,
int *  n_items,
int *  n_allocated 
)
void implementations_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void implementations_populate ( cJSON json,
ntg_implementation ***  implementations,
int *  n_items,
int *  n_allocated 
)
void legal_values_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void legal_values_populate ( cJSON json,
ntg_legal_value ***  legal_values,
int *  n_items,
int *  n_allocated 
)
void licenses_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void licenses_populate ( cJSON json,
ntg_license ***  licenses,
int *  n_items,
int *  n_allocated 
)
void module_attributes_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void module_attributes_populate ( cJSON json,
ntg_module_attribute ***  module_attributes,
int *  n_items,
int *  n_allocated 
)
int ntg_populate ( char *  base_url,
ntg_model model 
)

References _ntg_model::allocated_attribute_scales, _ntg_model::allocated_attribute_scopes, _ntg_model::allocated_attribute_types, _ntg_model::allocated_attribute_units, _ntg_model::allocated_attributes, _ntg_model::allocated_control_attributes, _ntg_model::allocated_control_classs, _ntg_model::allocated_databases, _ntg_model::allocated_default_values, _ntg_model::allocated_definition_tags, _ntg_model::allocated_definitions, _ntg_model::allocated_implementation_dependencys, _ntg_model::allocated_implementations, _ntg_model::allocated_legal_values, _ntg_model::allocated_licenses, _ntg_model::allocated_module_attributes, _ntg_model::allocated_softwares, _ntg_model::allocated_tags, _ntg_model::allocated_targets, _ntg_model::allocated_uris, _ntg_model::allocated_value_labels, _ntg_model::attribute_scales, attribute_scales_get_json(), attribute_scales_populate(), _ntg_model::attribute_scopes, attribute_scopes_get_json(), attribute_scopes_populate(), _ntg_model::attribute_types, attribute_types_get_json(), attribute_types_populate(), _ntg_model::attribute_units, attribute_units_get_json(), attribute_units_populate(), _ntg_model::attributes, attributes_get_json(), attributes_populate(), authenticate(), cJSON_Delete(), cJSON_Parse(), _ntg_model::control_attributes, control_attributes_get_json(), control_attributes_populate(), _ntg_model::control_classs, control_classs_get_json(), control_classs_populate(), _ntg_model::databases, databases_get_json(), databases_populate(), _ntg_model::default_values, default_values_get_json(), default_values_populate(), _ntg_model::definition_tags, definition_tags_get_json(), definition_tags_populate(), _ntg_model::definitions, definitions_get_json(), definitions_populate(), free_chunk_memory(), _ntg_model::implementation_dependencys, implementation_dependencys_get_json(), implementation_dependencys_populate(), _ntg_model::implementations, implementations_get_json(), implementations_populate(), _ntg_model::legal_values, legal_values_get_json(), legal_values_populate(), _ntg_model::licenses, licenses_get_json(), licenses_populate(), LOGIN_HANDLER, _t_memory_chunk::memory, _ntg_model::module_attributes, module_attributes_get_json(), module_attributes_populate(), _ntg_model::n_attribute_scales, _ntg_model::n_attribute_scopes, _ntg_model::n_attribute_types, _ntg_model::n_attribute_units, _ntg_model::n_attributes, _ntg_model::n_control_attributes, _ntg_model::n_control_classs, _ntg_model::n_databases, _ntg_model::n_default_values, _ntg_model::n_definition_tags, _ntg_model::n_definitions, _ntg_model::n_implementation_dependencys, _ntg_model::n_implementations, _ntg_model::n_legal_values, _ntg_model::n_licenses, _ntg_model::n_module_attributes, _ntg_model::n_softwares, _ntg_model::n_tags, _ntg_model::n_targets, _ntg_model::n_uris, _ntg_model::n_value_labels, _t_memory_chunk::size, _ntg_model::softwares, softwares_get_json(), softwares_populate(), _ntg_model::tags, tags_get_json(), tags_populate(), _ntg_model::targets, targets_get_json(), targets_populate(), _ntg_model::uris, uris_get_json(), uris_populate(), validate_json(), _ntg_model::value_labels, value_labels_get_json(), and value_labels_populate().

Referenced by ntg_server_new().

void softwares_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void softwares_populate ( cJSON json,
ntg_software ***  softwares,
int *  n_items,
int *  n_allocated 
)
void tags_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void tags_populate ( cJSON json,
ntg_tag ***  tags,
int *  n_items,
int *  n_allocated 
)
void targets_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void targets_populate ( cJSON json,
ntg_target ***  targets,
int *  n_items,
int *  n_allocated 
)
void uris_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void uris_populate ( cJSON json,
ntg_uri ***  uris,
int *  n_items,
int *  n_allocated 
)
void validate_json ( const char *  test_string,
size_t  len 
)
void value_labels_get_json ( t_memory_chunk chunk,
struct curl_slist *  headers,
const char *  document_url 
)

References DB_MODEL, and DEBUG_POST().

Referenced by ntg_populate().

void value_labels_populate ( cJSON json,
ntg_value_label ***  value_labels,
int *  n_items,
int *  n_allocated 
)

Generated on Tue Jan 5 14:02:29 2010 for LibIntegra by  doxygen 1.6.1