/*
 * Copyright (c) 2004-2005 Endace Technology Ltd, Hamilton, New Zealand.
 * All rights reserved.
 *
 * This source code is proprietary to Endace Technology Limited and no part
 * of it may be redistributed, published or disclosed except as outlined in
 * the written contract supplied with this product.
 *
 * $Id: cmd.c 1091 2005-02-09 03:19:21Z koryn $
 */

#include <stdlib.h>
#include <string.h>
#include "cmd.h"
#include "dagrandom.h"

cmd_t * cmdNew (int type, distribution_t * distr, void * ptr, distribution_t * snap) {
	cmd_t * aux;

	aux = (cmd_t *) malloc (sizeof(cmd_t));
	aux->type = type;
	aux->distr = distr;
	aux->ptr = ptr;
	aux->snap = snap;
	
	return aux;
}

group_t * groupNew (char * id, list_t * commands) {
	group_t * aux;

	aux = (group_t *) malloc (sizeof(group_t));
	aux->id = (char *) malloc (strlen(id)+1);
	strcpy (aux->id, id);
	aux->commands = commands;

	return aux;
}

