----- Forwarded message from root <[EMAIL PROTECTED]> -----
Date: Mon, 25 Jan 1999 21:04:38 +0100
From: Stephane Payrard <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: various questions
Reply-To: [EMAIL PROTECTED]
I am exploring linuxconf and evaluate the possibility to provide a
scheme to write perl modules. I know this involves providing a perl
access to the class LINUXCONF_MODULE (using XS or SWIG) but this is
irrelevant to this list.
The result of my preliminary explorations with the included Perl program
leave me perplex:
1/ I noted that under X, the GUI would not accept command name, but numbers only.
This is not a problem but is inconsistent with guiapi.sgml:54
2/ I can't make the Sheet command work
3/ My program works from X but not from a tty (DISPLAY envar unset!). What do I miss?
4/ I compiled mailconf and did a local_install of it . I did what says modtutor
but
a/ linuxconf --modulemain mailconf returns without doing anything
b/ /bin/mailconf barks "This program can't be renamed."
I know I can RTFS but I am sure my mistakes are obvious to an
exercised eye .
stef
PS: below:
1/ a listing cut from my prompt
2/ The exploratory perl script.
[root@stef linuxconf-1.12r5]# ln -sf /bin/linuxconf /bin/mailconf
[root@stef linuxconf-1.12r5]# strace -e trace=file linuxconf --modulemain mailconf
[root@stef linuxconf-1.12r5]# mailconf
This program can't be renamed.
It is normally named linuxconf.
execve("/bin/linuxconf", ["linuxconf", "--modulemain", "mailconf"], [/* 19 vars */]) = 0
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
open("/lib/libm.so.6", O_RDONLY) = 3
open("/usr/lib/libncurses.so.4", O_RDONLY) = 3
open("/lib/libdl.so.2", O_RDONLY) = 3
open("/lib/libcrypt.so.1", O_RDONLY) = 3
open("/usr/lib/libgd.so.1", O_RDONLY) = 3
open("/lib/libc.so.6", O_RDONLY) = 3
stat("/etc/conf.linuxconf", {st_mode=0, st_size=0, ...}) = 0
open("/etc/conf.linuxconf", O_RDONLY) = 3
open("/usr/lib/linuxconf/help.eng/linuxconf-msg-1.13r12.eng", O_RDONLY) = 3
stat("/usr/lib/linuxconf/help.eng/linuxconf-msg-1.13r12.eng", {st_mode=0, st_size=0,
...}) = 0
lstat("/usr/lib/linuxconf/redhat/redhat.so.1.13.12", {st_mode=0, st_size=0, ...}) = 0
open("/usr/lib/linuxconf/redhat/redhat.so.1.13.12", O_RDONLY) = 4
open("/etc/ld.so.cache", O_RDONLY) = 4
open("/lib/libpam.so.0", O_RDONLY) = 4
open("/usr/lib/linuxconf/help.eng/redhat-msg-1.13r12.eng", O_RDONLY) = 4
stat("/usr/lib/linuxconf/help.eng/redhat-msg-1.13r12.eng", {st_mode=0, st_size=0,
...}) = 0
stat("/usr/lib/linuxconf/redhat", {st_mode=0, st_size=0, ...}) = 0
open("/usr/lib/linuxconf/redhat", O_RDONLY|O_NONBLOCK) = 5
open("/usr/lib/linuxconf/redhat/linuxconf.paths", O_RDONLY) = 5
open("/usr/lib/linuxconf/redhat/mailconf.paths", O_RDONLY) = 5
open("/etc/redhat-release", O_RDONLY) = 5
stat("/etc/conf.linuxconf", {st_mode=0, st_size=0, ...}) = 0
open("/etc/conf.linuxconf", O_RDONLY) = 5
stat("/usr/lib/linuxconf/modules/treemenu", 0xbfffea88) = -1 ENOENT (No such file or
directory)
stat("/usr/lib/linuxconf/modules", {st_mode=0, st_size=0, ...}) = 0
open("/usr/lib/linuxconf/modules", O_RDONLY|O_NONBLOCK) = 5
open("/usr/lib/linuxconf/modules/treemenu.so.1.13.12", O_RDONLY) = 5
open("/usr/lib/linuxconf/help.eng/treemenu-msg-1.13r12.eng", O_RDONLY) = 5
stat("/usr/lib/linuxconf/help.eng/treemenu-msg-1.13r12.eng", {st_mode=0, st_size=0,
...}) = 0
stat("/etc/linuxconf/control", 0xbfffee64) = -1 ENOENT (No such file or directory)
[root@stef linuxconf-1.12r5]# cat /etc/conf.linuxconf
[base]
LINUXCONF.distribution redhat
module.list 1 treemenu
notice.10-welcome.help 908340644
[netaccess]
htmlaccess.from 127.0.0.1
htmlaccess.dolog 0
htmlaccess.enable 1
[noarch]
confver.last
confver.current Home
[netclient]
DNSCONF.dnsneeded 1
[root@stef linuxconf-1.12r5]#
2#! /usr/bin/perl
use strict;
use Carp 'confess';
use Socket;
$SIG{__DIE__}=\&confess;
my $DEBUG = 1;
my $LINUXCONFHOME="/home/stef/src/linuxconf-1.13r12";
my @REMADMIN = ("remadmin", "--pipe" ); # "$f";
# associate strings to their associated protocol number
my %id;
my $i;
grep { $id{"\L$_"}=++$i } qw(Str Newline Skip Hline Dispolast Label String Checkbox
Radio Button Button_xpm Button_xpmf Choice Choice_item List List_item Combo Combo_item
Group Form Page Book MainForm End Delete Dump Icon_xpm Xfer_xpm Sidetitle Fill
Formbutton Groupfit Setweightlast Richtext Password Buttonfill Enteraction Curfield
Version Treemenu Treeelem Clist Clist_item Html Treesub Sheet Sheet_item );
socketpair( MINE, YOURS, AF_UNIX, SOCK_STREAM, PF_UNSPEC) or die $!;
my $f = fileno YOURS;
unless ( fork() ) { exec (@REMADMIN, "$f") }
select(MINE); $| = 1; # make unbuffered
$_=<MINE>;
print STDERR "<$_" if $DEBUG;
while(<DATA>) {
next if m/^\s*#/;
next if m/^\s*$/;
s/^\s*(\S+)/defined $id{"\L$1"} ? $id{"\L$1"} : $1/e ;
print STDERR ">$_" if $DEBUG;
print MINE $_;
}
while(<MINE>) {
print STDERR "<$_" if $DEBUG;
}
__DATA__
MainForm aform "form"
Book abook "book"
Page basic "Basic menu"
Label "nm"
String S1 15
Radio R1 1 0 a
Radio R1 2 0 b
Newline
Button B1 1 voila
Button B2 0 fffffffff
Sheet sheet 3 du dubon dubonnet
End
End
End
----- End forwarded message -----
--
Stephane Payrard -- [EMAIL PROTECTED]
---
You are currently subscribed to linuxconf as: [[email protected]]
To unsubscribe, forward this message to [EMAIL PROTECTED]