ScriptTableExample.c 954 Bytes
#include <stdlib.h>
#include <string.h>
#include <stdio.h>

#include "CSlim/Fixtures.h"
#include "CSlim/SlimList.h"

typedef struct ConnectToDDServer2
{
	int count;
	char *user;
	char *passwd;
	char result[32];
} ConnectToDDServer2;

void* ConnectToDDServer2_Create(StatementExecutor* errorHandler, SlimList* args)
{
	ConnectToDDServer2* self = (ConnectToDDServer2*)malloc(sizeof(ConnectToDDServer2));
	memset(self, 0, sizeof(ConnectToDDServer2));
	return self;
}

void ConnectToDDServer2_Destroy(void* self)
{
	free(self);
}

static char* login(void* void_self, SlimList* args) {
	ConnectToDDServer2* self = (ConnectToDDServer2*)void_self;
	self->count++;
	return "";
}

static char* simpleTest(void* void_self, SlimList* args) {
	ConnectToDDServer2* self = (ConnectToDDServer2*)void_self;
	snprintf(self->result, 32, "%d", 0);
	return self->result;
}


SLIM_CREATE_FIXTURE(ConnectToDDServer2)
	SLIM_FUNCTION(login)
	SLIM_FUNCTION(simpleTest)
SLIM_END