#include "header.h"
Go to the source code of this file.
Functions | |
struct SN_env * | SN_create_env (int S_size, int I_size, int B_size) |
void | SN_close_env (struct SN_env *z, int S_size) |
int | SN_set_current (struct SN_env *z, int size, const symbol *s) |
void SN_close_env | ( | struct SN_env * | z, | |
int | S_size | |||
) |
Definition at line 40 of file api.c.
References SN_env::B, free, SN_env::I, i, lose_s(), NULL, SN_env::p, and SN_env::S.
Referenced by danish_ISO_8859_1_close_env(), danish_UTF_8_close_env(), dutch_ISO_8859_1_close_env(), dutch_UTF_8_close_env(), english_ISO_8859_1_close_env(), english_UTF_8_close_env(), finnish_ISO_8859_1_close_env(), finnish_UTF_8_close_env(), french_ISO_8859_1_close_env(), french_UTF_8_close_env(), german_ISO_8859_1_close_env(), german_UTF_8_close_env(), hungarian_ISO_8859_1_close_env(), hungarian_UTF_8_close_env(), italian_ISO_8859_1_close_env(), italian_UTF_8_close_env(), norwegian_ISO_8859_1_close_env(), norwegian_UTF_8_close_env(), porter_ISO_8859_1_close_env(), porter_UTF_8_close_env(), portuguese_ISO_8859_1_close_env(), portuguese_UTF_8_close_env(), romanian_ISO_8859_2_close_env(), romanian_UTF_8_close_env(), russian_KOI8_R_close_env(), russian_UTF_8_close_env(), SN_create_env(), spanish_ISO_8859_1_close_env(), spanish_UTF_8_close_env(), swedish_ISO_8859_1_close_env(), swedish_UTF_8_close_env(), and turkish_UTF_8_close_env().
struct SN_env* SN_create_env | ( | int | S_size, | |
int | I_size, | |||
int | B_size | |||
) | [read] |
Definition at line 3 of file api.c.
References SN_env::B, calloc, create_s(), error(), SN_env::I, i, NULL, SN_env::p, SN_env::S, and SN_close_env().
Referenced by danish_ISO_8859_1_create_env(), danish_UTF_8_create_env(), dutch_ISO_8859_1_create_env(), dutch_UTF_8_create_env(), english_ISO_8859_1_create_env(), english_UTF_8_create_env(), finnish_ISO_8859_1_create_env(), finnish_UTF_8_create_env(), french_ISO_8859_1_create_env(), french_UTF_8_create_env(), german_ISO_8859_1_create_env(), german_UTF_8_create_env(), hungarian_ISO_8859_1_create_env(), hungarian_UTF_8_create_env(), italian_ISO_8859_1_create_env(), italian_UTF_8_create_env(), norwegian_ISO_8859_1_create_env(), norwegian_UTF_8_create_env(), porter_ISO_8859_1_create_env(), porter_UTF_8_create_env(), portuguese_ISO_8859_1_create_env(), portuguese_UTF_8_create_env(), romanian_ISO_8859_2_create_env(), romanian_UTF_8_create_env(), russian_KOI8_R_create_env(), russian_UTF_8_create_env(), spanish_ISO_8859_1_create_env(), spanish_UTF_8_create_env(), swedish_ISO_8859_1_create_env(), swedish_UTF_8_create_env(), and turkish_UTF_8_create_env().
{ struct SN_env * z = (struct SN_env *) calloc(1, sizeof(struct SN_env)); if (z == NULL) return NULL; z->p = create_s(); if (z->p == NULL) goto error; if (S_size) { int i; z->S = (symbol * *) calloc(S_size, sizeof(symbol *)); if (z->S == NULL) goto error; for (i = 0; i < S_size; i++) { z->S[i] = create_s(); if (z->S[i] == NULL) goto error; } } if (I_size) { z->I = (int *) calloc(I_size, sizeof(int)); if (z->I == NULL) goto error; } if (B_size) { z->B = (unsigned char *) calloc(B_size, sizeof(unsigned char)); if (z->B == NULL) goto error; } return z; error: SN_close_env(z, S_size); return NULL; }