~ubuntu-branches/ubuntu/raring/geany/raring-proposed

« back to all changes in this revision

Viewing changes to tagmanager/options.c

  • Committer: Bazaar Package Importer
  • Author(s): Damián Viano
  • Date: 2008-05-02 11:37:45 UTC
  • mto: (3.1.1 lenny) (1.3.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: james.westby@ubuntu.com-20080502113745-7q62rqhl2ku02ptu
Import upstream version 0.14

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
#include "options.h"
25
25
#include "parse.h"
26
26
 
 
27
#include <glib.h>
27
28
 
28
29
#define CTAGS_ENVIRONMENT       "CTAGS"
29
30
 
150
151
    return FALSE;
151
152
}
152
153
 
 
154
/* tags_ignore is a NULL-terminated array of strings, read from ~/.geany/ignore.tags.
 
155
 * This file contains a space or newline separated list of symbols which should be ignored
 
156
 * by the C/C++ parser, see -I command line option of ctags for details. */
 
157
gchar **c_tags_ignore = NULL;
153
158
 
154
159
/*  Determines whether or not "name" should be ignored, per the ignore list.
155
160
 */
157
162
                              boolean *const pIgnoreParens,
158
163
                              const char **const replacement)
159
164
{
160
 
    return FALSE;
 
165
        boolean result = FALSE;
 
166
 
 
167
        if (c_tags_ignore != NULL)
 
168
        {
 
169
                const size_t nameLen = strlen (name);
 
170
                unsigned int i;
 
171
                guint len = g_strv_length (c_tags_ignore);
 
172
 
 
173
                if (pIgnoreParens != NULL)
 
174
                        *pIgnoreParens = FALSE;
 
175
 
 
176
                for (i = 0  ;  i < len ;  ++i)
 
177
                {
 
178
                        vString *token = vStringNewInit (c_tags_ignore[i]);
 
179
 
 
180
                        if (strncmp (vStringValue (token), name, nameLen) == 0)
 
181
                        {
 
182
                                const size_t tokenLen = vStringLength (token);
 
183
 
 
184
                                if (nameLen == tokenLen)
 
185
                                {
 
186
                                        result = TRUE;
 
187
                                        break;
 
188
                                }
 
189
                                else if (tokenLen == nameLen + 1  &&
 
190
                                                vStringChar (token, tokenLen - 1) == '+')
 
191
                                {
 
192
                                        result = TRUE;
 
193
                                        if (pIgnoreParens != NULL)
 
194
                                                *pIgnoreParens = TRUE;
 
195
                                        break;
 
196
                                }
 
197
                                else if (vStringChar (token, nameLen) == '=')
 
198
                                {
 
199
                                        if (replacement != NULL)
 
200
                                                *replacement = vStringValue (token) + nameLen + 1;
 
201
                                        break;
 
202
                                }
 
203
                        }
 
204
                        vStringDelete (token);
 
205
                }
 
206
        }
 
207
        return result;
161
208
}
162
209
 
163
210
void addIgnoreListFromFile (const char *const fileName)