Linux-Development-Apps Digest #478, Volume #6    Fri, 31 Mar 00 06:13:12 EST

Contents:
  Re: Retrieving the title of an (n)xterm window? ("Norm Dresner")
  A question on strace-3.1 (Pau-Chen Cheng)
  motif gui builder ("FRANCOIS A.")
  Re: Looking for specific source (Victor Wagner)
  Re: how to program in linux (Victor Wagner)
  Re: getch() and clrscr() in g++? (Victor Wagner)
  Re: XDM - bypass login? (Victor Wagner)
  Re: .cpp to HTML? (Victor Wagner)
  Emergency Control Organisation management software? ("Politas")
  Re: SOCKETS  in C (Max Moser)
  Re: C++ in Linux ("Frank V. Castellucci")
  Looking for TLI Interface ("Dolphin")
  Re: Retrieving the title of an (n)xterm window? ("T.E.Dickey")
  Study kernel source? (LIN Yong)
  Re: Request Web Pages With a C Program (Elmo Recio)
  Re: Extracting TAR Files in a specific Directory (John Reiser)
  J2SE & Forte for Java Community Edition (NTK)
  Re: Zero padding in sprintf() doesn't work for strings - HELP ! (John Brockmeyer)
  Re: Executing a Function From a (char *) Variable (Moritz Franosch)
  GSList in GTK+ (Bonny Gijzen)
  How to make a function memeber to be a sig. handler ("Boris Pran")
  Re: How to make a function memeber to be a sig. handler (Mathias Waack)
  Re: .cpp to HTML? (Joaquín Cuenca Abela)

----------------------------------------------------------------------------

Reply-To: "Norm Dresner" <[EMAIL PROTECTED]>
From: "Norm Dresner" <[EMAIL PROTECTED]>
Subject: Re: Retrieving the title of an (n)xterm window?
Date: Thu, 30 Mar 2000 21:11:13 GMT

I can verify that this does work in an xterm window but not in an nxterm
window
    Norm

Lee Webb <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> After a little searching, I came across the following:
>
>         #!/bin/ksh
>         # Echo the current X term title bar to standard output.
>         # Written by Icarus Sparry <[EMAIL PROTECTED]> 11 Apr 1997
>         #
>         exec </dev/tty
>         old=$(stty -g)
>         stty raw -echo min 0  time ${1-10}
>         print "\033[21t\c" > /dev/tty
>         IFS='' read -r a
>         stty $old
>         b=${a#???}
>         print -R "${b%??}"
>
> However, I haven't tested it and thus cannot confirm if it works.
>
> P.S. The link to it is:
> http://allison.clark.net/pub/dickey/xterm/xterm.faq.html#how2_title
>
> Lee.
>
> Norm Dresner wrote:
> >
> > It's easy using the escape sequences "\033]1;%s\007" and "\033]2;%s\007"
to
> > change the title (and iconic name) for an (n)xterm window.
> >
> > Does anyone know how to retrieve the title?  (For example,  I might want
> > change the title when my program starts and to restore it when it's
done)
> >
> > Thanks
> >     Norm
>
> --
> Boycott Amazon: http://www.gnu.org/philosophy/amazon.html


------------------------------

From: Pau-Chen Cheng <[EMAIL PROTECTED]>
Subject: A question on strace-3.1
Date: Thu, 30 Mar 2000 16:35:05 -0500

I am looking at the source code of strace-3.1,
trying to understand how it works. I am using a
Pentium II system.

My question :

  in the function "internal_fork()", it calls "setbpt()"
  to set a breakpoint. I guess it is placed right after
  the "int 0x80" instruction in the libc "fork" stub.

  So, why is this breakpoint needed ?

Thanks.

Pau-Chen




------------------------------

From: "FRANCOIS A." <[EMAIL PROTECTED]>
Subject: motif gui builder
Date: Thu, 30 Mar 2000 23:39:12 +0200

Hello,
 I am searching for a FREE motif gui builder.
I've tried :lxb, vdx, snapix, yagb but no one of them are working ( running
problems!) correctly with wy redhat6.0 distribution.

So if anyone have an idea..
                                                    thank you



------------------------------

From: [EMAIL PROTECTED] (Victor Wagner)
Subject: Re: Looking for specific source
Date: 30 Mar 2000 22:39:39 +0400

Peet Grobler <[EMAIL PROTECTED]> wrote:
: What utility (e.g. grep, find etc) can I use to find out in which file a
: command's source is? e.g. I'm looking for the source of 'cp'.

: how would I go about searching for it?

