2
GNOME Commander - A GNOME based file manager
3
Copyright (C) 2001-2006 Marcus Bjurman
4
Copyright (C) 2007-2009 Piotr Eljasiak
6
This program is free software; you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation; either version 2 of the License, or
9
(at your option) any later version.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
24
RCS file: /cvsroot/gcmd/gnome-commander/src/main.c,v
33
gnome-commander: 1.1.1
34
keyword substitution: kv
35
total revisions: 17; selected revisions: 17
37
----------------------------
39
date: 2003/01/30 02:42:59; author: opum; state: Exp; lines: +2 -0
41
Added automatic download of remove files when opening them or viewing them
45
branches:[:alnum:]*; {
47
sscanf (yytext+9,"%s", tmp);
48
printf ("BranchesTEST: %s\n", tmp);
56
%option prefix="parser"
57
%option outfile="parser.c"
64
#include <sys/param.h> // for NAME_MAX
67
static Revision *rev = NULL;
68
static Revision *rev_new ();
69
static LogHistory *log = NULL;
79
fprintf (stderr, "LEX: Creating revision\n");
80
sscanf (yytext+14,"%s", tmp);
83
rev->number = g_strdup (tmp);
84
log->revisions = g_list_append (log->revisions, rev);
85
log->rev_names = g_list_append (log->rev_names, rev->number);
86
g_hash_table_insert (log->rev_map, rev->number, rev);
90
gchar d[16], t[16], a[64], s[32], l1[8], l2[8];
92
fprintf (stderr, "LEX: Creating date\n");
93
sscanf (yytext, "date: %s %s author: %s state: %s lines: %s %s",
96
g_strdelimit (t, ";", '\0');
97
g_strdelimit (a, ";", '\0');
98
g_strdelimit (s, ";", '\0');
100
rev->date = g_strdup_printf ("%s %s", d, t);
101
rev->author = g_strdup (a);
102
rev->state = g_strdup (s);
103
rev->lines = g_strdup_printf ("%s %s", l1, l2);
108
fprintf (stderr, "LEX: Found message1\n");
110
rev->message = g_strdup (yytext);
113
^.*\n=========================== {
114
fprintf (stderr, "LEX: Found message2\n");
116
rev->message = g_strdup (yytext);
123
static Revision *rev_new ()
125
return g_new0 (Revision, 1);
129
static void rev_free (Revision *rev)
133
g_free (rev->number);
135
g_free (rev->author);
138
g_free (rev->message);
144
static LogHistory *log_new ()
146
LogHistory *log = g_new (LogHistory, 1);
147
log->revisions = NULL;
148
log->rev_names = NULL;
149
log->rev_map = g_hash_table_new (g_str_hash, g_str_equal);
154
void log_free (LogHistory *log)
157
for (revs = log->revisions; revs; revs = revs->next)
159
Revision *rev = (Revision *) revs->data;
165
LogHistory *log_create (CvsPlugin *plugin, const gchar *fname)
170
log->fname = g_strdup (fname);
171
log->plugin = plugin;
172
cmd = g_strdup_printf ("cvs -z%d log %s",
173
plugin->compression_level,
176
yyin = popen (cmd, "r");
177
if (!yyin) return NULL;
179
fprintf (stderr, "LEX: 1\n");
181
fprintf (stderr, "LEX: 2\n");