/* 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 <stdlib.h>
#include <string.h>

#include "data.h"
#include "CWrap.h"

int main()
{
    c_init_jvm();
    c_load_classes();
    int v1 = 123;
    int v2 = 456;
    int v3 = c_add(v1, v2);
    printf("%d + %d = %d\n", v1, v2, v3);
    char *s1 = "ABC";
    char *s2 = "DEF";
    char *s3 = c_conc(s1, s2);
    printf("%s + %s = %s\n", s1, s2, s3);
    struct data o;
    o.iv = 123;
    strcpy(o.sv, "ABC");
    printf("iv=%d sv=%s\n", o.iv, o.sv);
    struct data *o2 = c_modify(&o);
    printf("iv=%d sv=%s\n", o2->iv, o2->sv);
    c_destroy_jvm();
    return 0;
}