I would do following way:
1. Ask my package manager which package particular program belongs to
  in redhat-derivatives it is rpm -qf program,
  in debian dpkg -S program
2. Ask my package manager to unpack source package 
  In Debian it is
  apt-get source package (and it will ask for proper one of source CDs)
  In RedHat there is now such command as far as I'm aware, but RedHat is
  much smaller, and source fit on one CD, so you can just mount it
  manually and install apropriate src.rpm
3. Investigate unpacked source directory.
  

-- 

------------------------------

From: [EMAIL PROTECTED] (Victor Wagner)
Subject: Re: how to program in linux
Date: 30 Mar 2000 22:52:11 +0400

helios <[EMAIL PROTECTED]> wrote:
: Hi,

: Got another problem in linux. Don't know how to develop apps coz haven't 
: got any knowledge bout it. What languages should I use. I have backgroud 
: using turbo c but thats all I know. What compilers should I download and 
: where can I get them.

Typically, in Linux you don't need to download anything if you have
recent distribution. Just insert your distribution CD and install
apropriate packages.

Really, for starting programming on Linux I'll reccomend you to forget
about compiled languages for a while and try to write something useful
using just your shell. It is quite a powerful programming language.

And learning curve is not so steep - you just figure out how to do it
manually, then write commands to file and add some flexibility, for
instance replace hard-coded filenames by command line args, add some
looping or conditional statement. Thus starting from just transcipt of
interactive session you can end up with quite sophisticated program
using step-by-step refinement technique.

When you master it, and find tasks which are not solvable with it,
switch to something more powerful like perl, Tcl or Python. Some of them
if not all, are already installed in your system, becouse most of system
administration tools are written on them. And becouse they are
interpreters, you don't need anything other for program, than
environment used to run ready to use scripts.

And then, when you find out that there is something which couldn't be
easily done with perl, Python and Tcl/Tk, start with C. For this you
need binutils, gcc and development version of each and every library you
are planning to use. glibc-devel is certainly neccessary.

And of course, you need some good books. I always reccomend classical
one "The Unix Programming Environment" by Kernigan and Pike, if you
could find it (it was published around 1974, but all techniques
described there are still applicable, although sometimes there is
something better invented since). Then look for books by Sten Kelly
Buttle and "Secrets of Unix" by J. Amstrong.

These books can lead you from shell programming to C programming
bypassing intermediate step of interpreted languages which I've
suggested. For them there always exist books written by that very people
who wrote language itself. Larry Wall for Perl, John Ousterhout for Tcl,
Guido van Rossum for Python.

Then it comes to professional-level books like Stevence and Terrence
Chan.
-- 

------------------------------

From: [EMAIL PROTECTED] (Victor Wagner)
Subject: Re: getch() and clrscr() in g++?
Date: 30 Mar 2000 22:56:24 +0400

Alec Holmes <[EMAIL PROTECTED]> wrote:
: I am used to programming in DOS, Win9x, in C++, and am wondering where I can
: find Linux g++ equivilents to the functions clrscr() and getch() in the
: conio.h library. Any help is greatly appreciated.

It is considered bad way in Unix to use such things as conio.h
which seems to be originated in Basic.

Either your program is simple command-line utility, which doesn't assume
that its output is terminal (and thus allows you to redirect output)
or it is full-featured full-screen application, which should use
something more powerful than conio. Most widely-used screen output
library is (n)curses, which provides getch() and clear() and many many
other things including box drawing and sort of window management.

Alternate one is slang, which is used for example, for Midnight
Commander, slrn and other programs you are probably familiar with.


-- 
<stu> Stupid nick highlighting
<stu> Whenever someone starts with "stupid" it highlights the nick.  Hmm.
        -- #Debian

------------------------------

From: [EMAIL PROTECTED] (Victor Wagner)
Subject: Re: XDM - bypass login?
Date: 30 Mar 2000 22:58:56 +0400

James Moger <[EMAIL PROTECTED]> wrote:
: I am working on a system which I want to boot directly into X without
: prompting for a user ID & password.
: I am using XDM & XFree86 3.3.6.  It can assume its the root user if
: necessary.  Is there any way to do this?

Of course you can. But first, reconsider if you really need it.

