1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-11-04 08:17:17 -05:00

Modularise viewer/text/marks

This commit is contained in:
Miciah Dashiel Butler Masters 2006-05-20 13:05:48 +00:00 committed by Miciah Dashiel Butler Masters
parent a0bcf254ae
commit e91b46de5f
4 changed files with 19 additions and 6 deletions

View File

@ -281,9 +281,6 @@ terminate_all_subsystems(void)
if (init_b) {
#ifdef CONFIG_SCRIPTING
trigger_event_name("quit");
#endif
#ifdef CONFIG_MARKS
free_marks();
#endif
free_history_lists();
done_modules(builtin_modules);

View File

@ -29,6 +29,7 @@
#include "protocol/protocol.h"
#include "scripting/scripting.h"
#include "terminal/terminal.h"
#include "viewer/text/marks.h"
#include "viewer/text/search.h"
#include "viewer/timer.h"
@ -44,6 +45,9 @@ struct module *main_modules[] = {
struct module *builtin_modules[] = {
&periodic_saving_module,
&timer_module,
#ifdef CONFIG_MARKS
&viewer_marks_module,
#endif
#ifdef CONFIG_CSS
&css_module,
#endif

View File

@ -10,6 +10,7 @@
#include "elinks.h"
#include "document/view.h"
#include "main/module.h"
#include "protocol/uri.h"
#include "util/memory.h"
#include "util/string.h"
@ -136,8 +137,8 @@ set_mark(unsigned char mark, struct view_state *mark_vs)
marks[i] = vs;
}
void
free_marks(void)
static void
done_marks(struct module *xxx)
{
int i;
@ -145,3 +146,13 @@ free_marks(void)
free_mark_by_index(i);
}
}
struct module viewer_marks_module = struct_module(
/* name: */ "Marks",
/* options: */ NULL,
/* hooks: */ NULL,
/* submodules: */ NULL,
/* data: */ NULL,
/* init: */ NULL,
/* done: */ done_marks
);

View File

@ -2,11 +2,12 @@
#ifndef EL__VIEWER_TEXT_MARKS_H
#define EL__VIEWER_TEXT_MARKS_H
struct module;
struct view_state;
void goto_mark(unsigned char mark, struct view_state *vs);
void set_mark(unsigned char mark, struct view_state *vs);
void free_marks(void);
extern struct module viewer_marks_module;
#endif