Пример #1
0
/* ************************************************** */
int hadas_init(void) {
    if ((mem_hadas = mem_fs_slice_declare(sizeof(hadas_t))) == NULL) {
        return -1;
    }

    if ((mem_hadas_elts = mem_fs_slice_declare(sizeof(hadas_elt_t))) == NULL) {
        return -1;
    }

    return 0;
}
Пример #2
0
/* ************************************************** */
int spadas_init(void) {

    if (das_init() == -1) {
        return -1;
    } 

    if ((mem_spadas = mem_fs_slice_declare(sizeof(spadas_t))) == NULL) {
        return -1;
    }

    if ((mem_spadas_elts = mem_fs_slice_declare(sizeof(spadas_elt_t))) == NULL) {
        return -1;
    }

    return 0;
}
Пример #3
0
/* ************************************************** */
int sodas_init(void) {
    if ((mem_sodas = mem_fs_slice_declare(sizeof(sodas_t))) == NULL) {
        return -1;
    }
    
    return 0;
}
Пример #4
0
int rng_init(void) {
    if ((mem_rng = mem_fs_slice_declare(sizeof(uniform_args_t))) == NULL) {
        return -1;
    }
    rngs = hadas_create(rng_hash, rng_equal);
    create_rng(default_rng_type, default_rng_seed);
    return 0;
}
/* ************************************************** */
static int worldsens_init(void) {
    wsens_srv_init();

    if ((mem_ws_rdv = mem_fs_slice_declare(sizeof(ws_rdv_t))) == NULL) {
        return -1;
    }

    if ((ws_rdvs = sodas_create(worldsens_compare)) == NULL) {
        return -1;
    }

    return 0;
}
/* ************************************************** */
int scheduler_init(void) {
    if (sodas_init() == -1) {
        return -1;
    } 

    if ((mem_event = mem_fs_slice_declare(sizeof(event_t))) == NULL) {
        return -1;
    }

    if ((scheduler = sodas_create(scheduler_compare)) == NULL) {
        return -1;
    }

    worldsens_init();

    return 0;
}