Closed
Bug 72083
Opened 24 years ago
Closed 16 years ago
Need sample of XPCOM-in-C
Categories
(Core :: XPCOM, defect)
Core
XPCOM
Tracking
()
RESOLVED
WONTFIX
mozilla1.1alpha
People
(Reporter: shaver, Unassigned)
References
Details
Attachments
(1 file)
14.01 KB,
text/plain
|
Details |
<J-random-person-in-need-of-component-system> but XPCOM is only for C++
It doesn't have to be true. I'll make it untrue.
Reporter | ||
Comment 1•24 years ago
|
||
Oh yeah, baby.
Compile this little mama with:
gcc -o c_sample.o
gcc -shared -Wl,-h -Wllibcsample.so -o libcsample.so
Then copy her into your components directory. I play a little fast-and-loose
with QI and refcounting for some of the objects (module, factory), but it all
works well enough to let XPConnect create and manipulate it through nsISample.
Status: NEW → ASSIGNED
QA Contact: kandrot → shaver
Reporter | ||
Comment 2•24 years ago
|
||
Er, make that first line: gcc -c c_sample.c
(Obviously.)
Reporter | ||
Comment 3•24 years ago
|
||
Reporter | ||
Comment 4•24 years ago
|
||
With an xpidl mode for C, and some helpful macros, that might actually not be
completely unpleasant to work with. Certainly not much worse than CORBA-in-C,
and people actually do that.
The code as posted will work with gcc-2.96 on Linux. If you want to use another
compiler (gcc-3, say), you'll need to replace the crap1/crap2 placeholders in
nsISupports_vtbl. If you're on the Mac, you'll need to do something about
strdup, whose existance I arrogantly assume.
I don't do the correct thing with the allocator, either. Maybe later.
Target Milestone: --- → mozilla1.0
Comment 5•24 years ago
|
||
Cool. Now you can start working on nsAReadableString-in-C. ;-)
Reporter | ||
Comment 7•21 years ago
|
||
Need is so strong a word.
Assignee: shaver → nobody
Status: ASSIGNED → NEW
Updated•19 years ago
|
QA Contact: shaver → xpcom
Comment 8•16 years ago
|
||
Just say no.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•