You can just invoke startx from your startup script (preferrable do
su someunprivilegeduser -c startx

You don't actually need xdm if you don't need authorization, becouse it
is its only purpose.



-- 

------------------------------

From: [EMAIL PROTECTED] (Victor Wagner)
Crossposted-To: linux.dev.c-programming
Subject: Re: .cpp to HTML?
Date: 30 Mar 2000 22:59:40 +0400

Jack Kelly Dobson <[EMAIL PROTECTED]> wrote:
: Hi folks,

: I'm looking for a utility that will take a .cpp file and create a
: syntax highlited HTML file from it.

: Anyone know of something like this existing?

  vim file.cpp
  :so 2html.vim


------------------------------

From: "Politas" <[EMAIL PROTECTED]>
Subject: Emergency Control Organisation management software?
Date: Fri, 31 Mar 2000 10:03:01 +1000

I am trying to find out if anyone is working on a GPLed system for managing
an Emergency Control Organisation (ECO), or a small part thereof.  By an
ECO, I am referring to things like Australia's State Emergency Services, ie,
a mostly volunteer-run organisation which provides people to help in
emergencies (floods, storms, earthquakes, major accidents, that sort of
thing)  The system I am envisaging is a database which cross-links tasks
performed at an incident with competencies being used by personnel.  The
goal is to be able to report on Incidents and manage training of volunteer
personnel.

If anyone is already working on a project like this, I'd be interested in
getting in touch. I not, then I guess I've found myself a project to get
back into programming with. I'm thinking of using the Slash code as a
starting point, unless anyone can think of a closer fit.

In the future, it would be good to also link into GIS data for real-time
management of incidents, but we don't have the mobile hardware or data to
make that terribly useful at present.



------------------------------

From: Max Moser <[EMAIL PROTECTED]>
Subject: Re: SOCKETS  in C
Date: Fri, 31 Mar 2000 02:26:12 +0200

Go to www.wrox.com search for "Beginning Linux Programming" and download the
example code there. ( Chapter 14)
I think there is exactly the thing you are looking for.


Max



Am Don, 30 Mär 2000 hat Daniel Graf geschrieben:
>On Fri, 24 Mar 2000 10:41:17 +0100, Neo <[EMAIL PROTECTED]> wrote:
>
>>Hi there,
>>
>>Does anybody know how I can send only one character at a time to another
>>socket??
>>
>>Thanks for help
>>
>>-Neo
>
>I'm going to take this from a different angle than the other replies,
>just in case this is more along the lines of what you were talking
>about.
>
>Your trying to do:
>
>send(fd,'X',1,0);
>or 
>send(fd,&'X',1,0);
>
>And you've found they don't work and
>can't find another function to do it.
>
>The answer is you need to use a temporary char variable.  And use it
>in a send.  Or write a function or a macro something like this:
>
>int sendChar(int fd, char c, int flags)
>{
>    return send(fd, &c, 1, flags);
>}
>
>Note, on some systems, esp. unix based, you can use file io operations
>on sockets, I don't know offhand if there's a simple single character
>write command for unix style io.  The above solution should work under
>winsock as well though.

------------------------------

Date: Thu, 30 Mar 2000 20:05:21 -0500
From: "Frank V. Castellucci" <[EMAIL PROTECTED]>
Subject: Re: C++ in Linux

All those in favor say aye:

AYE!

[EMAIL PROTECTED] wrote:
> 
> A very good text editor i have used is Visual SlickEdit for linux...
> its not free, but i highly recommend it if you have a few bucks
> extra..
> 
> All the whistles and bells, syntax coloring, completion,
> customization, etc...
> 
> just my 2 cents..
> 
> rob
> 
> On Thu, 30 Mar 2000 15:57:55 GMT, [EMAIL PROTECTED] (Kaz
> Kylheku) wrote:
> 
> >On Thu, 30 Mar 2000 05:00:05 GMT, David Steuber <[EMAIL PROTECTED]>
> >wrote:
> >>[EMAIL PROTECTED] writes:
> >>
> >>' Sorry, I think 'vim', thats 'vi' improved is just excellent.
> >>' make a file named '~/.vimrc' containing:
> >>' set sm
> >>' set scs
> >>' set ts=3
> >>' set sw=3
> >>' set sr
> >>' set cino=>se1n0f0{0}0^0:0=sg0hs+s(su1
> >>' set cin
> >>' syntax on
> >>
> >>Ok, where do you find the documentation for this stuff?  I want to
> >
> >One way to get help with Vim is to simply type :help
> >
> >The home page is www.vim.org.
> >
> >Another resource is the comp.editors newsgroup.
> >
> >Linda Lamb's vi book is pretty good; it has been updated and includes some
> >notes on vim.

-- 
Frank V. Castellucci
http://corelinux.sourceforge.net
OOA/OOD/C++ Standards and Guidelines for Linux

------------------------------

From: "Dolphin" <[EMAIL PROTECTED]>
Subject: Looking for TLI Interface
Date: Fri, 31 Mar 2000 22:05:37 +0800

Is there any TLI interface in Linux which support NetBios over TCP/IP ?
I found that there is no interface in SAMBA ??
Francis





------------------------------

From: "T.E.Dickey" <[EMAIL PROTECTED]>
Subject: Re: Retrieving the title of an (n)xterm window?
Date: Fri, 31 Mar 2000 03:13:17 GMT

Norm Dresner <[EMAIL PROTECTED]> wrote:
> I 'm not fluent in ksh.  Can you tell me what "\c" generates?
>     Thanks,
>         Norm
it's used to prevent a newline from echoing.

-- 
Thomas E. Dickey
[EMAIL PROTECTED]
http://www.clark.net/pub/dickey

------------------------------

From: LIN Yong <[EMAIL PROTECTED]>
Subject: Study kernel source?
Date: 31 Mar 2000 11:25:02 +0800

Hi,

Since I have a course about Operation System.  I think to read Linux
kernel source is a good help.  But, where should I begin?  There are
lots of source code.  From memory manage, task manager or ...?

Thanks

Lin

------------------------------

From: Elmo Recio <[EMAIL PROTECTED]>
Subject: Re: Request Web Pages With a C Program
Date: Fri, 31 Mar 2000 03:45:30 GMT


AMEN! on the stevens book!!! ITS **THE BIBLE** of socket programming!

>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 30/03/00, 12:25:44, "Boris" <[EMAIL PROTECTED]> wrote regarding Re:=20
Request Web Pages With a C Program:

> But first get R. Stevens' book "Unix Network Programming - Volume 1". =

:)




