Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > C question - modules?

C question - modules?
Thread Tools
Dedicated MacNNer
Join Date: Nov 2002
Status: Offline
Reply With Quote
Apr 5, 2003, 10:31 PM
 
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
Reply With Quote
Apr 7, 2003, 10:08 AM
 
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
Reply With Quote
Apr 7, 2003, 12:45 PM
 
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
Reply With Quote
Apr 7, 2003, 06:38 PM
 
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
Reply With Quote
Apr 9, 2003, 09:10 PM
 
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
Reply With Quote
Apr 11, 2003, 01:06 AM
 
^^^ 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
Reply With Quote
Apr 11, 2003, 05:27 PM
 
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.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:21 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2