/* Collection of code snippets by Arne Vajhøj */
/* (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

#include "data.h"

int add(int a, int b);
char *conc(char *a, char *b);
struct data *modify(struct data *o);

int c_add(int a, int b, int *c)
{
    *c = add(a, b);
    return 1;
}

int c_conc(char *a, char *b, char *c)
{
    char *temp = conc(a, b); 
    strcpy(c, temp);
    free(temp);
    return 1;
}

int c_modify(struct data *o, struct data *o2)
{
    struct data *temp = modify(o);
    memcpy(o2, temp, sizeof(struct data));
    free(temp);
    return 1;
}

