1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
|
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <glib.h>
#include <gtk/gtk.h>
#include <glib/gstdio.h>
#include <glade/glade.h>
#include <locale.h>
#include "update-notifier.h"
#include "hooks.h"
#include "rfc822.h"
#include "assert.h"
#include "md5.h"
/* relative to the home dir */
#define HOOKS_SEEN ".update-notifier/hooks_seen"
/* used by e.g. the installer to mark stuff that's already done */
#define GLOBAL_HOOKS_SEEN "/etc/update-notifier/hooks_seen"
#define HOOK_DEBUG 0
// Debuging
static void debug_log_handler (const gchar *log_domain,
GLogLevelFlags log_level,
const gchar *message,
gpointer user_data)
{
#if HOOK_DEBUG
g_log_default_handler (log_domain, log_level, message, user_data);
#endif
}
void hooks_trayicon_update_tooltip (TrayApplet *un, int num_hooks)
{
g_debug("update_tooltip: %x ", un);
gchar *updates;
gchar *explanation;
updates = g_strdup_printf(ngettext("There is %i item of post-update information available!", "There are %i items of post-update information available!", num_hooks), num_hooks);
explanation = ngettext("Press this icon to show the information.", "Press this icon to show the information.", num_hooks);
gtk_tooltips_set_tip(GTK_TOOLTIPS(un->tooltip),
GTK_WIDGET (un->eventbox),
updates, explanation);
g_free (updates);
}
// compare a HookFile with a filename and find the HookFile that matches
gint compare_hook_func(gconstpointer a, gconstpointer b)
{
//g_debug("compare: %s %s\n",(char*)(((HookFileSeen*)a)->filename),(char*)b);
g_assert(a);
g_assert(b);
return strcmp(((HookFile*)a)->filename, b);
}
// return the most recent mtime or ctime of the file
time_t hook_file_time(const gchar *filename)
{
struct stat buf;
char *file = g_strdup_printf("%s/%s",HOOKS_DIR, filename);
if(g_stat(file, &buf) <0) {
g_error("can't stat %s\n",file);
g_free(file);
return 0;
}
g_free(file);
time_t mtime = buf.st_mtime;
time_t ctime = buf.st_ctime;
return mtime > ctime ? mtime : ctime;
}
gboolean hook_file_md5(const gchar *filename, char *md5)
{
char buf[512];
FILE *f;
char *file;
int n;
md5_context md5ctx;
file = g_strdup_printf("%s/%s",HOOKS_DIR, filename);
f = fopen(file,"r");
if(f == NULL) {
g_warning("can't read %s\n",file);
g_free(file);
return FALSE;
}
md5_starts(&md5ctx);
do {
n = fread(buf,1, sizeof(buf), f);
md5_update(&md5ctx, buf,n);
} while(n > 0);
md5_finish(&md5ctx, md5);
g_free(file);
return TRUE;
}
/* mark a given hook file as seen
(actually implemented to write out all the information we have)
*/
gboolean hook_file_mark_as_seen(HookDialog *hook_dialog,
HookFile *hf)
{
g_debug("mark_hook_file_as_seen: %s", hf->filename);
// copy the md5
char md5[16];
hook_file_md5(hf->filename,&md5);
// mark as seen
hf->seen = TRUE;
// update the time (extra paranoia, shouldn't be needed)
hf->mtime = hook_file_time(hf->filename);
// write out the list of known files
gchar *filename = g_strdup_printf("%s/%s",g_get_home_dir(),HOOKS_SEEN);
FILE *f = fopen(filename, "w");
if(f==NULL) {
g_warning("Something went wrong writing the users hook file");
return FALSE;
}
// write out all the hooks that are seen
//
// and any hooks that are not yet seen but have the same md5sum
// as the one just marked (avoids showing duplicated hooks effecivly).
//
// For hooks with the same md5sum use the mtime of the just displayed hook
GList *elm = g_list_first(hook_dialog->hook_files);
for(;elm != NULL; elm = g_list_next(elm)) {
HookFile *e = (HookFile*)elm->data;
g_debug("looking at: %s (%s)",e->filename, e->md5);
if(e->seen == TRUE) {
g_debug("e->seen: %s %i %x", e->filename,e->mtime, (int)(e->cmd_run));
fprintf(f,"%s %i %x\n", e->filename, e->mtime, (int)(e->cmd_run));
} else if(memcmp(e->md5,md5,16) == 0) {
e->seen = TRUE;
fprintf(f,"%s %i %x\n", e->filename,hf->mtime, (int)(e->cmd_run));
g_debug("same md5: %s %i %x",e->filename,hf->mtime,(int)(e->cmd_run));
}
}
fclose(f);
g_free(filename);
return TRUE;
}
/* mark a given HookFile as run */
gboolean mark_hook_file_as_run(HookDialog *hook_dialog, HookFile *hf)
{
if(hf == NULL)
return FALSE;
g_debug("mark_hook_file_as_run: %s\n",hf->filename);
hf->cmd_run = TRUE;
return TRUE;
}
/* get the language code in a static allocated buffer
* short_form: only return the languagecode if true, otherwise
* languagecode_countrycode
*/
char* get_lang_code(gboolean short_form)
{
/* make own private copy */
static gchar locale[51];
strncpy(locale, setlocale(LC_MESSAGES, NULL), 50);
// FIXME: we need to be more inteligent here
// _and_ we probably want to look into the "LANGUAGE" enviroment too
if(short_form) {
locale[2] = 0;
return locale;
} else {
locale[5] = 0;
return locale;
}
}
/*
* get a i18n field of the rfc822 header
* Return Value: a pointer that must not be freed (part of the rfc822 struct)
*/
char *hook_file_lookup_i18n(struct rfc822_header *rfc822, char *field)
{
gchar *s, *entry;
/* try $field-$languagecode_$countrycode first */
s = g_strdup_printf("%s-%s", field, get_lang_code(FALSE));
entry = rfc822_header_lookup(rfc822, s);
//g_debug("Looking for: %s ; found: %s\n",s,entry);
g_free(s);
if(entry != NULL)
return entry;
/* try $field-$languagecode next */
s = g_strdup_printf("%s-%s", field, get_lang_code(TRUE));
//g_debug("Looking for: %s ; found: %s\n",s,entry);
entry = rfc822_header_lookup(rfc822, s);
g_free(s);
if(entry != NULL)
return entry;
/* now try translating it with gettext */
entry = rfc822_header_lookup(rfc822, field);
return entry;
}
char* hook_description_get_summary(struct rfc822_header *rfc822)
{
char *description = hook_file_lookup_i18n(rfc822, "Name");
char *summary = g_strdup(description);
char *p = strchr(summary,'\n');
if(p != NULL)
*p = 0;
return summary;
}
char* hook_description_get_description(struct rfc822_header *rfc822)
{
char *description = hook_file_lookup_i18n(rfc822, "Description");
char *newd, *p;
// look for the first \n, that's the summary
newd = p = g_strdup(description);
if(p == NULL)
return "";
// convert \n to ' '
while( (p=strchr(p,'\n')) != NULL)
*p = ' ';
// strip leading/trailing whitespace
g_strstrip(newd);
// return the rest
return newd;
}
/*
* show the given hook file
*/
gboolean show_next_hook(TrayApplet *ta, GList *hooks)
{
//g_debug("show_next_hook()\n");
HookDialog *hook_dialog = (HookDialog *)ta->user_data;
GladeXML *xml = hook_dialog->glade_xml;
GtkWidget *text = glade_xml_get_widget(xml, "textview_hook");
assert(text);
GtkWidget *button_next = glade_xml_get_widget(xml, "button_next");
assert(button_next);
GtkWidget *button_run = glade_xml_get_widget(xml, "button_run");
assert(button_run);
// init some vars
HookFile *hf = NULL;
char *hook_file = NULL;
// find the next unseen hook
GList *elm = g_list_first(hooks);
for(;elm != NULL; elm = g_list_next(elm)) {
hf = (HookFile*)elm->data;
if(hf->seen == FALSE) {
hook_file = hf->filename;
//g_debug("next_hook is: %s\n",hook_file);
break;
}
}
if(hook_file == NULL) {
g_debug("no unseen hookfile found in hook list of len (%i) \n",
g_list_length(hooks));
return FALSE;
}
char *filename = g_strdup_printf("%s%s",HOOKS_DIR,hook_file);
/* setup the message */
GtkTextBuffer *buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
FILE *f = fopen(filename, "r");
if(f == NULL) {
g_critical("can't open %s", filename);
g_free(filename);
return FALSE;
}
struct rfc822_header *rfc822 = rfc822_parse_stanza(f);
char *cmd = rfc822_header_lookup(rfc822, "Command");
char *term = g_strstrip(rfc822_header_lookup(rfc822, "Terminal"));
g_object_set_data(G_OBJECT(button_run),"cmd", g_strdup(cmd));
g_object_set_data(G_OBJECT(button_run),"term", g_strdup(term));
g_object_set_data(G_OBJECT(button_run),"hook_file", hf);
if(cmd != NULL) {
gtk_widget_show(button_run);
} else {
gtk_widget_hide(button_run);
}
char *summary = hook_description_get_summary(rfc822);
char *descr = hook_description_get_description(rfc822);
char *s = g_strdup_printf("%s\n\n%s\n",gettext(summary), gettext(descr));
gtk_text_buffer_set_text(buf, s, -1);
// set the name to bold
GtkTextIter start, end;
gtk_text_buffer_get_iter_at_offset(buf, &start, 0);
gtk_text_buffer_get_iter_at_offset(buf, &end, g_utf8_strlen(gettext(summary),-1));
gtk_text_buffer_apply_tag_by_name(buf, "bold_tag", &start, &end);
// clean up
fclose(f);
g_free(filename);
g_free(s);
g_free(summary);
g_free(descr);
rfc822_header_free_all(rfc822);
/* mark the current hook file as seen */
g_object_set_data(G_OBJECT(button_next), "HookFile", hf);
return TRUE;
}
void cb_button_run(GtkWidget *self, void *data)
{
//g_debug("cb_button_run()\n");
gchar *cmdline;
TrayApplet *ta = (TrayApplet *)data;
HookDialog *hook_dialog = (HookDialog *)ta->user_data;
/* mark the current hook file as run */
HookFile *hf = g_object_get_data(G_OBJECT(self), "hook_file");
mark_hook_file_as_run(hook_dialog, hf);
gchar *cmd = g_object_get_data(G_OBJECT(self), "cmd");
gchar *term = g_object_get_data(G_OBJECT(self), "term");
if(cmd == NULL) {
g_warning("cmd is NULL\n");
return;
}
if(term != NULL && !g_ascii_strncasecmp(term, "true",-1)) {
cmdline = g_strdup_printf("gnome-terminal -e %s",cmd);
} else
cmdline = g_strdup(cmd);
g_spawn_command_line_async(cmdline, NULL);
g_free(cmdline);
}
void cb_button_next(GtkWidget *self, void *data)
{
g_debug("cb_button_next()");
TrayApplet *ta = (TrayApplet *)data;
HookDialog *hook_dialog = (HookDialog *)ta->user_data;
HookFile *hf;
hf = (HookFile*)g_object_get_data(G_OBJECT(self),"HookFile");
if(hf == NULL) {
g_warning("button_next called without HookFile\n");
return;
}
// mark as seen
hook_file_mark_as_seen(hook_dialog, hf);
check_update_hooks(ta);
if(hook_dialog->hook_files != NULL)
show_next_hook(ta, hook_dialog->hook_files);
}
void show_hooks(TrayApplet *ta)
{
g_debug("show_hooks()");
HookDialog* hook_dialog = (HookDialog *)ta->user_data;
GladeXML *xml = hook_dialog->glade_xml;
GtkWidget *dia = glade_xml_get_widget(xml, "dialog_hooks");
assert(dia);
GtkWidget *button_run = glade_xml_get_widget(xml, "button_run");
assert(button_run);
GtkWidget *button_next = glade_xml_get_widget(xml, "button_next");
assert(button_next);
// if show_next_hook() fails for some reason don't do anything
if(!show_next_hook(ta, hook_dialog->hook_files))
return;
int res = gtk_dialog_run(GTK_DIALOG(dia));
if(res == GTK_RESPONSE_CLOSE) {
// mark the currently current hookfile as seen
HookFile *hf;
hf = (HookFile*)g_object_get_data(G_OBJECT(button_next),"HookFile");
if(hf == NULL) {
g_warning("show_hooks called without HookFile\n");
return;
}
// mark as seen
hook_file_mark_as_seen(hook_dialog, hf);
check_update_hooks(ta);
}
gtk_widget_hide(dia);
}
static gboolean
button_release_cb (GtkWidget *widget,
GdkEventButton *event,
TrayApplet *ta)
{
if (event->button == 1 && event->type == GDK_BUTTON_RELEASE) {
//g_debug("left click on hook applet\n");
show_hooks(ta);
}
return TRUE;
}
gboolean is_hook_relevant(const gchar *hook_file)
{
g_debug("is_hook_relevant()\n");
gboolean res = TRUE;
char *filename = g_strdup_printf("%s%s",HOOKS_DIR,hook_file);
FILE *f = fopen(filename, "r");
if(f == NULL) {
// can't open, can't be relevant
return FALSE;
}
struct rfc822_header *rfc822 = rfc822_parse_stanza(f);
// check the DontShowAfterReboot flag
gchar *b = rfc822_header_lookup(rfc822, "DontShowAfterReboot");
if(b != NULL && g_ascii_strncasecmp(b, "true",-1) == 0) {
// read the uptime information
double uptime=0, idle=0;
char buf[1024];
int fd = open("/proc/uptime", 0);
int local_n = read(fd, buf, sizeof(buf)-1);
buf[local_n] = '\0';
char *savelocale = setlocale(LC_NUMERIC, NULL);
setlocale(LC_NUMERIC,"C");
sscanf(buf, "%lf %lf", &uptime,&idle);
close(fd);
setlocale(LC_NUMERIC,savelocale);
time_t mtime = hook_file_time(hook_file);
time_t now = time(NULL);
g_debug("now: %i mtime: %i uptime: %f\n",now,mtime,uptime);
g_debug("diff: %i uptime: %f\n",now-mtime,uptime);
if((int)uptime > 0 && (now - mtime) > (int)uptime) {
g_debug("not relevant because of reboot: %s\n",hook_file);
res = FALSE;
}
}
fclose(f);
g_free(filename);
rfc822_header_free_all(rfc822);
return res;
}
gboolean check_update_hooks(TrayApplet *ta)
{
g_debug("check_update_hooks()");
HookDialog *hook_dialog = (HookDialog*)ta->user_data;
GDir* dir;
const gchar *hook_file;
dir=g_dir_open(HOOKS_DIR, 0, NULL);
if(dir == NULL)
g_critical("can't read %s directory\n",HOOKS_DIR);
int unseen_count = 0;
while((hook_file=g_dir_read_name(dir)) != NULL) {
// check if the hook still applies (for e.g. DontShowAfterReboot)
if(!is_hook_relevant(hook_file))
continue;
// see if we already know about this hook filename
GList *elm = g_list_find_custom(hook_dialog->hook_files,hook_file,
compare_hook_func);
// not seen before, add to the list
if(elm == NULL) {
g_debug("never seen before: %s",hook_file);
HookFile *t = g_new0(HookFile, 1);
t->filename = strdup(hook_file);
t->mtime = hook_file_time(hook_file);
hook_file_md5(hook_file, t->md5);
t->cmd_run = FALSE;
t->seen = FALSE;
hook_dialog->hook_files = g_list_append(hook_dialog->hook_files, t);
// init elm with the just added record (will be needed below)
elm = g_list_find_custom(hook_dialog->hook_files,hook_file,
compare_hook_func);
assert(elm != NULL);
}
// this is the hook file information we have (either because it was
// availabe already or because we added it)
HookFile *hf = (HookFile*)elm->data;
// file has changed since we last saw it
time_t new_mtime = hook_file_time(hook_file);
if(new_mtime > hf->mtime) {
g_debug("newer mtime: %s (%i > %i))",hook_file, new_mtime, hf->mtime);
hf->seen = FALSE;
}
// we have not seen it yet (because e.g. it was just added)
if(hf->seen == FALSE) {
// update mtime (because we haven't seen the old one and there
// is a new one now)
hf->mtime = new_mtime;
// check if there is already another notification that is
// a) not this one
// b) not seen yet
// c) the same
// if so, we don't increase the unseen count as all identical
// ones will maked as unseen at onces
gboolean md5match = FALSE;
GList *x = g_list_first(hook_dialog->hook_files);
while(x!=NULL) {
HookFile *e = (HookFile*)x->data;
if((elm != x) &&
(e->seen == FALSE) &&
(memcmp(hf->md5,e->md5,16)==0) )
{
g_debug("%s (%s) was seen also in %s (%s)\n",
hf->filename, hf->md5, e->filename, e->md5);
md5match = TRUE;
}
x = g_list_next(x);
}
if(!md5match) {
g_debug("%s increases unseen_count\n",hf->filename);
unseen_count++;
}
}
}
g_dir_close(dir);
//g_debug("hooks: %i (new: %i)", g_list_length(hook_files), unseen_count);
GladeXML *xml = hook_dialog->glade_xml;
GtkWidget *button_next = glade_xml_get_widget(xml, "button_next");
assert(button_next);
switch(unseen_count) {
case 0:
gtk_widget_hide(GTK_WIDGET(ta->tray_icon));
gtk_widget_hide(button_next);
break;
case 1:
gtk_widget_show(GTK_WIDGET(ta->tray_icon));
gtk_widget_hide(button_next);
break;
default:
gtk_widget_show(GTK_WIDGET(ta->tray_icon));
gtk_widget_show(button_next);
break;
}
hooks_trayicon_update_tooltip (ta, unseen_count);
return TRUE;
}
void hook_read_seen_file(HookDialog *hook_dialog, const char* filename)
{
char buf[512];
int time, was_run;
FILE *f = fopen(filename, "r");
if(f==NULL)
return;
g_debug("reading hook_file: %s \n", filename);
while(fscanf(f, "%s %i %i",buf,&time,&was_run) == 3) {
// first check if the file actually exists, if not skip it
// (may already be delete when e.g. a package was removed)
char *filename = g_strdup_printf("%s%s",HOOKS_DIR,buf);
gboolean res = g_file_test(filename, G_FILE_TEST_EXISTS);
g_free(filename);
if(!res)
continue;
// now check if we already have that filename in the list
GList *elm = g_list_find_custom(hook_dialog->hook_files,buf,
compare_hook_func);
if(elm != NULL) {
g_debug("hookfile: %s already in the list", buf);
// we have that file already in the list with a newer mtime,
// than the file in the config file. ignore the config file
HookFile *exisiting = (HookFile *)elm->data;
// and it's more current
if(exisiting->mtime > time) {
g_debug("existing is newer, ignoring the read one\n");
continue;
}
// we have it in the list, but the the file in the list is older
// than the one in the config file. use this config-file instead
// and update the values in the list
exisiting->cmd_run = was_run;
exisiting->seen = TRUE;
exisiting->mtime = time;
hook_file_md5(exisiting->filename,exisiting->md5);
} else {
// not in the list yet
// add the just read hook file to the list
g_debug("got: %s %i %i ",buf,time,was_run);
HookFile *t = g_new0(HookFile, 1);
t->filename = strdup(buf);
t->mtime = time;
t->cmd_run = was_run;
t->seen = TRUE;
hook_file_md5(t->filename,t->md5);
hook_dialog->hook_files = g_list_append(hook_dialog->hook_files, t);
}
}
fclose(f);
}
gboolean init_already_seen_hooks(TrayApplet *ta)
{
g_debug("init_already_seen_hooks");
HookDialog* hook_dialog = (HookDialog*)ta->user_data;
char *filename;
// init with default value
hook_dialog->hook_files = NULL;
// read global hook file
hook_read_seen_file(hook_dialog,GLOBAL_HOOKS_SEEN);
// read user hook file
filename = g_strdup_printf("%s/%s", g_get_home_dir(),HOOKS_SEEN);
hook_read_seen_file(hook_dialog,filename);
g_free(filename);
return TRUE;
}
void hook_tray_icon_init(TrayApplet *ta)
{
HookDialog *hook_dialog = g_new0(HookDialog, 1);
ta->user_data = hook_dialog;
GladeXML *xml = glade_xml_new(GLADEDIR"hooks-dialog.glade",
NULL, NULL);
assert(xml);
hook_dialog->glade_xml = xml;
glade_xml_signal_connect_data(xml, "on_button_next_clicked",
G_CALLBACK(cb_button_next),
(gpointer)ta);
glade_xml_signal_connect_data(xml, "on_button_run_clicked",
G_CALLBACK(cb_button_run),
(gpointer)ta);
// setup a custom debug log handler
g_log_set_handler (G_LOG_DOMAIN,
G_LOG_LEVEL_DEBUG,
debug_log_handler,
NULL);
/* show dialog on click */
g_signal_connect (G_OBJECT(ta->tray_icon),
"button-release-event",
G_CALLBACK (button_release_cb),
ta);
// create a bold tag
GtkWidget *text = glade_xml_get_widget(xml, "textview_hook");
GtkTextBuffer *buf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text));
gtk_text_buffer_create_tag (buf, "bold_tag",
"scale", PANGO_SCALE_LARGE,
"weight", PANGO_WEIGHT_BOLD,
NULL);
/* read already seen hooks */
init_already_seen_hooks(ta);
/* Check for hooks */
check_update_hooks(ta);
}
|