------------------------------

From: John Reiser <[EMAIL PROTECTED]>
Subject: Re: Extracting TAR Files in a specific Directory
Date: Thu, 30 Mar 2000 20:05:55 -0800

> How can I to extract the files of a TAR file in a specific
> directory? (not in the current diretory). 

Use a subshell, and change to the desired directory before
extracting the tar archive:

        ( cd testfolder; tar xf archive.tar )

------------------------------

From: NTK <[EMAIL PROTECTED]>
Subject: J2SE & Forte for Java Community Edition
Date: Fri, 31 Mar 2000 04:30:08 GMT

I just installed J2SE and set the proper PATH to where jdk1.2.2 is 
installed.  Then I installed Forte for Java Community Edition.

First of all, I was able to compile a simple Java program, but when I 
tried to run it, it errored out with something like ..NodefClass.. 
something.  In a word, in runtime, it's looking for class but can't find 
it.  Where is java Classes and what class files do I look for?

Second problem is, when I try to run Forte, it says the path to jdk1.2.2 
is not set or missing although I set the path in .bashrc.

what do you think for i am lost.

thanks

--
Posted via CNET Help.com
http://www.help.com/

------------------------------

From: John Brockmeyer <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system
Subject: Re: Zero padding in sprintf() doesn't work for strings - HELP !
Date: Thu, 30 Mar 2000 22:42:42 -0700

If someone were to check K&R, the font of all knowledge, they would see on P243
   0: for numeric conversions, specifies padding to the field width with leading
zeroes.

notice the words 'numeric conversions'. strings are not numeric.

Gerd Buesken wrote:

> Hi
>
> I have a problem using gcc 2.95 running on a 2.2.5-15 Red Hat linux.
>
> Regarding sprintf, the man pages say:
> 0 specifying zero padding.   For  all  conversions  except  n,  the
> converted  value  is padded on the left with  zeros  rather  than blanks.
> If  a  precision  is  given with a numeric conversion (d, i, o, u,  i,  x,
> and X), the 0 flag is ignored.
>
> My source looks like this:
>
> include <stdio.h>
>
> main()
> {
>  char buff[30];
>  char LenBuf[30];
>
>  strcpy(LenBuf,"1");
>  sprintf (buff,"%06s", LenBuf);
>  printf( "buffer=%s; Length %06d\n",buff, strlen(LenBuf) );
> }
>
> This is the Linux output:
> buffer=     1; Length 000001
>
> This is the HP-UX output:
> buffer=000001; Length 000001
>
> It seems as if the output on Linux is wrong(using Blanks instead of zeros).
>
> Does anybody has a solution other than rewriting the code ?
>
> Thanks
> Gerd




------------------------------

From: Moritz Franosch <[EMAIL PROTECTED]>
Subject: Re: Executing a Function From a (char *) Variable
Date: 31 Mar 2000 12:01:37 +0200



