Ejemplo n.º 1
0
BOOL _PLMTPC_Seek(PlayListManager manager, int trackNumber)
{
	PlayListManager_PC state = (PlayListManager_PC)manager->InternalState;
	BOOL result = FALSE;

	if(trackNumber >= state->StartingTrackNumber && trackNumber <= (state->StartingTrackNumber + state->Count - 1))
	{
		int index = trackNumber - state->StartingTrackNumber;
		if(manager->TrackMetaData != NULL)
		{
			CDS_ObjRef_Release(manager->TrackMetaData);
			manager->TrackMetaData = NULL;
		}
		String_Destroy(manager->TrackURI);
		manager->TrackURI = NULL;
		manager->TrackMetaData = state->Objects[index];
		CDS_ObjRef_Add(manager->TrackMetaData);
		manager->TrackNumber = trackNumber;
		manager->TrackURI = String_Create(manager->TrackMetaData->Res->Value);

		result = TRUE;
	}
	else
	{
		if(Browse(state, trackNumber) == TRUE)
		{
			if(manager->TrackMetaData != NULL)
			{
				CDS_ObjRef_Release(manager->TrackMetaData);
				manager->TrackMetaData = NULL;
			}
			String_Destroy(manager->TrackURI);
			manager->TrackURI = NULL;
			manager->TrackMetaData = state->Objects[0];
			CDS_ObjRef_Add(manager->TrackMetaData);
			manager->TrackNumber = trackNumber;
			manager->TrackURI = String_Create(manager->TrackMetaData->Res->Value);

			result = TRUE;
		}
		else
		{
			if(manager->TrackMetaData != NULL)
			{
				CDS_ObjRef_Release(manager->TrackMetaData);
				manager->TrackMetaData = NULL;
			}
			String_Destroy(manager->TrackURI);
			manager->TrackURI = NULL;

			result = FALSE;
		}
	}

	return result;
}
Ejemplo n.º 2
0
Commit Commit_Create(void)
{
	Commit c;
	c = (Commit)XMALLOC(sizeof(struct _Commit));
	sha_reset(c->parent0);
	sha_reset(c->parent1);
	sha_reset(c->tree);
	c->author = String_Create();
	c->message = String_Create();
	c->rawtime = 0;
	return c;
}
Ejemplo n.º 3
0
// constructor
static ESIF_INLINE void EqlCmd_ctor (EqlCmdPtr self)
{
	ASSERT(self);
	self->adapter    = String_Create();
	self->subtype    = String_Create();
	self->action     = String_Create();
	self->messages   = StringList_Create();
	self->parameters = StringList_Create();
	self->datatypes  = StringList_Create();
	self->values     = StringList_Create();
	self->options    = StringList_Create();
	self->results    = EsifDataList_Create();
	self->handler    = 0;
}
Ejemplo n.º 4
0
END_TEST

START_TEST(HtmlEncodeToAsciiShouldEncodeTheFourDangerousCharactersToNamedEntities)
{
    String str = String_Create("<This 'is & a \"test.\">", 22);
    ASSERT_STRING(String_HtmlEncodeToAscii(str), "&lt;This 'is &amp; a &quot;test.&quot;&gt;", 42);
}
Ejemplo n.º 5
0
END_TEST

