blob: 5364d7948c5d1f9c768664a72f821b43665a8eff [file] [log] [blame]
Steve Naroff2b8ee6c2009-09-01 15:55:40 +00001/* c-index-test.c */
Steve Naroff50398192009-08-28 15:28:48 +00002
3#include "clang-c/Index.h"
Douglas Gregor0c8296d2009-11-07 00:00:49 +00004#include <stdlib.h>
Steve Naroff89922f82009-08-31 00:59:03 +00005#include <stdio.h>
Steve Naroffaf08ddc2009-09-03 15:49:00 +00006#include <string.h>
7
Ted Kremenek0d435192009-11-17 18:13:31 +00008/******************************************************************************/
9/* Utility functions. */
10/******************************************************************************/
11
John Thompson2e06fc82009-10-27 13:42:56 +000012#ifdef _MSC_VER
13char *basename(const char* path)
14{
15 char* base1 = (char*)strrchr(path, '/');
16 char* base2 = (char*)strrchr(path, '\\');
17 if (base1 && base2)
18 return((base1 > base2) ? base1 + 1 : base2 + 1);
19 else if (base1)
20 return(base1 + 1);
21 else if (base2)
22 return(base2 + 1);
23
24 return((char*)path);
25}
26#else
Steve Naroffff9e18c2009-09-24 20:03:06 +000027extern char *basename(const char *);
John Thompson2e06fc82009-10-27 13:42:56 +000028#endif
Steve Naroffff9e18c2009-09-24 20:03:06 +000029
Ted Kremenek1c6da172009-11-17 19:37:36 +000030static unsigned CreateTranslationUnit(CXIndex Idx, const char *file,
31 CXTranslationUnit *TU) {
32
33 *TU = clang_createTranslationUnit(Idx, file);
34 if (!TU) {
35 fprintf(stderr, "Unable to load translation unit from '%s'!\n", file);
36 return 0;
37 }
38 return 1;
39}
40
Ted Kremenek0d435192009-11-17 18:13:31 +000041/******************************************************************************/
42/* Pretty-printing. */
43/******************************************************************************/
44
Steve Naroffaf08ddc2009-09-03 15:49:00 +000045static void PrintCursor(CXCursor Cursor) {
Steve Naroff77128dd2009-09-15 20:25:34 +000046 if (clang_isInvalid(Cursor.kind))
Ted Kremenek1c6da172009-11-17 19:37:36 +000047 printf("Invalid Cursor => %s", clang_getCursorKindSpelling(Cursor.kind));
Steve Naroff699a07d2009-09-25 21:32:34 +000048 else {
Eric Christopherf393c3b2009-10-05 21:33:42 +000049 CXDecl DeclReferenced;
Steve Naroffef0cef62009-11-09 17:45:52 +000050 CXString string;
51 string = clang_getCursorSpelling(Cursor);
Steve Naroffff9e18c2009-09-24 20:03:06 +000052 printf("%s=%s", clang_getCursorKindSpelling(Cursor.kind),
Steve Naroffef0cef62009-11-09 17:45:52 +000053 clang_getCString(string));
54 clang_disposeString(string);
Eric Christopherf393c3b2009-10-05 21:33:42 +000055 DeclReferenced = clang_getCursorDecl(Cursor);
Steve Naroff85e2db72009-10-01 00:31:07 +000056 if (DeclReferenced)
57 printf(":%d:%d", clang_getDeclLine(DeclReferenced),
58 clang_getDeclColumn(DeclReferenced));
Steve Naroff699a07d2009-09-25 21:32:34 +000059 }
Steve Naroffaf08ddc2009-09-03 15:49:00 +000060}
Steve Naroff89922f82009-08-31 00:59:03 +000061
Ted Kremenek9298cfc2009-11-17 05:31:58 +000062static const char* GetCursorSource(CXCursor Cursor) {
63 const char *source = clang_getCursorSource(Cursor);
64 if (!source)
65 return "<invalid loc>";
66 return basename(source);
67}
68
Ted Kremenek0d435192009-11-17 18:13:31 +000069/******************************************************************************/
70/* Logic for testing clang_loadTranslationUnit(). */
71/******************************************************************************/
72
Daniel Dunbar625e4ef2009-12-01 02:35:37 +000073static void DeclVisitor(CXDecl Dcl, CXCursor Cursor, CXClientData Filter) {
Daniel Dunbarbce6f622009-09-03 05:59:50 +000074 if (!Filter || (Cursor.kind == *(enum CXCursorKind *)Filter)) {
Steve Naroffef0cef62009-11-09 17:45:52 +000075 CXString string;
Ted Kremenek9298cfc2009-11-17 05:31:58 +000076 printf("// CHECK: %s:%d:%d: ", GetCursorSource(Cursor),
Steve Naroffff9e18c2009-09-24 20:03:06 +000077 clang_getCursorLine(Cursor),
78 clang_getCursorColumn(Cursor));
Steve Naroffaf08ddc2009-09-03 15:49:00 +000079 PrintCursor(Cursor);
Steve Naroffef0cef62009-11-09 17:45:52 +000080 string = clang_getDeclSpelling(Dcl);
81 printf(" [Context=%s]\n", clang_getCString(string));
82 clang_disposeString(string);
Daniel Dunbarbce6f622009-09-03 05:59:50 +000083 }
Steve Naroffc857ea42009-09-02 13:28:54 +000084}
Daniel Dunbar625e4ef2009-12-01 02:35:37 +000085
Steve Naroffc857ea42009-09-02 13:28:54 +000086static void TranslationUnitVisitor(CXTranslationUnit Unit, CXCursor Cursor,
Daniel Dunbar625e4ef2009-12-01 02:35:37 +000087 CXClientData Filter) {
Steve Naroffc857ea42009-09-02 13:28:54 +000088 if (!Filter || (Cursor.kind == *(enum CXCursorKind *)Filter)) {
Steve Naroffef0cef62009-11-09 17:45:52 +000089 CXString string;
Ted Kremenek9298cfc2009-11-17 05:31:58 +000090 printf("// CHECK: %s:%d:%d: ", GetCursorSource(Cursor),
Steve Naroffff9e18c2009-09-24 20:03:06 +000091 clang_getCursorLine(Cursor),
92 clang_getCursorColumn(Cursor));
Steve Naroffaf08ddc2009-09-03 15:49:00 +000093 PrintCursor(Cursor);
Steve Naroffef0cef62009-11-09 17:45:52 +000094 string = clang_getTranslationUnitSpelling(Unit);
95 printf(" [Context=%s]\n",
96 basename(clang_getCString(string)));
97 clang_disposeString(string);
Steve Naroffff9e18c2009-09-24 20:03:06 +000098
99 clang_loadDeclaration(Cursor.decl, DeclVisitor, 0);
Steve Naroff2d4d6292009-08-31 14:26:51 +0000100 }
Steve Naroff89922f82009-08-31 00:59:03 +0000101}
Steve Naroff50398192009-08-28 15:28:48 +0000102
Daniel Dunbar625e4ef2009-12-01 02:35:37 +0000103static void FunctionScanVisitor(CXTranslationUnit Unit, CXCursor Cursor,
104 CXClientData Filter) {
105 const char *startBuf, *endBuf;
106 unsigned startLine, startColumn, endLine, endColumn, curLine, curColumn;
107 CXCursor Ref;
108
109 if (Cursor.kind != CXCursor_FunctionDefn)
110 return;
111
112 clang_getDefinitionSpellingAndExtent(Cursor, &startBuf, &endBuf,
113 &startLine, &startColumn,
114 &endLine, &endColumn);
115 /* Probe the entire body, looking for both decls and refs. */
116 curLine = startLine;
117 curColumn = startColumn;
118
119 while (startBuf < endBuf) {
120 if (*startBuf == '\n') {
121 startBuf++;
122 curLine++;
123 curColumn = 1;
124 } else if (*startBuf != '\t')
125 curColumn++;
126
127 Ref = clang_getCursor(Unit, clang_getCursorSource(Cursor),
128 curLine, curColumn);
129 if (Ref.kind == CXCursor_NoDeclFound) {
130 /* Nothing found here; that's fine. */
131 } else if (Ref.kind != CXCursor_FunctionDecl) {
132 CXString string;
133 printf("// CHECK: %s:%d:%d: ", GetCursorSource(Ref),
134 curLine, curColumn);
135 PrintCursor(Ref);
136 string = clang_getDeclSpelling(Ref.decl);
137 printf(" [Context:%s]\n", clang_getCString(string));
138 clang_disposeString(string);
139 }
140 startBuf++;
141 }
142}
143
144static int perform_test_load(CXIndex Idx, CXTranslationUnit TU,
145 const char *filter) {
Ted Kremenek0d435192009-11-17 18:13:31 +0000146 enum CXCursorKind K = CXCursor_NotImplemented;
Daniel Dunbar625e4ef2009-12-01 02:35:37 +0000147 CXTranslationUnitIterator Visitor = TranslationUnitVisitor;
Ted Kremenek0d435192009-11-17 18:13:31 +0000148 enum CXCursorKind *ck = &K;
Daniel Dunbar625e4ef2009-12-01 02:35:37 +0000149
Ted Kremenek0d435192009-11-17 18:13:31 +0000150 /* Perform some simple filtering. */
151 if (!strcmp(filter, "all") || !strcmp(filter, "local")) ck = NULL;
152 else if (!strcmp(filter, "category")) K = CXCursor_ObjCCategoryDecl;
153 else if (!strcmp(filter, "interface")) K = CXCursor_ObjCInterfaceDecl;
154 else if (!strcmp(filter, "protocol")) K = CXCursor_ObjCProtocolDecl;
155 else if (!strcmp(filter, "function")) K = CXCursor_FunctionDecl;
156 else if (!strcmp(filter, "typedef")) K = CXCursor_TypedefDecl;
Daniel Dunbar625e4ef2009-12-01 02:35:37 +0000157 else if (!strcmp(filter, "scan-function")) Visitor = FunctionScanVisitor;
Ted Kremenek0d435192009-11-17 18:13:31 +0000158 else {
159 fprintf(stderr, "Unknown filter for -test-load-tu: %s\n", filter);
160 return 1;
161 }
162
Daniel Dunbar625e4ef2009-12-01 02:35:37 +0000163 clang_loadTranslationUnit(TU, Visitor, ck);
Ted Kremenek0d435192009-11-17 18:13:31 +0000164 clang_disposeTranslationUnit(TU);
165 return 0;
166}
167
Daniel Dunbar625e4ef2009-12-01 02:35:37 +0000168int perform_test_load_tu(const char *file, const char *filter) {
169 CXIndex Idx;
170 CXTranslationUnit TU;
171 Idx = clang_createIndex(/* excludeDeclsFromPCH */
172 !strcmp(filter, "local") ? 1 : 0,
173 /* displayDiagnostics */ 1);
174
175 if (!CreateTranslationUnit(Idx, file, &TU))
176 return 1;
177
178 return perform_test_load(Idx, TU, filter);
179}
180
Daniel Dunbarada487d2009-12-01 02:03:10 +0000181int perform_test_load_source(int argc, const char **argv, const char *filter) {
182 CXIndex Idx;
183 CXTranslationUnit TU;
Daniel Dunbarada487d2009-12-01 02:03:10 +0000184 Idx = clang_createIndex(/* excludeDeclsFromPCH */
185 !strcmp(filter, "local") ? 1 : 0,
186 /* displayDiagnostics */ 1);
187
188 TU = clang_createTranslationUnitFromSourceFile(Idx, 0, argc, argv);
189 if (!TU) {
190 fprintf(stderr, "Unable to load translation unit!\n");
191 return 1;
192 }
193
Daniel Dunbar625e4ef2009-12-01 02:35:37 +0000194 return perform_test_load(Idx, TU, filter);
Daniel Dunbarada487d2009-12-01 02:03:10 +0000195}
196
Ted Kremenek0d435192009-11-17 18:13:31 +0000197/******************************************************************************/
Ted Kremenek1c6da172009-11-17 19:37:36 +0000198/* Logic for testing clang_getCursor(). */
199/******************************************************************************/
200
201static void print_cursor_file_scan(CXCursor cursor,
202 unsigned start_line, unsigned start_col,
Ted Kremenek1d5fdf32009-11-18 02:02:52 +0000203 unsigned end_line, unsigned end_col,
204 const char *prefix) {
205 printf("// CHECK");
206 if (prefix)
207 printf("-%s", prefix);
208 printf("{start_line=%d start_col=%d end_line=%d end_col=%d} ",
209 start_line, start_col, end_line, end_col);
Ted Kremenek1c6da172009-11-17 19:37:36 +0000210 PrintCursor(cursor);
211 printf("\n");
212}
213
Ted Kremenek1d5fdf32009-11-18 02:02:52 +0000214static int perform_file_scan(const char *ast_file, const char *source_file,
215 const char *prefix) {
Ted Kremenek1c6da172009-11-17 19:37:36 +0000216 CXIndex Idx;
217 CXTranslationUnit TU;
218 FILE *fp;
219 unsigned line;
220 CXCursor prevCursor;
221 unsigned printed;
222 unsigned start_line, start_col, last_line, last_col;
223 size_t i;
224
225 if (!(Idx = clang_createIndex(/* excludeDeclsFromPCH */ 1,
226 /* displayDiagnostics */ 1))) {
227 fprintf(stderr, "Could not create Index\n");
228 return 1;
229 }
230
231 if (!CreateTranslationUnit(Idx, ast_file, &TU))
232 return 1;
233
234 if ((fp = fopen(source_file, "r")) == NULL) {
235 fprintf(stderr, "Could not open '%s'\n", source_file);
236 return 1;
237 }
238
239 line = 0;
240 prevCursor = clang_getNullCursor();
241 printed = 0;
242 start_line = last_line = 1;
243 start_col = last_col = 1;
244
245 while (!feof(fp)) {
Benjamin Kramera9933b92009-11-17 20:51:40 +0000246 size_t len = 0;
247 int c;
248
249 while ((c = fgetc(fp)) != EOF) {
250 len++;
251 if (c == '\n')
252 break;
253 }
254
Ted Kremenek1c6da172009-11-17 19:37:36 +0000255 ++line;
256
257 for (i = 0; i < len ; ++i) {
258 CXCursor cursor;
259 cursor = clang_getCursor(TU, source_file, line, i+1);
260
261 if (!clang_equalCursors(cursor, prevCursor) &&
262 prevCursor.kind != CXCursor_InvalidFile) {
263 print_cursor_file_scan(prevCursor, start_line, start_col,
Ted Kremenek1d5fdf32009-11-18 02:02:52 +0000264 last_line, last_col, prefix);
Ted Kremenek1c6da172009-11-17 19:37:36 +0000265 printed = 1;
266 start_line = line;
267 start_col = (unsigned) i+1;
268 }
269 else {
270 printed = 0;
271 }
272
273 prevCursor = cursor;
274 last_line = line;
275 last_col = (unsigned) i+1;
276 }
277 }
278
279 if (!printed && prevCursor.kind != CXCursor_InvalidFile) {
280 print_cursor_file_scan(prevCursor, start_line, start_col,
Ted Kremenek1d5fdf32009-11-18 02:02:52 +0000281 last_line, last_col, prefix);
Ted Kremenek1c6da172009-11-17 19:37:36 +0000282 }
283
284 fclose(fp);
285 return 0;
286}
287
288/******************************************************************************/
Ted Kremenek0d435192009-11-17 18:13:31 +0000289/* Logic for testing clang_codeComplete(). */
290/******************************************************************************/
291
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000292/* Parse file:line:column from the input string. Returns 0 on success, non-zero
293 on failure. If successful, the pointer *filename will contain newly-allocated
294 memory (that will be owned by the caller) to store the file name. */
295int parse_file_line_column(const char *input, char **filename, unsigned *line,
296 unsigned *column) {
Douglas Gregor88d23952009-11-09 18:19:57 +0000297 /* Find the second colon. */
298 const char *second_colon = strrchr(input, ':'), *first_colon;
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000299 char *endptr = 0;
Douglas Gregor88d23952009-11-09 18:19:57 +0000300 if (!second_colon || second_colon == input) {
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000301 fprintf(stderr, "could not parse filename:line:column in '%s'\n", input);
302 return 1;
303 }
304
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000305 /* Parse the column number. */
Douglas Gregor88d23952009-11-09 18:19:57 +0000306 *column = strtol(second_colon + 1, &endptr, 10);
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000307 if (*endptr != 0) {
308 fprintf(stderr, "could not parse column in '%s'\n", input);
Douglas Gregor88d23952009-11-09 18:19:57 +0000309 return 1;
310 }
311
312 /* Find the first colon. */
313 first_colon = second_colon - 1;
314 while (first_colon != input && *first_colon != ':')
315 --first_colon;
316 if (first_colon == input) {
317 fprintf(stderr, "could not parse line in '%s'\n", input);
318 return 1;
319 }
320
321 /* Parse the line number. */
322 *line = strtol(first_colon + 1, &endptr, 10);
323 if (*endptr != ':') {
324 fprintf(stderr, "could not parse line in '%s'\n", input);
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000325 return 1;
326 }
327
Douglas Gregor88d23952009-11-09 18:19:57 +0000328 /* Copy the file name. */
329 *filename = (char*)malloc(first_colon - input + 1);
330 memcpy(*filename, input, first_colon - input);
331 (*filename)[first_colon - input] = 0;
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000332 return 0;
333}
334
335const char *
336clang_getCompletionChunkKindSpelling(enum CXCompletionChunkKind Kind) {
337 switch (Kind) {
338 case CXCompletionChunk_Optional: return "Optional";
339 case CXCompletionChunk_TypedText: return "TypedText";
340 case CXCompletionChunk_Text: return "Text";
341 case CXCompletionChunk_Placeholder: return "Placeholder";
342 case CXCompletionChunk_Informative: return "Informative";
343 case CXCompletionChunk_CurrentParameter: return "CurrentParameter";
344 case CXCompletionChunk_LeftParen: return "LeftParen";
345 case CXCompletionChunk_RightParen: return "RightParen";
346 case CXCompletionChunk_LeftBracket: return "LeftBracket";
347 case CXCompletionChunk_RightBracket: return "RightBracket";
348 case CXCompletionChunk_LeftBrace: return "LeftBrace";
349 case CXCompletionChunk_RightBrace: return "RightBrace";
350 case CXCompletionChunk_LeftAngle: return "LeftAngle";
351 case CXCompletionChunk_RightAngle: return "RightAngle";
352 case CXCompletionChunk_Comma: return "Comma";
353 }
354
355 return "Unknown";
356}
357
Douglas Gregor3ac73852009-11-09 16:04:45 +0000358void print_completion_string(CXCompletionString completion_string, FILE *file) {
Daniel Dunbarf8297f12009-11-07 18:34:24 +0000359 int I, N;
Douglas Gregor3ac73852009-11-09 16:04:45 +0000360
361 N = clang_getNumCompletionChunks(completion_string);
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000362 for (I = 0; I != N; ++I) {
Douglas Gregord5a20892009-11-09 17:05:28 +0000363 const char *text = 0;
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000364 enum CXCompletionChunkKind Kind
Douglas Gregor3ac73852009-11-09 16:04:45 +0000365 = clang_getCompletionChunkKind(completion_string, I);
366
367 if (Kind == CXCompletionChunk_Optional) {
368 fprintf(file, "{Optional ");
369 print_completion_string(
370 clang_getCompletionChunkCompletionString(completion_string, I),
371 file);
372 fprintf(file, "}");
373 continue;
374 }
375
Douglas Gregord5a20892009-11-09 17:05:28 +0000376 text = clang_getCompletionChunkText(completion_string, I);
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000377 fprintf(file, "{%s %s}",
378 clang_getCompletionChunkKindSpelling(Kind),
379 text? text : "");
380 }
Douglas Gregor3ac73852009-11-09 16:04:45 +0000381}
382
383void print_completion_result(CXCompletionResult *completion_result,
384 CXClientData client_data) {
385 FILE *file = (FILE *)client_data;
386 fprintf(file, "%s:",
387 clang_getCursorKindSpelling(completion_result->CursorKind));
388 print_completion_string(completion_result->CompletionString, file);
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000389 fprintf(file, "\n");
390}
391
Ted Kremenekf5d9c932009-11-17 18:09:14 +0000392int perform_code_completion(int argc, const char **argv) {
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000393 const char *input = argv[1];
394 char *filename = 0;
395 unsigned line;
396 unsigned column;
Daniel Dunbarf8297f12009-11-07 18:34:24 +0000397 CXIndex CIdx;
Ted Kremenekf5d9c932009-11-17 18:09:14 +0000398 int errorCode;
Daniel Dunbarf8297f12009-11-07 18:34:24 +0000399
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000400 input += strlen("-code-completion-at=");
Ted Kremenekf5d9c932009-11-17 18:09:14 +0000401 if ((errorCode = parse_file_line_column(input, &filename, &line, &column)))
402 return errorCode;
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000403
Daniel Dunbarf8297f12009-11-07 18:34:24 +0000404 CIdx = clang_createIndex(0, 0);
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000405 clang_codeComplete(CIdx, argv[argc - 1], argc - 3, argv + 2,
406 filename, line, column, &print_completion_result, stdout);
407 clang_disposeIndex(CIdx);
408 free(filename);
Ted Kremenekf5d9c932009-11-17 18:09:14 +0000409
410 return 0;
Douglas Gregor0c8296d2009-11-07 00:00:49 +0000411}
412
Ted Kremenek0d435192009-11-17 18:13:31 +0000413/******************************************************************************/
414/* Command line processing. */
415/******************************************************************************/
Ted Kremenekf5d9c932009-11-17 18:09:14 +0000416
417static void print_usage(void) {
418 fprintf(stderr,
Ted Kremenek0d435192009-11-17 18:13:31 +0000419 "usage: c-index-test -code-completion-at=<site> <compiler arguments>\n"
Ted Kremenek1d5fdf32009-11-18 02:02:52 +0000420 " c-index-test -test-file-scan <AST file> <source file> "
421 "[FileCheck prefix]\n"
Ted Kremenek0d435192009-11-17 18:13:31 +0000422 " c-index-test -test-load-tu <AST file> <symbol filter>\n\n"
Daniel Dunbarada487d2009-12-01 02:03:10 +0000423 " c-index-test -test-load-source <symbol filter> {<args>}*\n\n"
424 " <symbol filter> options for -test-load-tu and -test-load-source:\n%s",
Ted Kremenek0d435192009-11-17 18:13:31 +0000425 " all - load all symbols, including those from PCH\n"
426 " local - load all symbols except those in PCH\n"
427 " category - only load ObjC categories (non-PCH)\n"
428 " interface - only load ObjC interfaces (non-PCH)\n"
429 " protocol - only load ObjC protocols (non-PCH)\n"
430 " function - only load functions (non-PCH)\n"
Daniel Dunbar625e4ef2009-12-01 02:35:37 +0000431 " typedef - only load typdefs (non-PCH)\n"
432 " scan-function - scan function bodies (non-PCH)\n\n");
Ted Kremenekf5d9c932009-11-17 18:09:14 +0000433}
434
435int main(int argc, const char **argv) {
436 if (argc > 2 && strstr(argv[1], "-code-completion-at=") == argv[1])
437 return perform_code_completion(argc, argv);
438 if (argc == 4 && strcmp(argv[1], "-test-load-tu") == 0)
439 return perform_test_load_tu(argv[2], argv[3]);
Daniel Dunbarada487d2009-12-01 02:03:10 +0000440 if (argc >= 4 && strcmp(argv[1], "-test-load-source") == 0)
441 return perform_test_load_source(argc - 3, argv + 3, argv[2]);
Ted Kremenek1d5fdf32009-11-18 02:02:52 +0000442 if (argc >= 4 && strcmp(argv[1], "-test-file-scan") == 0)
443 return perform_file_scan(argv[2], argv[3],
444 argc >= 5 ? argv[4] : 0);
Ted Kremenekf5d9c932009-11-17 18:09:14 +0000445
446 print_usage();
447 return 1;
Steve Naroff50398192009-08-28 15:28:48 +0000448}