[Prev][Next][Index][Thread]

Re: xwindow in oskit




> Could you point me to this ?  Manuals are nice, but what I really
> need is some good example code of how to use osenv and COM ---
> hopefully as simple as possible.

The console wrappers are pretty simple:

  oskit/kern/x86/pc/{gdb,direct}_console.c

All these do is wrap a COM layer around some plain old C code.

They are a mildly unusual in that the objects are statically allocated
(there is only one console).  If you want to see examples of COM
wrappers that do dynamic allocation, you could look at the hpfq
(oskit/hpfq/hpfq.c) or the memfs (oskit/memfs/memfs_com.c - which has
an unusually complex reference counting mechanism).  Sadly, both these
examples contain both COM wrapper code and the "worker" code in the
same file so you can't see the separation as clearly.  The trick I've
learnt is to look for the macro "OSKIT_COMDECL_*" in the header of a
function: if it's there, this is a "COM wrapper", if it's not there,
it's "worker code".


Alastair

ps I know this doesn't completely answer your question but hopefully
it's a start?


Follow-Ups: References: