 |
 |
C question - modules?
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2002
Status:
Offline
|
|
I'm in the process of planning a simple web server I want to write and I want to make it extensible via modules the same way Apache is, so someone can code an extension to handle a certain data type and it can be dynamically loaded into the program at runtime. How, exactly, is this DONE? (Assume complete n00b experience when responding, thank you ;])
|
|
I offer strictly b2b web-based server-side enterprise solutions for growing e-business trusted content providers ;]
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status:
Offline
|
|
Originally posted by trusted_content:
I'm in the process of planning a simple web server I want to write and I want to make it extensible via modules the same way Apache is, so someone can code an extension to handle a certain data type and it can be dynamically loaded into the program at runtime. How, exactly, is this DONE? (Assume complete n00b experience when responding, thank you ;])
Apache is open source... why not download the source and take a look?
|
|
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2002
Status:
Offline
|
|
What do you think was the first thing I did?
The source is very pretty but I've had no luck finding what I'm looking for.
|
|
I offer strictly b2b web-based server-side enterprise solutions for growing e-business trusted content providers ;]
|
| |
|
|
|
 |
|
 |
|
Mac Elite
Join Date: May 2002
Status:
Offline
|
|
If this is going to be an OS X program, bundles are the way to go, but they're not particularly portable.
|
|
[vash:~] banana% killall killall
Terminated
|
| |
|
|
|
 |
|
 |
|
Forum Regular
Join Date: May 2001
Location: Oviedo, Floriduh USA
Status:
Offline
|
|
Originally posted by trusted_content:
I'm in the process of planning a simple web server I want to write and I want to make it extensible via modules the same way Apache is, so someone can code an extension to handle a certain data type and it can be dynamically loaded into the program at runtime. How, exactly, is this DONE? (Assume complete n00b experience when responding, thank you ;])
You would need to build an interpreter, at least, to determine what's going to be done. It's definitely not something for a n00b.
Why not just use Apache or another open source web server instead?
|
|
folding@home is good for you.
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Nov 2002
Status:
Offline
|
|
^^^ Simple answer really:
I'll never learn to code properly if I haven't reinvented a coupla wheels. I thought a simple web server would be a good learning project... I'm not aiming for apache here, I'm aiming for "WOW... i cant believe it does GET _and_ POST!!! omfg!!!!"
|
|
I offer strictly b2b web-based server-side enterprise solutions for growing e-business trusted content providers ;]
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Jan 2001
Location: Boulder, CO, USA
Status:
Offline
|
|
er. i've never done a plug-in architecture, and it's been a while since i was looking at runtime loading and stuff, but the mile-high view is something like this:
there's a run-time environment on whatever OS you're using. on OS X the native system is the dyld runtime or whatever. uses the Mach-O format executable. (or was that the other way round ...) its job is to load executable code into memory and prep it to be run. you can usually explicitly ask this system to load a particular shared library while your app is running and then query the functions that library exports. "does library Foo have a function called 'parseContent' that takes a long and a char*?" for example. from there you can get pointers to those entry points and off you go.
i don't know if there's a *nix-standard way of doing this kind of thing. committing to Bundles would certainly make your life easier. i dunno, ProjectBuilder might actually have some plugin template stuff lying around? (i'm a Codewarrior guy, myself.)
is that sort of what you meant? i figured this couldn't be any less helpful than the other responses you've gotten so far. 
|
|
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|