473,322 Members | 1,431 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Writting Pluggins

Is there any way in C to write source which would make an executable
that excepted modifications. For instance say we have modable program
that excepts plugins. That starts with a menu.
1)Add 2)Subtract 0)Add Mod
::
When entering zero:
Mod Source
::(whatever.c or maybe .o would be better)

Say the mod we put in was to add a divide option to the main menu.
The program would then be:
1)Add 2)Subtract 3)Divide 0)Add Mod
::
In this mannor a program coud be written that could be updated by
makeing a plugin sortof like how in linux or some other *n*x system you
can use insmod. This doesn't seem to be system spasific to me. Infact
this doesn't even seem possible, however I am working on codeing a
mini-OS that would run on another by makeing its own filesystem which
just apears to the OS its running on as a large file. If anyone has
been following my posts this would make ALOT of sense. Thanks for the
help. If anyone is interested I'll post a link to my website when its
all done.
Nori

May 13 '06 #1
6 1449

<no*********@gmail.com> wrote in message
Is there any way in C to write source which would make an executable
that excepted modifications. For instance say we have modable program
that excepts plugins. That starts with a menu.
1)Add 2)Subtract 0)Add Mod
::
When entering zero:
Mod Source
::(whatever.c or maybe .o would be better)

Say the mod we put in was to add a divide option to the main menu.
The program would then be:
1)Add 2)Subtract 3)Divide 0)Add Mod
::
In this mannor a program coud be written that could be updated by
makeing a plugin sortof like how in linux or some other *n*x system you
can use insmod. This doesn't seem to be system spasific to me. Infact
this doesn't even seem possible, however I am working on codeing a
mini-OS that would run on another by makeing its own filesystem which
just apears to the OS its running on as a large file. If anyone has
been following my posts this would make ALOT of sense. Thanks for the
help. If anyone is interested I'll post a link to my website when its
all done.
Nori

The easy way is to modify the C source and recompile.

If you want to find out how to add scritping type capabilities so that users
can extend your system with arbitrary functions, with no recompile, check
out MiniBasic, on my website. Full compilable source is free. You can modify
it to your heart's content. If you want everything neatly together in a pdf
it costs $1.25, and you can have it printed and bound for a few dollars
more. (This is the wonder of Lulu).

If you want to produce a program that loads precompiled modules and plugs
them together, that isn't possible under standard C. Some operating systems
will let you do this, normally by providing what are known as dynamic
libraries. Try a newsgroup for your OS.

--
www.personal.leeds.ac.uk/~bgy1mm

May 13 '06 #2

<no*********@gmail.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
Is there any way in C to write source which would make an executable
that excepted modifications. For instance say we have modable program
that excepts plugins. That starts with a menu.
1)Add 2)Subtract 0)Add Mod
::
When entering zero:
Mod Source
::(whatever.c or maybe .o would be better)

Say the mod we put in was to add a divide option to the main menu.
The program would then be:
1)Add 2)Subtract 3)Divide 0)Add Mod
::
In this mannor a program coud be written that could be updated by
makeing a plugin sortof like how in linux or some other *n*x system you
can use insmod. This doesn't seem to be system spasific to me.
Oh, but it is. Most if not all operating systems control
what can and cannot be done to executable (or other types)
of files.
In fact
this doesn't even seem possible,


It might be on some platforms, but might not on others.

All that being said, standard C has no facilities
for doing this.

-Mike
May 13 '06 #3
On 2006-05-13, no*********@gmail.com <no*********@gmail.com> wrote:
Is there any way in C to write source which would make an executable
that excepted modifications. For instance say we have modable program
that excepts plugins. That starts with a menu.
1)Add 2)Subtract 0)Add Mod
::
When entering zero:
Mod Source
::(whatever.c or maybe .o would be better)

Say the mod we put in was to add a divide option to the main menu.
The program would then be:
1)Add 2)Subtract 3)Divide 0)Add Mod
::
In this mannor a program coud be written that could be updated by
makeing a plugin sortof like how in linux or some other *n*x system you
can use insmod. This doesn't seem to be system spasific to me. Infact
this doesn't even seem possible, however I am working on codeing a
mini-OS that would run on another by makeing its own filesystem which
just apears to the OS its running on as a large file. If anyone has
been following my posts this would make ALOT of sense. Thanks for the
help. If anyone is interested I'll post a link to my website when its
all done.
Nori


This simplest (and likely only portable) solution would be to have your
menu modifiable. So, your program would simply read something like
main.menu which would contain lines detailing what options you have and
what they do. You may want to make your own scripting language for that.

Self-modifiable code is impossible to do portably; the only system I've
used that would let me do so was a 286 (or later system in 16-bit
unprotected mode).
May 13 '06 #4
>If you want to find out how to add scritping type capabilities so that users
can extend your system with arbitrary functions, with no recompile, check
out MiniBasic, on my website. Full compilable source is free. You can modify
it to your heart's content. If you want everything neatly together in a pdf
it costs $1.25, and you can have it printed and bound for a few dollars
more. (This is the wonder of Lulu).


I'm not sure I understand how I would be able to impliment this. Is
there any chance that you can elaborate as to how I can use MiniBasic
to make it so that users could write pluggin style scripts that would
be used by the system. Reguardless I think I will include MiniBasic.
I have fooled around with it a bit and I like it. I will be sure to
give you credit for it.
Nori

