LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-28-2003, 07:38 PM   #1
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Rep: Reputation: 32
Smile OS independant Plugins in C


Hello,
I have been looking around for a while. But I can't seem to find anything useful on the plugins. I want to have my program use plugins. I want to be able to include the programs main header in my plugin(s), and call any function or change any variable of the main program. Like this:

//--plugin.c
#include "main_program.h"

int plugin_main(int argc, char **argv)
{
int i;
for (i=1;i<argc;i++)
main_print(argv[i]);
global_int=0;
}

> compile plugin.c with gcc -c etc...

//--main_program.h

int global_int;

void main_print(char *);

//--main_program.c
#include <stdio.h>

void main_print(char *cpStr)
{
printf("%s", cpStr);
}

int main(int argc, char **argv)
{
/* Load plugin plugin.so...*/
/* Run plugin (plugin_main(argc, char **argv)) */
return 0;
}

>compile main_program.c with gcc once

If I haven't made myself clear: I don't want to have to recompile main_program for each plugin. I want to compile it once, and then make as many plugins as I need. How can I do this???

Thanks ahead of time.

The_Nerd
 
Old 10-28-2003, 08:10 PM   #2
Kurt M. Weber
Member
 
Registered: Oct 2003
Distribution: Slackware
Posts: 335

Rep: Reputation: 35
Umm...plugins for what?
 
Old 10-28-2003, 09:53 PM   #3
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Original Poster
Rep: Reputation: 32
Blender

Well...
Actually I was thinking of joining the Blender project (www.blender.org), and spiffing up the Blender plugins code (so Blender dosn't only do Textures and Sequence). I also just want to know.
I thirst for knowlage!
 
Old 10-29-2003, 02:30 PM   #4
The_Nerd
Member
 
Registered: Aug 2002
Distribution: Debian
Posts: 540

Original Poster
Rep: Reputation: 32
Does anyone know anything about this or should I try somewhere else?
Thanks.
 
Old 10-29-2003, 02:52 PM   #5
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
To see what you are asking about - seems like its platform independence to me -
try downloading the source for zlib from

www.zlib.org

I don't think plug-ins are what c programmers think those modules are called. I do not know, but it really doesn't matter. That may be why you've gotten so little repsonse.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting 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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
help me write a program to save independant music wearerowan General 10 09-12-2005 09:26 AM
structure independant manipulations ewt3y Linux - Newbie 1 08-15-2005 06:32 AM
Plugins Xios Linux - Software 1 02-07-2005 01:29 AM
two independant monitor on one box pawn-o-matic Linux - Laptop and Netbook 3 07-18-2004 01:12 AM
running programs independant to the virtual console Cubix Linux - Newbie 4 07-16-2003 02:48 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration