Beispiel #1
0
struct SN_env *
SN_create_env(int S_size, int I_size, int B_size)
{
	struct SN_env *z = (struct SN_env *) calloc(1, sizeof(struct SN_env));
	struct SN_env *z2 = z;

	if (!z)
		return z;

	z->p = create_s();
	if (!z->p)
		z = NULL;

	if (z && S_size)
	{
		if ((z->S = (symbol * *) calloc(S_size, sizeof(symbol *))))
		{
			int			i;

			for (i = 0; i < S_size; i++)
			{
				if (!(z->S[i] = create_s()))
				{
					z = NULL;
					break;
				}
			}
			z2->S_size = i;
		}
		else
			z = NULL;
	}

	if (z && I_size)
	{
		z->I = (int *) calloc(I_size, sizeof(int));
		if (z->I)
			z->I_size = I_size;
		else
			z = NULL;
	}

	if (z && B_size)
	{
		z->B = (symbol *) calloc(B_size, sizeof(symbol));
		if (z->B)
			z->B_size = B_size;
		else
			z = NULL;
	}

	if (!z)
		SN_close_env(z2);

	return z;
}
Beispiel #2
0
extern struct SN_env * SN_create_env(int S_size, int I_size, int B_size)
{
    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;
}
extern void indonesian_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z, 0); }
extern void porter_UTF_8_close_env(struct SN_env * z) { SN_close_env(z); }
Beispiel #5
0
extern void dutch_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }
extern void norwegian_UTF_8_close_env(struct SN_env * z) { SN_close_env(z); }
extern void indonesian_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }
extern void french_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z); }
extern void english_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z); }
extern void hungarian_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z, 0); }
Beispiel #11
0
extern void french_close_env(struct SN_env * z) { SN_close_env(z); }
extern void numeric_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }
extern void H_close_env(struct SN_env * z) {
    SN_close_env(z, 0);
}
Beispiel #14
0
extern void hungarian_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }
Beispiel #15
0
extern void swedish_close_env(struct SN_env * z) { SN_close_env(z); }
extern void italian_close_env(struct SN_env * z) { SN_close_env(z); }
extern void spanish_UTF_8_close_env(struct SN_env * z) { SN_close_env(z); }
extern void portuguese_close_env(struct SN_env * z) { SN_close_env(z); }
Beispiel #19
0
extern void russian_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 0); }
extern void finnish_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z, 1); }
extern void portuguese_ISO_8859_1_close_env(struct SN_env * z) {
    SN_close_env(z);
}
Beispiel #22
0
extern void finnish_UTF_8_close_env(struct SN_env * z) { SN_close_env(z, 1); }
extern void russian_KOI8_R_close_env(struct SN_env * z) { SN_close_env(z); }
extern void german_ISO_8859_1_close_env(struct SN_env * z) { SN_close_env(z); }