#ifndef STRDIV_DEF
 #define STRDIV_DEF

#include  "string.h"

#define  STR_NONE  "none"


/*
If res == STR_NONE, memory must not be cleared.
Else - must.
*/
char* GetParamFromStr(char *source, char *s)
{
	if (source[strlen(source)-1] != ';') 
		return STR_NONE;

	size_t newsize = strlen(s)+1;
	char* find = (char*) malloc(newsize+1);
	strcpy(find, s);
	find[newsize-1] = ' ';
	find[newsize] = '\0';

	char *tmp = strstr (source, find) + strlen (find);
	int size = strchr(tmp, ';') - tmp;
	char *res = (char*) malloc (size+1);
	strncpy(res, tmp, size);
	res[size] = '\0';

	free(find);

	if (res == NULL) 
		return STR_NONE;

	return res;
}


#endif