~evarlast/ubuntu/utopic/mongodb/upstart-workaround-debian-bug-718702

« back to all changes in this revision

Viewing changes to src/third_party/libstemmer_c/runtime/api.c

  • Committer: Package Import Robot
  • Author(s): James Page, James Page, Robie Basak
  • Date: 2013-05-29 17:44:42 UTC
  • mfrom: (44.1.7 sid)
  • Revision ID: package-import@ubuntu.com-20130529174442-z0a4qmoww4y0t458
Tags: 1:2.4.3-1ubuntu1
[ James Page ]
* Merge from Debian unstable, remaining changes:
  - Enable SSL support:
    + d/control: Add libssl-dev to BD's.
    + d/rules: Enabled --ssl option.
    + d/mongodb.conf: Add example SSL configuration options.
  - d/mongodb-server.mongodb.upstart: Add upstart configuration.
  - d/rules: Don't strip binaries during scons build for Ubuntu.
  - d/control: Add armhf to target archs.
  - d/p/SConscript.client.patch: fixup install of client libraries.
  - d/p/0010-install-libs-to-usr-lib-not-usr-lib64-Closes-588557.patch:
    Install libraries to lib not lib64.
* Dropped changes:
  - d/p/arm-support.patch: Included in Debian.
  - d/p/double-alignment.patch: Included in Debian.
  - d/rules,control: Debian also builds with avaliable system libraries
    now.
* Fix FTBFS due to gcc and boost upgrades in saucy:
  - d/p/0008-ignore-unused-local-typedefs.patch: Add -Wno-unused-typedefs
    to unbreak building with g++-4.8.
  - d/p/0009-boost-1.53.patch: Fixup signed/unsigned casting issue.

[ Robie Basak ]
* d/p/0011-Use-a-signed-char-to-store-BSONType-enumerations.patch: Fixup
  build failure on ARM due to missing signed'ness of char cast.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#include <stdlib.h> /* for calloc, free */
 
3
#include "header.h"
 
4
 
 
5
extern struct SN_env * SN_create_env(int S_size, int I_size, int B_size)
 
6
{
 
7
    struct SN_env * z = (struct SN_env *) calloc(1, sizeof(struct SN_env));
 
8
    if (z == NULL) return NULL;
 
9
    z->p = create_s();
 
10
    if (z->p == NULL) goto error;
 
11
    if (S_size)
 
12
    {
 
13
        int i;
 
14
        z->S = (symbol * *) calloc(S_size, sizeof(symbol *));
 
15
        if (z->S == NULL) goto error;
 
16
 
 
17
        for (i = 0; i < S_size; i++)
 
18
        {
 
19
            z->S[i] = create_s();
 
20
            if (z->S[i] == NULL) goto error;
 
21
        }
 
22
    }
 
23
 
 
24
    if (I_size)
 
25
    {
 
26
        z->I = (int *) calloc(I_size, sizeof(int));
 
27
        if (z->I == NULL) goto error;
 
28
    }
 
29
 
 
30
    if (B_size)
 
31
    {
 
32
        z->B = (unsigned char *) calloc(B_size, sizeof(unsigned char));
 
33
        if (z->B == NULL) goto error;
 
34
    }
 
35
 
 
36
    return z;
 
37
error:
 
38
    SN_close_env(z, S_size);
 
39
    return NULL;
 
40
}
 
41
 
 
42
extern void SN_close_env(struct SN_env * z, int S_size)
 
43
{
 
44
    if (z == NULL) return;
 
45
    if (S_size)
 
46
    {
 
47
        int i;
 
48
        for (i = 0; i < S_size; i++)
 
49
        {
 
50
            lose_s(z->S[i]);
 
51
        }
 
52
        free(z->S);
 
53
    }
 
54
    free(z->I);
 
55
    free(z->B);
 
56
    if (z->p) lose_s(z->p);
 
57
    free(z);
 
58
}
 
59
 
 
60
extern int SN_set_current(struct SN_env * z, int size, const symbol * s)
 
61
{
 
62
    int err = replace_s(z, 0, z->l, size, s, NULL);
 
63
    z->c = 0;
 
64
    return err;
 
65
}
 
66