LiNuX_MaN <[EMAIL PROTECTED]> writes:

> How can I execute a function passed in a variable of the type
> (char *)?
> 
> Example:
> 
> char *Exec;
> ..
> strcpy(Exec, "printf("blue");");
> 
> Then I want to execute the var "Exec".

Self-modifying code is possible, look at the example below.
However you can only execute machine code this way.
But you could compile an object file with the function
void f() {
  printf("blue");
} ,
read in the object file, find the entry point of f() and execute it
from within another program.


#include <iostream>

char s[2];

void func() {
  s[0]='B';
}

typedef void (*function)();

int main() {
  char c[100];
  for (int i=0; i<14; i++) {
    c[i]=((char*) &func)[i];
  }
  s[0]='A';
  s[1]=0;
  cout << "s=" << s << endl;
  function f=(function) c;
  f();
  cout << "s=" << s << endl;
  c[9]='C';
  f();
  cout << "s=" << s << endl;
};

The output is
s=A
s=B
s=C

Note that of course 'i<14' and 'c[9]' is system and compiler
dependent.


Moritz

------------------------------

From: Bonny Gijzen <[EMAIL PROTECTED]>
Subject: GSList in GTK+
Date: Fri, 31 Mar 2000 09:59:32 -0500

Hi,

Does anybody know if a GSList is synchronize by default?

I am using a GSList from different threads and I want to know if
I have to synchronize the list myself with mutexes or not?

Is the GSList synchronized or not ??

Thanks,




------------------------------

From: "Boris Pran" <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system
Subject: How to make a function memeber to be a sig. handler
Date: Fri, 31 Mar 2000 12:09:01 +0200

Here is my problem...
I was writing a simple program in C++ to talk to serial port and everything
was OK until I wanted to make a function member to be a signal handler for
SIGIO.
My signal handler was suppose to change data_arrival flag from false to
true - simple as that.

I installed signal handler with sigaction and I put in sgact.sa_handler = &
commport::get_data
Program compiles with the warning : converting void (commport::*)(int) to
void (*)(int) - if I do casting nothing changes...

If I start it everything seems OK until signal arrives when it does jump to
my sig. handler and when it tries to assess the flag it crashes with
Segmentation fault.

If I call the method from main() it does it's job and returns.
When I use an ordinary function as a signal handler everything works well.

WHERE DID I GO WRONG ?
I am a beginner in C++ and Linux programming so please have that in mind
when answering my question.

Thanks a lot.

Boris





------------------------------

From: Mathias Waack <[EMAIL PROTECTED]>
Crossposted-To: comp.os.linux.development.system
Subject: Re: How to make a function memeber to be a sig. handler
Date: Fri, 31 Mar 2000 12:26:05 +0200

Boris Pran wrote:
> I was writing a simple program in C++ to talk to serial port and everything
> was OK until I wanted to make a function member to be a signal handler for
> SIGIO.

A member function in C++ gets as the first (implizit) paramter an instance 
pointer. So you can't use it as a signal handler. You could use a static 
function, if you really need a member function. 

HTH
        Mathias

------------------------------

From: Joaquín Cuenca Abela <[EMAIL PROTECTED]>
Subject: Re: .cpp to HTML?
Date: Fri, 31 Mar 2000 12:43:54 +0100

En el artículo <[EMAIL PROTECTED]>, Marc Britten <[EMAIL PROTECTED]> 
escribió:
> i know xemacs has something similar, so gnu emacs might too
> 
> if you use emacs this of course will be the better solution :)
> 
> open the buffer, turn on syntax highlighting, and meta-x htmlize-buffer
> enter
> 
> that will dump a html version of the syntacticly hightlighted code into
> a temp buffer, so ctrl-x ctrl-s to save
> 
> you can also htmlize-file where it asks you for the file name and saves
> it as filename.html there is also htmlize-many-files and
> htmlize-many-files-dired but I don't know much about those

And, of course, you can use a truly c++ to html converter.  See code2html
(http://www.cosy.sbg.ac.at/~ppalfrad/code2html/manual.html).

Good luck!


------------------------------


** FOR YOUR REFERENCE **

The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:

    Internet: [EMAIL PROTECTED]

You can send mail to the entire list (and comp.os.linux.development.apps) via:

    Internet: [EMAIL PROTECTED]

Linux may be obtained via one of these FTP sites:
    ftp.funet.fi                                pub/Linux
    tsx-11.mit.edu                              pub/linux
    sunsite.unc.edu                             pub/Linux

End of Linux-Development-Apps Digest
******************************

Reply via email to