May 13 '06 #5
<no*********@gmail.com> wrote in message
If you want to find out how to add scritping type capabilities so that
users
can extend your system with arbitrary functions, with no recompile, check
out MiniBasic, on my website. Full compilable source is free. You can
modify
it to your heart's content. If you want everything neatly together in a
pdf
it costs $1.25, and you can have it printed and bound for a few dollars
more. (This is the wonder of Lulu).


I'm not sure I understand how I would be able to impliment this. Is
there any chance that you can elaborate as to how I can use MiniBasic
to make it so that users could write pluggin style scripts that would
be used by the system. Reguardless I think I will include MiniBasic.
I have fooled around with it a bit and I like it. I will be sure to
give you credit for it.
Nori

You want some of the functionality in the program to be added by the user,
at run time, rather than the programmer, at compile time.

*****
That starts with a menu.
1)Add 2)Subtract 0)Add Mod
::
When entering zero:
Mod Source
::(whatever.c or maybe .o would be better)

Say the mod we put in was to add a divide option to the main menu.
The program would then be:
1)Add 2)Subtract 3)Divide 0)Add Mod
*****

So they way you would do this, using MiniBasic, would be to have a button
which the user can press. This give a field for the name of the function,
and a text box for the code to achieve it.

So the user would enter "divide".

The script is set up so that the two operands are input, and the result
output

10 INPUT numerator
20 INPUT denominator
30 PRINT numerator / denominator

This performs a divide.

When you call the function, you aet up two temporary streams, plus another
one for errors. You insert the two operands into the input stream, call the
function, and extract the result from the output stream. You then test it
for legality.

So the user can add absolutely any function that he is able to program in
BASIC.

Fool about with the program and see what you think.

--
www.personal.leeds.ac.uk/~bgy1mm

May 13 '06 #6
I will no doubt be including MiniBasic in my Mini-OS (slightly ironic).
Thank you for the further depth in explanataion. This combined with
another technique is exactly what I am looking for. This allowing for
the user to write their own scripts is an excellent feature. Your
MiniBasic saved me the time for writting a scripting language from
scatch. Again thanks for the help and the MiniBasic program which I
feel diserves some publicity. Anyway thats just me.
Nori
Malcolm wrote:
<no*********@gmail.com> wrote in message
If you want to find out how to add scritping type capabilities so that
users
can extend your system with arbitrary functions, with no recompile, check
out MiniBasic, on my website. Full compilable source is free. You can
modify
it to your heart's content. If you want everything neatly together in a
pdf
it costs $1.25, and you can have it printed and bound for a few dollars
more. (This is the wonder of Lulu).


I'm not sure I understand how I would be able to impliment this. Is
there any chance that you can elaborate as to how I can use MiniBasic
to make it so that users could write pluggin style scripts that would
be used by the system. Reguardless I think I will include MiniBasic.
I have fooled around with it a bit and I like it. I will be sure to
give you credit for it.
Nori

You want some of the functionality in the program to be added by the user,
at run time, rather than the programmer, at compile time.

*****
That starts with a menu.
1)Add 2)Subtract 0)Add Mod
::
When entering zero:
Mod Source
::(whatever.c or maybe .o would be better)

Say the mod we put in was to add a divide option to the main menu.
The program would then be:
1)Add 2)Subtract 3)Divide 0)Add Mod
*****

So they way you would do this, using MiniBasic, would be to have a button
which the user can press. This give a field for the name of the function,
and a text box for the code to achieve it.

So the user would enter "divide".

The script is set up so that the two operands are input, and the result
output

10 INPUT numerator
20 INPUT denominator
30 PRINT numerator / denominator

This performs a divide.

When you call the function, you aet up two temporary streams, plus another
one for errors. You insert the two operands into the input stream, call the
function, and extract the result from the output stream. You then test it
for legality.

So the user can add absolutely any function that he is able to program in
BASIC.

Fool about with the program and see what you think.

--
www.personal.leeds.ac.uk/~bgy1mm


May 14 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Hai Nguyen | last post by:
Hi everyone I'm writting a javascript for my validators. Some of them will be validated or server side, some of them will be validated on client side. Since I don't want to mix my javascript...
2
by: John Carnahan | last post by:
I have a problem writing the text from a multi-line textbox to the Sql Server db. If the user sends a vbcrlf (enter key) in the middle of the entered text, the text gets truncated at the vbcrlf...
1
by: Feng | last post by:
I have an ASP.Net app that is wrtting some log information into a log file. All I have is one single log file used by the web application and shared cross all the sessions. What I don't understand...
1
by: itsjyotika | last post by:
Hello Everyone, I need to read data from a CVS file(i created it from micosoft excel) and then need to match it with the one of the date from the command line.If the date is there then it should say...
6
by: Java1963 | last post by:
Need help with writting an application that prompt for and read a double value representing a monetary amount. -------------------------------------------------------------------------------- ...
1
by: rahulbsbs | last post by:
Sir how can i get the ip address of the remote system by writting a java code,ie i want to get ip address of the remote system that is connected to my server computer ,the ip address must be...
0
by: marinhof | last post by:
hi i need some guidance.. this is the situation im working on web app using Visual studio 2003 working with C# and asp.net the database is managed by sql studio managmnet 2005.. the thing is i...
0
by: paultervit | last post by:
Hello All First post here! I am currently looking into writting my own SMTP server for an application I have and to be honest I'm totally lost. Is this a difficult job as I can't seem to find...
2
by: Dinesh | last post by:
Hi experts, I am working on SQL Server 2005. Now i have to write a query which will extract some information from a table. My main table is having few columns supose 3 columns. EmpID ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.