START_TEST(HtmlEncodeToAsciiShouldEncodeAllNonAsciiCharacters)
{
    String str = String_Create("\xEF\xBB\xBF<\xC2\xA0\x00\x1A'\n\r&#\x7F?\"test.\">", 23);
    ASSERT_STRING(String_HtmlEncodeToAscii(str), "&#65279;&lt;&nbsp;\x00\x1A'\n\r&amp;#\x7F?&quot;test.&quot;&gt;", 52);
}
Ejemplo n.º 6
0
static bool setBranchInHEAD(const char *branchName)
{
	int fd, ch;
	bool returnValue = false;
	String s = String_Create();
	fd = open(SCM_HEAD_FILE, O_CREAT | O_TRUNC | O_WRONLY, SCM_HEAD_FILE_PERMISSION);
	if(-1 == fd)
	{
		LOG_ERROR("fatal: setBranch: open('%s') failed(%d)", SCM_HEAD_FILE, errno);
		goto EXIT;
	}
	/*Write the branch name to 'head' file*/
	String_format(s, "branch: %s", branchName);
	if(write(fd, s_getstr(s), String_strlen(s)) != String_strlen(s))
	{
		LOG_ERROR("write() failed with errno %d", errno);
		close(fd);
		goto EXIT;
	}
	/*write a new line character*/
	ch = '\n';
	ch = write(fd, &ch, 1);
	close(fd);
	returnValue = true;
EXIT:
	String_Delete(s);
	return returnValue;
}
Ejemplo n.º 7
0
Int Lexer_ParseDigit(Lexer lexer, Bool isFirstContentOnLine)
{
	const Byte *src = lexer->src;
	const Byte *start, *digitsEnd;
	Token token = lexer->token;
	UInt64 value;
	String suffix;

	START_TOKEN(src - 1);
	start = src - 1;

	// Decimal integer, or possibly a real value (if we find a '.').
	if (!ParseDecimalInteger(lexer, &value)) {
		lexer->token->text = IllegalDecimalIntegerMessage;
		return END_TOKEN(TOKEN_ERROR);
	}
	digitsEnd = src = lexer->src;
	if (src < lexer->end && *src == '.' && (src + 1 == lexer->end || src[1] != '.')) {
		// Found a '.' (and it's not part of a ".."), so rewind back and re-parse this as a real or float value.
		lexer->src = start;
		return Lexer_ParseReal(lexer, isFirstContentOnLine);
	}
	else {
		// Collected a whole octal value, so finish it.
		suffix = CollectAlphanumericSuffix(lexer);
		if (!EnsureEndOfNumber(lexer)) return END_TOKEN(TOKEN_ERROR);
		END_TOKEN(TOKEN_INTEGER32);
		return ProcessIntegerValue(lexer, value, String_Create(start, digitsEnd - start), suffix);
	}
}
Ejemplo n.º 8
0
END_TEST

START_TEST(HtmlEncodeShouldOnlyChangeTheFourDangerousCharacters)
{
    String str = String_Create("<\xA0\x00\x1A\xFF'\t\n\r&#\x7F?\"test.\">", 21);
    ASSERT_STRING(String_HtmlEncode(str), "&lt;\xA0\x00\x1A\xFF'\t\n\r&amp;#\x7F?&quot;test.&quot;&gt;", 41);
}
Ejemplo n.º 9
0
END_TEST

START_TEST(UrlQueryEncodeShouldEncodeNonAsciiCharacters)
{
    String str = String_Create("This\0is\r\na\x7F\xC2\xA0test.", 18);
    const char *expectedResult = "This%00is%0D%0Aa%7F%C2%A0test.";
    ASSERT_STRING(String_UrlQueryEncode(str), expectedResult, StrLen(expectedResult));
}
Ejemplo n.º 10
0
END_TEST

START_TEST(UrlEncodeShouldEncodeDangerousCharactersToEscapes)
{
    String str = String_Create("[(!*This ';is :@&= a +%$test,/?#)]", 34);
    const char *expectedResult = "%5B%28%21%2AThis%20%27%3Bis%20%3A%40%26%3D%20a%20%2B%25%24test%2C%2F%3F%23%29%5D";
    ASSERT_STRING(String_UrlEncode(str), expectedResult, StrLen(expectedResult));
}
Ejemplo n.º 11
0
void lua_getfield(lua_State *L, int index, const char* name)
{
    Value key;
    SetValue( &key, String_Create(L, name, strlen(name)) );
    Value* table = GetValueForIndex( L, index );
    Vm_GetTable(L, table, &key, L->stackTop, false);
    ++L->stackTop;
}
Ejemplo n.º 12
0
END_TEST

