Set up current working directory on File->Open
[gscope.git] / backend-proto.h
blob79fb738d81a30227548367ea2a856db3aad7c88f
1 /*
2 * (c) 2010 Cyrill Gorcunov, gorcunov@gmail.com
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or (at
7 * your option) any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
20 #ifndef BACKEND_PROTO_H
21 #define BACKEND_PROTO_H
23 #include "list.h"
25 enum backend_protocols {
26 BACKEND_PROTO_NONE,
28 BACKEND_PROTO_CSCOPE,
29 BACKEND_PROTO_ID_UTILS,
30 BACKEND_PROTO_CTAGS,
32 BACKEND_PROTO_MAX
35 struct backend_proto_item {
36 unsigned long key;
37 char *func;
38 char *file;
39 char *text;
40 unsigned long line;
43 struct backend_proto_query_params {
44 union {
45 struct {
46 char *name;
47 int type;
48 int nocase;
49 } cscope;
50 struct {
51 char *name;
52 } idutils;
53 struct {
54 char *name;
55 } ctags;
56 } u;
59 struct backend_proto {
60 enum backend_protocols protocol;
61 const char *protocol_name;
62 struct list_head * (*backend_proto_query)(struct backend_proto_query_params *params);
63 int (*backend_proto_get)(struct list_head *entry, struct backend_proto_item *item);
64 int (*backend_proto_lookup)(struct list_head *head, struct backend_proto_item *item, unsigned long key);
65 void (*backend_proto_destory)(struct list_head *head);
66 void (*backend_proto_refresh)(void);
69 struct backend_proto *backend_proto_register(struct backend_proto *proto);
70 void backend_proto_unregister(struct backend_proto *proto);
71 struct backend_proto *backend_proto_find(enum backend_protocols proto);
73 #endif /* BACKEND_PROTO_H */