Re: input from keyboard
- From: "T.M. Sommers" <tms@xxxxxx>
- Date: Tue, 03 Oct 2006 13:30:07 -0400
Herbert Kleebauer wrote:
"T.M. Sommers" wrote:Herbert Kleebauer wrote:
I suppose he recognized, that Linux doesn't need another
assembler. What's needed are documentation and examples.
For example, I tried to find some information or examples
how to connect to the X server through /temp/.X11-unix/,
I assume that that is supposed to be a Unix domain socket, since
it does not exist on my system running X,
As I understood it, it should exist on any Unix system running X.
Which Unix version do you use?
FreeBSD. I checked again, and now it is there. It must have been there before; I don't know why I didn't see it. Yes, I used ls -a. (Of course, it is in /tmp, not /temp, but I assume that was a typo on your part). Note that .X11-unix is a directory; the socket you need to connect to is inside it.
If you really want to connect to it, you use the same socket functions as for connecting to a TCP socket, but you use a sockaddr_un structure, and the family is AF_LOCAL. There may be other differences in detail, too; I didn't look that closely. See Stevens's _Unix Network Programming_, vol 1.
and surely won't exist
on, say, a Windows host running an X server. The way to open a
I surely don't want to
write a program which runs in Linux and uses a Windows PC
for graphics output.
Why not? It can be a very useful setup; assuming you have two machines, of course. When I fire up my Solaris box, I almost always run X remotely.
And if you only use the local X server,
/temp/.X11-unix should be faster than TCP port 6000.
Yes, but I doubt you would notice a difference in practice. Anyway, XOpenDisplay() will use UDS for connecting to a display on the local machine.
display is through XOpenDisplay() (if you are sticking to Xlib).
I tried to compile a simple C program with only a few X commands,
link it statically to Xlib so I could disassemble it. But there
isn't even a Xlib.h on my Linux system (but /temp/.X11-unix
exists).
The X stuff might not be in /usr/include; on my BSD machine it is in /usr/X11R6. Where are your X libraries?
If you really don't have the include files, download them. Your life will be much easier. Also be sure you have the man pages.
If you try to get clever and bypass that route, then you are
just shooting yourself in the foot by restricting the systems on
which you can display your program.
I'm not sure what you want to say.
I was just restating what I said above. By manually connecting to the UDS, you prevent your program from being run remotely.
Can't I statically link the
Xlib code to my program because on every Linux system Xlib
uses different code?
Yes, you can statically link it. The Xlibs on different machines may indeed be different (they could be machines with different architectures, for instance). One of the reasons you use the libraries is so you don't have to worry about those things.
If I can do a static link, then I also
can write the linked code as part of the program myself and
don't use Xlib at all.
Why reimplement the wheel? Have you taken a look at the size of the X libraries? The reference manual alone is over 1100 pages. The only way a single person could reimplement it is to leave out most of it. What good is that?
I even tried to find the source code of Xlib. It should be
somewhere in the X11 tar file, but I couldn't find it.
It might be a binary-only tarball. Go directly to http://www.xfree86.org/ or the equivalent for whatever X implementation you use.
that you insist on avoiding standard interfaces and try to use
undocumented internals.
There are only two standard interfaces to the X server,
the TCP port and the /temp/.X11-unix.
By 'interface' I meant the API.
Xlib surely isn't a interface to the X server, it is only a wrapper which
uses the above two interfaces to communicate with the
X server.
I think it is more than just a wrapper. The X protocol is very low-level. For that matter, Xlib itself is low-level, but it does a lot of work beyond just wrapping the protocol. It doesn't have anything about diaglog boxes, for example, or scroll bars, or menus. If you want to have those things, you need a higher-level library, such as the X toolkit (Xt) (which is still pretty low), or a widget set such as Motif.
You would have even worse problems if
you tried to bypass the C interface to Windows and use its internals.
In Windows yes (because the int interface isn't documented), but
in Linux we have a documented int 80 interface,
No. The int 80 interface is not documented, not in the sense meant here. It is known about, because the source is open, and written about, but it is not documented. Show me one man page that mentions it.
--
Thomas M. Sommers -- tms@xxxxxx -- AB2SB
.
- Follow-Ups:
- Re: input from keyboard
- From: Charles A. Crayne
- Re: input from keyboard
- References:
- Re: input from keyboard
- From: Frank Kotler
- Re: input from keyboard
- From: Betov
- Re: input from keyboard
- From: Frank Kotler
- Re: input from keyboard
- From: Betov
- Re: input from keyboard
- From: Frank Kotler
- Re: input from keyboard
- From: Betov
- Re: input from keyboard
- From: Herbert Kleebauer
- Re: input from keyboard
- From: T.M. Sommers
- Re: input from keyboard
- From: Herbert Kleebauer
- Re: input from keyboard
- Prev by Date: Re: MIPS64
- Next by Date: Re: Assembler with C syntax?
- Previous by thread: Re: input from keyboard
- Next by thread: Re: input from keyboard
- Index(es):
Relevant Pages
|