B
Brian C
Hello all,
I have a text based program that uses curses for it's interface. I
originally made this program becase my bosses are mostly mainframe
COBOL/CICS people, and are not familiar with UNIX.
It, however, expanded beyond how I envisioned it at the get-go (go
figure). My original idea was just start/stop processes, and run various
scripts, displaying the output, etc. As things got added, it became
clear that it was a maintenance nightmare. Why?
1) They requested it be put onto other servers that run software other
than mine.
2) We moved some processes onto other accounts, therefore, one account
can't start/stop another, etc.
Basically, I needed to maintain seperate config files for the
program telling it which processes it could start/stop, then you add in
the mix the test/production figure. Some config file lines went over 2k,
which my bosses didn't want my SysAdmin to change the limit, fine. Btw,
I used a Windows INI type text file as the config, i.e.
[ProcessName]
Blah1=abc
Halb2=123
So, basically, I overestimated my current project on purpose. It did
require a new function in the program (a shared memory table editor) for
this new server (I have other shared memory table editors already).
I've made this new program still use the Windows INI file model, but
included "ranges" (i.e. ListRange=26 .... List1=A's, List2=B's,
List26=Z's, etc). I've also put on each menu Allow & Block for user ID's
& hostname's, so they don't display if you dont have access. This all
allows one config file for test or production with multiple boxes
considered.
So, long story short, I'm wondering if there is a way, since I do
not recall there is, that you can take a char[] and call it is as a
function. Yes, I know you can have pointers to functions, but if I have:
char String[]="MyFunction";
Is it possible to reference string to call what it contains (i.e.
MyFunction() ?)
Thanks.
I have a text based program that uses curses for it's interface. I
originally made this program becase my bosses are mostly mainframe
COBOL/CICS people, and are not familiar with UNIX.
It, however, expanded beyond how I envisioned it at the get-go (go
figure). My original idea was just start/stop processes, and run various
scripts, displaying the output, etc. As things got added, it became
clear that it was a maintenance nightmare. Why?
1) They requested it be put onto other servers that run software other
than mine.
2) We moved some processes onto other accounts, therefore, one account
can't start/stop another, etc.
Basically, I needed to maintain seperate config files for the
program telling it which processes it could start/stop, then you add in
the mix the test/production figure. Some config file lines went over 2k,
which my bosses didn't want my SysAdmin to change the limit, fine. Btw,
I used a Windows INI type text file as the config, i.e.
[ProcessName]
Blah1=abc
Halb2=123
So, basically, I overestimated my current project on purpose. It did
require a new function in the program (a shared memory table editor) for
this new server (I have other shared memory table editors already).
I've made this new program still use the Windows INI file model, but
included "ranges" (i.e. ListRange=26 .... List1=A's, List2=B's,
List26=Z's, etc). I've also put on each menu Allow & Block for user ID's
& hostname's, so they don't display if you dont have access. This all
allows one config file for test or production with multiple boxes
considered.
So, long story short, I'm wondering if there is a way, since I do
not recall there is, that you can take a char[] and call it is as a
function. Yes, I know you can have pointers to functions, but if I have:
char String[]="MyFunction";
Is it possible to reference string to call what it contains (i.e.
MyFunction() ?)
Thanks.