START_TEST(UrlQueryEncodeShouldEncodeOnlyAFewDangerousCharactersToEscapes)
{
    String str = String_Create("[(!*This ';is :@&= a +%$test,/?#)]", 34);
    const char *expectedResult = "[(!*This%20';is%20:@%26%3D%20a%20+%25$test,/%3F%23)]";
    ASSERT_STRING(String_UrlQueryEncode(str), expectedResult, StrLen(expectedResult));
}
Ejemplo n.º 13
0
void lua_setfield(lua_State* L, int index, const char* name)
{
    Value key;
    SetValue( &key, String_Create(L, name, strlen(name)) );

    Value* table = GetValueForIndex(L, index);
    Vm_SetTable( L, table, &key, L->stackTop - 1 );
    Pop(L, 1);
}
Ejemplo n.º 14
0
/// <summary>
/// Extract a substring from the given string that starts at the given index and continues
/// to the end of the string.
/// </summary>
/// <param name="str">The string from which a substring will be extracted.</param>
/// <param name="start">The starting offset within the string.  If this lies outside the string, it will be clipped to the string.</param>
/// <returns>The extracted (copied) substring.</returns>
String String_SubstringAt(const String str, Int start)
{
	struct StringInt *s = (struct StringInt *)str;

	if (start < 0) {
		start = 0;
	}
	if (start >= s->length)
		return String_Empty;

	return String_Create(s->text + start, s->length - start);
}
Ejemplo n.º 15
0
/* Constructor */
int PlayListManager_PC_Create(PlayListManager manager, char* uri)
{
	int i;
	int result = 0;
	PlayListManager_PC state = NULL;

	state = (PlayListManager_PC)malloc(sizeof(struct _PlayListManager_PC));
	if(state == NULL)
	{
		return result;

	}
	memset(state, 0, sizeof(struct _PlayListManager_PC));
	state->Parent = manager;
	state->UDN = NULL;
	state->ServiceID = NULL;
	state->ContainerID = NULL;
	state->FirstItemID = NULL;
	state->FirstItemIndex = -1;
	state->SortArgs = String_Create("");
	state->MaxDepth = 0;
	state->Count = 0;
	state->StartingTrackNumber = 0;
	for(i = 0; i < MAX_OBJECTS_IN_MEMORY; i++)
	{
		state->Objects[i] = NULL;
	}

	manager->InternalState = (void*)state;
	manager->Destroy = &_PLMTPC_Destroy;
	manager->Seek = &_PLMTPC_Seek;

	if(ParsePlayContainerUri(state, uri) == FALSE)
	{
		result = 0;
		return result;
	}

	sem_init(&state->LockObject, 0, 1);

	if(Browse(state, 1) == FALSE)
	{
		result = 0;
		return result;
	}

	result = 1;
	return result;
}
string_t String_Join(const char *str1, const char *str2) {
	size_t len1 = strlen(str1);
	size_t len2 = strlen(str2);
	size_t sz = len1 + len2 + 1;
	char *newBuf = calloc(sz, sizeof(char));
	if (newBuf == NULL)
	{
		return String_Create(str1);
	}
	strcpy_s(newBuf, sz, str1);
	strcat_s(newBuf, sz, str2);
	string_t s;
	s.c_str = newBuf;
	return s;
}
Ejemplo n.º 17
0
/// <summary>
/// Extract a substring from the given string that starts at the given index and continues
/// for 'length' bytes.
/// </summary>
/// <param name="str">The string from which a substring will be extracted.</param>
/// <param name="start">The starting offset within the string.  If this lies outside the string, it will be clipped to the string.</param>
/// <param name="length">The number of bytes to copy from the string.  If this lies outside the string, it will be clipped to the string.</param>
/// <returns>The extracted (copied) substring.</returns>
String String_Substring(const String str, Int start, Int length)
{
	struct StringInt *s = (struct StringInt *)str;

	if (start < 0) {
		length += start;
		start = 0;
	}
	if (start >= s->length || length <= 0)
		return String_Empty;
	if (length > s->length - start) {
		length = s->length - start;
	}

	return String_Create(s->text + start, length);
}
Ejemplo n.º 18
0
void lua_pushlstring(lua_State *L, const char* data, size_t length)
{
    String* string = String_Create(L, data, length);
    PushString(L, string);
}
Ejemplo n.º 19
0
Int Lexer_ParseZero(Lexer lexer, Bool isFirstContentOnLine)
{
	const Byte *src = lexer->src;
	const Byte *end = lexer->end;
	const Byte *start, *digitsEnd;
	Token token = lexer->token;
	Byte ch;
	UInt64 value;
	String suffix;

	START_TOKEN(src - 1);
	start = src - 1;

	if (src < end && ((ch = *src) == 'x' || ch == 'X')) {
		// Hexadecimal integer, or possibly a zero byte.
		src++;

		if (src >= end || !(((ch = *src) >= '0' && ch <= '9') || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F'))) {
			// Not an error; this is decimal zero, as a byte.
			lexer->src = src;
			if (!EnsureEndOfNumber(lexer)) {
				lexer->token->text = String_FormatString(IllegalNumericSuffixMessage, String_Format("x%c", ch));
				return END_TOKEN(TOKEN_ERROR);
			}
			END_TOKEN(TOKEN_INTEGER32);
			return ProcessIntegerValue(lexer, 0, ZeroString, LowercaseXString);
		}
		else {
			// This is a hexadecimal integer.
			lexer->src = src;
			if (!ParseHexadecimalInteger(lexer, &value)) {
				lexer->token->text = IllegalHexadecimalIntegerMessage;
				return END_TOKEN(TOKEN_ERROR);
			}
			digitsEnd = src = lexer->src;
			suffix = CollectAlphanumericSuffix(lexer);
			if (!EnsureEndOfNumber(lexer)) {
				lexer->token->text = String_FormatString(IllegalNumericSuffixMessage, String_Format("%c", *lexer->src));
				return END_TOKEN(TOKEN_ERROR);
			}
			END_TOKEN(TOKEN_INTEGER32);
			return ProcessIntegerValue(lexer, value, String_Create(start, digitsEnd - start), suffix);
		}
	}
	else {
		// Octal integer, or possibly a real value (if we find a '.').
		if (!ParseOctalInteger(lexer, &value)) {
			lexer->token->text = IllegalOctalIntegerMessage;
			return END_TOKEN(TOKEN_ERROR);
		}
		digitsEnd = src = lexer->src;
		if (src < lexer->end && *src == '.' && (src+1 >= lexer->end || src[1] != '.')) {
			// Found a '.' (and it's not part of a ".."), so rewind back and re-parse this as a real or float value.
			lexer->src = start;
			return Lexer_ParseReal(lexer, isFirstContentOnLine);
		}
		else {
			// Collected a whole octal value, so finish it.
			suffix = CollectAlphanumericSuffix(lexer);
			if (!EnsureEndOfNumber(lexer)) {
				lexer->token->text = String_FormatString(IllegalNumericSuffixMessage, String_Format("%c", *lexer->src));
				return END_TOKEN(TOKEN_ERROR);
			}
			END_TOKEN(TOKEN_INTEGER32);
			return ProcessIntegerValue(lexer, value, String_Create(start, digitsEnd - start), suffix);
		}
	}
}
Ejemplo n.º 20
0
bool Commit_WriteCommitFile(Commit c, ShaBuffer commitSha)
{
	uint32_t fd, temp, dummy;
	bool returnValue = false;
	String s = String_Create();

	c->rawtime = time(NULL);
	String_format(s, "%s:%s:%s:%u", c->tree, c->parent0, c->parent1, (uint32_t)c->rawtime);

	sha_buffer((const unsigned char *)s_getstr(s), String_strlen(s), commitSha);
	String_format(s,"%s/%s", SCM_COMMIT_FOLDER, commitSha);
	if(true == isItFile(s_getstr(s)))
	{
		LOG_ERROR("fatal Commit_WriteCommitFile() commit '%s' already exist", commitSha);
		abort();
	}
	fd = open(s_getstr(s), O_CREAT | O_TRUNC | O_WRONLY, SCM_OBJECT_FILE_PERMISSION);
	if(fd < 0)
	{
		LOG_ERROR("Commit_WriteCommitFile() open('%s') failed(%d)", s_getstr(s), errno);
		goto EXIT;
	}

	/*Write the object identification Code..*/
	temp = htonl(OBJECT_COMMIT_FILE);
	dummy = write(fd, &temp, INT_SIZE);

	/*time */
	temp = htonl(c->rawtime);
	dummy = write(fd, &temp, INT_SIZE);

	/*size of tree SHA*/
	temp = htonl(strlen((char*)c->tree)+1);
	dummy = write(fd, &temp, INT_SIZE);
	dummy = write(fd, c->tree, ntohl(temp));

	/*size of parent0*/
	temp = htonl(strlen((char*)c->parent0)+1);
	dummy = write(fd, &temp, INT_SIZE);
	dummy = write(fd, c->parent0, ntohl(temp));

	/*size of parent1*/
	temp = htonl(strlen((char*)c->parent1)+1);
	dummy = write(fd, &temp, INT_SIZE);
	dummy = write(fd, c->parent1, ntohl(temp));

	/*length of author*/
	temp = htonl(String_strlen(c->author)+1);
	dummy = write(fd, &temp, INT_SIZE);
	dummy = write(fd, s_getstr(c->author), ntohl(temp));

	/*length of message*/
	temp = htonl(String_strlen(c->message)+1);
	dummy = write(fd, &temp, INT_SIZE);
	dummy = write(fd, s_getstr(c->message), ntohl(temp));
	returnValue = true;
	close(fd);
EXIT:
	String_Delete(s);
	return returnValue;
}
Ejemplo n.º 21
0
bool Commit_ReadCommitFile(Commit c, const ShaBuffer commitSha)
{
	String s = String_Create();
	bool returnValue = false;
	uint32_t fd, len = strlen((char*)commitSha), temp, dummy;
	if(len != SHA_HASH_LENGTH)
	{
		LOG_ERROR("Commit_ReadCommitFile() shaLength %d != %d", len, SHA_HASH_LENGTH);
		goto EXIT;
	}

	String_format(s,"%s/%s", SCM_COMMIT_FOLDER, commitSha);
	if(false == isItFile(s_getstr(s)))
	{
		LOG_ERROR("fatal Commit_ReadCommitFile() commit '%s' doesn't exist", commitSha);
		goto EXIT;
	}
	fd = open(s_getstr(s), O_RDONLY);


	/*read the object identification Code and check it*/
	dummy = read(fd, &temp, INT_SIZE);
	temp = ntohl(temp);
	if(temp != OBJECT_COMMIT_FILE)
	{
		LOG_ERROR("Commit_ReadCommitFile: '%s' not a commit file", commitSha);
		close(fd);
		goto EXIT;
	}

	/*read the time*/
	dummy = read(fd, &temp, INT_SIZE);
	c->rawtime = ntohl(temp);

	/*read the tree Sha*/
	dummy = read(fd, &temp, INT_SIZE);
	temp = ntohl(temp);
	dummy = read(fd, c->tree, temp);

	/*read parent0*/
	dummy = read(fd, &temp, INT_SIZE);
	temp = ntohl(temp);
	dummy = read(fd, c->parent0, temp);

	/*read parent1*/
	dummy = read(fd, &temp, INT_SIZE);
	temp = ntohl(temp);
	dummy = read(fd, c->parent1, temp);

	/*read the author name and EmailId*/
	dummy = read(fd, &temp, INT_SIZE);
	temp = ntohl(temp);
	String_SetSize(c->author,temp+10);
	dummy = read(fd, (void*)s_getstr(c->author), temp);

	/*read the message*/
	dummy = read(fd, &temp, INT_SIZE);
	temp = ntohl(temp);
	String_SetSize(c->message,temp+10);
	dummy = read(fd, (void*)s_getstr(c->message), temp);

	returnValue = true;
	close(fd);
EXIT:
	String_Delete(s);
	return returnValue;
}
Ejemplo n.º 22
0
int cmd_init(int argc, char *argv[])
{
	int i;
	String s;
	char *folders[] = { SCM_FOLDER,
						SCM_BRANCH_FOLDER,
						SCM_OBJECTS_FOLDER,
						SCM_BLOB_FOLDER,
						SCM_COMMIT_FOLDER,
						SCM_TREE_FOLDER,
						SCM_TEMP_FOLDER};
	const int size = sizeof(folders)/sizeof(folders[0]);

	if(true == isItFolder(".scm"))
	{
		LOG_ERROR("fatal: delete the .scm folder then try again");
		return 1;
	}

	/*create all the folders*/
	for(i = 0; i < size; i++)
	{
		if(0 !=	mkdir(folders[i], SCM_FOLDER_PERMISSION))
		{
			LOG_ERROR("fatal: mkdir('%s') failed(%d)", folders[i], errno);
			return 1;
		}
	}

	s = String_Create();
	String_format(s, "%s/%s", SCM_BRANCH_FOLDER, SCM_DEFAULT_BRANCH);
	/*Create the branch folder*/
	if(0 != mkdir(s_getstr(s), SCM_FOLDER_PERMISSION))
	{
		LOG_ERROR("mkdir('%s') failed(%d)", s_getstr(s), errno);
		String_Delete(s);
		return 1;
	}

	String_format(s, "%s/%s/%s", SCM_BRANCH_FOLDER, SCM_DEFAULT_BRANCH, SCM_BRANCH_CACHE_FOLDER);
	/*Create the branch folder*/
	if(0 != mkdir(s_getstr(s), SCM_FOLDER_PERMISSION))
	{
		LOG_ERROR("mkdir('%s') failed(%d)", s_getstr(s), errno);
		String_Delete(s);
		return 1;
	}
	/*set the branch name in 'HEAD' file*/
	setBranchInHEAD(SCM_DEFAULT_BRANCH);

	String_format(s, "%s/%s/%s", SCM_BRANCH_FOLDER, SCM_DEFAULT_BRANCH, SCM_INDEX_FILENAME);
	/*Create a empty index file*/
	if(false == CreateFirstIndexFile(s_getstr(s)))
	{
		LOG_INFO("CreateEmptyIndexFile() failed()");
	}

	String_format(s, "%s/%s/%s", SCM_BRANCH_FOLDER, SCM_DEFAULT_BRANCH, SCM_COMMIT_FILENAME);
	createEmptyCommitFile(s_getstr(s));
	String_Delete(s);
	return 0;
}
Ejemplo n.º 23
0
APW_Error call_method_through_thread_pool(APW instance, contex_method_call method)
{
    APWInternalState state;
    BOOL contextSwitch = FALSE;
    APW_Error err = check_this(instance);
    if (err != APW_ERROR_OK) {
        return err;
    }
    state = (APWInternalState)instance->internal_state;
    contextSwitch = TESTMASK(state->EventsOnThreadBitMask, method->method);
    switch (method->method) {
    case APW_ECS_GETAVPROTOCOLINFO:
        break;
    case APW_ECS_SETAVTRANSPORTURI:
        if (instance->Event_SetAVTransportURI != NULL && method->param_count == 2) {
            method->params[0] = (methods_param)(void *)String_Create((const char*)method->params[0]);
            method->params[1] = (methods_param)(void *)String_Create((const char*)method->params[1]);
        }
        break;
    case APW_ECS_STOP:
        break;
    case APW_ECS_PLAY:
        if (instance->Event_Play != NULL && method->param_count == 1) {
            method->params[0] = (methods_param)(void *)String_Create((const char *)method->params[0]);
        }
        break;
    case APW_ECS_PAUSE:
        break;
    case APW_ECS_SEEKTRACK:
        break;
    case APW_ECS_SEEKTRACKTIME:
        break;
    case APW_ECS_SEEKMEDIATIME:
        break;
    case APW_ECS_NEXT:
        break;
    case APW_ECS_PREVIOUS:
        break;
    case APW_ECS_SETPLAYMODE:
        break;
    case APW_ECS_SELECTPRESET:
        if (instance->Event_SelectPreset != NULL && method->param_count == 1) {
            method->params[0] = (methods_param)(void *)String_Create((const char *)method->params[0]);
        }
        break;
    case APW_ECS_SETBRIGHTNESS:
        break;
    case APW_ECS_SETCONTRAST:
        break;
    case APW_ECS_SETVOLUME:
        break;
    case APW_ECS_SETMUTE:
        break;
    default:
        return APW_ERROR_INVALIDARGUMENT;
    }

    ILibWebServer_AddRef((struct ILibWebServer_Session *)method->session);
    if (contextSwitch == TRUE) {
        ILibThreadPool_QueueUserWorkItem(instance->thread_pool, (void *)method, &callback_from_thread_pool);
    } else {
        callback_from_thread_pool(NULL, (void *)method);
    }

    return APW_ERROR_OK;
}
Ejemplo n.º 24
0
//Prototypes
Suite *util_suite (void);


/******************************************************************************
 ***** Maps:
 ******************************************************************************/
/*Specialize Mapt, to show that it can be specialized, 
 * then run tests on specialization */
typedef Map StringMap;
typedef Map_Element StringMapItr;

void StringMap_Add(StringMap *this, char *key, char *value){
  Map_Element *me;
  me = malloc(sizeof(Map_Element));
  me->id = String_Create(key);
  me->contents = String_Create(value);
  Map_Add(this,me);
}

char *StringMap_Get(StringMap *this, char *key){
  Map_Element *me = Map_Get(this,key);
  return (char *)me->contents;
}

/*void StringMap_Delete(StringMap *this, char *key){
  Map_Element *me = Map_Get(this,key);
  Map_Delete(this, me);
  }*/

StringMapItr *StringMap_GetItrAt(StringMap *this, char *key){