Codebase list cdebconf / fbd54368-7490-42d4-8d5f-1227d5b108eb/main doc / confmodule.txt
fbd54368-7490-42d4-8d5f-1227d5b108eb/main

Tree @fbd54368-7490-42d4-8d5f-1227d5b108eb/main (Download .tar.gz)

confmodule.txt @fbd54368-7490-42d4-8d5f-1227d5b108eb/mainraw · history · blame

Most clients can be written quite simply with shell or Perl.

Shell-script based clients
~~~~~~~~~~~~~~~~~~~~~~~~~~
Shell-script based debconf clients should source the confmodule support
library, /usr/share/debconf/confmodule by default.

Use of the shell confmodule library is described in the debconf
documentation.

Perl based clients
~~~~~~~~~~~~~~~~~~
/* to be added, need to modify ConfModule.pm */

C based clients
~~~~~~~~~~~~~~~
libdebconf has some simple support functions for C based clients;
the API is pretty simple:

#include <debconfclient.h>

struct debconfclient *client = debconfclient_new();
client->command(client, "INPUT", "low", "foo/bar", NULL);
myvar = client->value;
(or myvar = client->ret(client); )
/* ... */
debconfclient_delete(client);

the command method takes a NULL-terminated list of arguments to pass
to the confmodule. The result is stored in client->value;

File descriptors
~~~~~~~~~~~~~~~~
cdebconf opens some additional fds for the confmodule. Actually they are:
- 4: original stdin, defined as DEBCONF_OLD_STDIN_FD
- 5: original stdout, defined as DEBCONF_OLD_STDOUT_FD

Packages which want to call a console application may use them.