1
2 /*
3 * (c) Oleg Puchinin March 2012
4 * graycardinalster@gmail.com
5 *
6 */
7
8 #include <head.h>
9
bug_longmacro()10 void bug_longmacro ()
11 {
12 printf ("Too big macro."
13 "If your macro have more than 300 lines, please "
14 "contact <graycardinal@pisem.net>\n"
15 "Program stopped.\n");
16
17 exit (0);
18 }
19
bug_nosuch_tag(char * f_name)20 void bug_nosuch_tag (char * f_name)
21 {
22 printf ("Tag \"%s\" not found. Broken \"tags\" file ? "
23 "Try \"silent-bob --make-ctags\".\n", f_name);
24 }
25
bug_nocalltags()26 void bug_nocalltags ()
27 {
28 printf ("File \"call_tags\" not found. "
29 "Try \"silent-bob --call-tags [-L] <files>\"\n");
30 exit (1);
31 }
32
bug_system()33 void bug_system ()
34 {
35 printf ("Can't make tags file. Maybe you do not have write permissions ?\n");
36 exit (1);
37 }
38
bug_fork()39 void bug_fork ()
40 {
41 perror ("fork");
42 exit (1);
43 }
44
bug_plugin(char * name)45 void bug_plugin (char *name)
46 {
47 fprintf (stderr, "Can't load plugin (%s)\n", name);
48 }
49
bug_notsupported()50 void bug_notsupported ()
51 {
52 printf ("SilentBob (or language plugin)"
53 " don't support this feature !\n");
54 }
55
bob_tag(char * d_str,char * d_name,d_tag_t * d_tag)56 bool bob_tag (char *d_str, char * d_name, d_tag_t * d_tag)
57 {
58 char m_buf[256];
59 char *d_file;
60 char *S;
61
62 strcpy (m_buf, d_str);
63 d_str = m_buf;
64
65 strncpy (d_tag->d_name, d_name, 255);
66 d_tag->d_name[255] = 0;
67 S = strchr (d_str, '\t');
68 if (! S)
69 return false;
70
71 S++;
72 d_file = S;
73 S = strchr (d_file, '\t');
74 if (! S)
75 return false;
76
77 *S = 0;
78 strncpy (d_tag->d_file, d_file, 255);
79 d_tag->d_file[255] = 0;
80
81 S++;
82
83 if (if_digit (S))
84 d_tag->d_line = atoi (S);
85 else
86 return false;
87
88 return true;
89 }
90
91