create new tag
, view all tags
Wow, 8 days or so since I did anything. Well, I did print out xc/programs/Xserver/dix/main.c (without the copyright notices, just to save some trees).




  • Started skimming xc/programs/Xserver/dix/main.c Decided to look for some of the .h files. Found [some | all] of them in xc/include

  • Fooled around getting konqueror (3.0.3) set up to let me easily navigate between files. _=Window -> Load View Profile -> Midnight Commander= does not work as I might have expected -- if I navigate in one pane, the other pane goes to the same place. [[][Standard reasons why I won't file a bug, at least immediately.]] I forget which profile I am using — no doubt will learn more when I restart this effort, tomorrow or whenever.

  • It would be nice to be able to just jump from a symbol to its definition — maybe I should work harder at getting something better than konqueror to browse the code — I did find instructions on porting existing code into kdevelop. Yeah, as I go through X.h I can see that something like that will be important. I'll browse for a while, but I better get something like that setup.

Some types (I guess) to figure out:

from X.h

  • CARD32 — I saw this somewhere else
  • XID
  • typedef unsigned char KeyCode; I guess that's defining a type named KeyCode (rather than a variable named KeyCode)
  • there are some definitins like =#define ParentRelative 1L /* background pixmap in CreateWindow and ChangeWindowAttributes */ oh, now I see — ParentRelative is defined as 1L (1 stored as a long (int?) — and, IIRC, I can think of these as macros — if I see ParentRelative in the code, it is replaced by the value 1L.
  • Two useful event masks: #define KeyPressMask         (1L<<0) #define KeyReleaseMask         (1L<<1)

from Xos.h

  • Learn about string routines "index/rindex and strchr/strrchr"
  • #define index(s,c) (strchr((s),(c))) not #defined index(s,c) strchr(s,c) somebody might be using them (which??) as function pointers?? See Cpl Macros — not finished.
  • Looks like the standard header files (like malloc.h) are in /usr/include/. Is there a sys subdirectory there? Yup! So, that must be where <sys/select.h> is? Yup! And <netinet/in_systm.h> must be in another subdirectory, netinet? It appears so! So, I'm learning a little, at least. Is there a subdirectory X11 (for <X11/Xw32defs.h>)? Yup, but I don't see Xw32defs.h there??

So, what are:

  • __STDC__
  • SYSV

Where (and what) are:

  • extern char *sys_errlist[]; external = somewhere outside this program?? What's the difference between that and something like #include <strings.h> ?
  • extern int sys_nerr;

Lots of structs (with name at end).

Some unions — when does a union have "overlapping" (overlaid) data? (Is xReply a very long thingie, or a much shorter thingie with multiple data overlaid???) (Not even sure I know what I'm asking — I just know there are some circumstances where, in C (??), you can, for example, define one piece of data as an integer, another as a character, define them as the same memory location using a union (IIRC), and convert between them by referring to the char at one time and integer at another. (Maybe this could also be done in some other languages I've used (like Pascal), or maybe it can't be done in C — after all, C has all the casts??

Oops, wait, there are several unions there, one is an xevent which is always 32 bytes (from the comment in the file!!) — maybe that's enough of a clue.


  • () RandyKramer - 22 Apr 2003
  • If you edit this page: add your name here; move this to the next line; and if you've used a comment marker (your initials in parenthesis), include it before your WikiName.

Page Ratings

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2003-04-25 - RandyKramer
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by PerlCopyright 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding WikiLearn? WebBottomBar">Send feedback
See TWiki's New Look