From 9df906ee4f34cf54c9ba253d44abb74b0ef63fe1 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Tue, 30 Jul 2013 11:59:13 +0200 Subject: libfshelp: add translator-list.c Add functions that maintain a list of active translators. * libfshelp/translator-list.c: New file. * libfshelp/fshelp.h: Add function declarations. * libfshelp/Makefile: Add translator-list.c, link against libihash. --- libfshelp/fshelp.h | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'libfshelp/fshelp.h') diff --git a/libfshelp/fshelp.h b/libfshelp/fshelp.h index cf39fbc4..43fbcd78 100644 --- a/libfshelp/fshelp.h +++ b/libfshelp/fshelp.h @@ -1,5 +1,6 @@ /* FS helper library definitions - Copyright (C) 1994,95,96,97,98,99,2000,01,02 Free Software Foundation, Inc. + Copyright (C) 1994,95,96,97,98,99,2000,01,02,13 + Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -31,6 +32,36 @@ #include #include + +/* Keeping track of active translators */ +/* These routines keep a list of active translators. They are + self-contained and do not require multi threading or the ports + library. */ + +/* Record an active translator being bound to the given file name + NAME. ACTIVE is the control port of the translator. */ +error_t +fshelp_set_active_translator (const char *name, mach_port_t active); + +/* Remove the active translator specified by its control port ACTIVE. + If there is no active translator with the given control port, this + does nothing. */ +error_t +fshelp_remove_active_translator (mach_port_t active); + +/* This kind of function is used by fshelp_get_active_translators to + filter the list of translators to return. If a filter returns an + error for a given PATH, the translator bound to the PATH is not + included in the list. */ +typedef error_t (*fshelp_filter) (const char *path); + +/* Records the list of active translators into the argz vector + specified by TRANSLATORS filtered by FILTER. */ +error_t +fshelp_get_active_translators (char **translators, + size_t *translators_len, + fshelp_filter filter); + /* Passive translator linkage */ /* These routines are self-contained and start passive translators, -- cgit v1.2.3