Esempio n. 1
0
/*************************************************************************************************
 * ssi_register_handler
 *
 * Registers a function to be called when "keyword" is parsed by the http-server. This handler-
 * function has to provide the HTML or JavaScript text which is inserted after the keyword tag.
 *
 * Example for keyword tag in HTML: <!--#registry_content--> (where "registry_content" is the keyword)
 *
 * @param keyword, max length: 20 characters including "\0" termination, case sensitive!
 * @param function_pointer
 */
void ssi_register_handler(const char *keyword, ssi_handler function_pointer)
{
	if (strlen(keyword) > SSI_KEYWORD_MAX_LENGTH)
	{
		log_report(UECU_LOG_ERROR, module_name, "tag %s too long, truncated", keyword);
	}

	/* Make tag array bigger to fit the new keyword
	 * Note: see here http://stackoverflow.com/questions/5935933/dynamically-create-an-array-of-strings-with-malloc
	 */
	tags = pvPortRealloc(tags, (number_of_tags + 1) * sizeof(char *));

	if (tags != NULL)
	{
		tags[number_of_tags] = keyword;
	}

	handlers = pvPortRealloc(handlers, (number_of_tags + 1) * sizeof(handlers));

	if (handlers != NULL)
	{
		handlers[number_of_tags] = function_pointer;
	}

	number_of_tags++;
}
Esempio n. 2
0
void* realloc(void* ptr, size_t size) {
  void* res = (void*) pvPortRealloc(ptr, size);
  if (res == NULL) {
    v7_gc(v7, 1);
    res = (void*) pvPortRealloc(ptr, size);
  }
  return res;
}
Esempio n. 3
0
void *realloc(void *ptr, size_t nbytes)
{
	return pvPortRealloc(ptr, nbytes, mem_debug_file, 0);
}
Esempio n. 4
0
static inline void *realloc(void *p, size_t s) { return pvPortRealloc(p, s, "", 0); }