Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 42 |
Nodes: | 6 (0 / 6) |
Uptime: | 02:01:01 |
Calls: | 220 |
Calls today: | 1 |
Files: | 824 |
Messages: | 121,544 |
Posted today: | 6 |
On 2024-10-15 19:15:00 +0000, John Dallman said:
In article <vemd23$1qdt1$1@dont-email.me>, mail@SendSpamHere.ORG (Brian
Schenkenberger) wrote:
I want to port a freeware package. It's C code is littered with
includes like:
#include "package_name/include_file.h"
I've tried the DECC$***_INCLUDE logicals, the CC command quilifier
/INCLUDE_DIRECTORY and logicals, rooted and otherwise, defining
"package_name". Can't get the C compiler to find include_file.h.
Don't try to define "package name". General C practice is to regard that
as a directory name that the compiler should look for, used to collect
specific headers together.
Instead, try using the various ways of specifying where you want include
files to be read from to indicate the directory that holds the
"package_name" directory.
The compiler should look for the directory called "package_nane" and the
"include_file.h" within it.
In the distribution, the includes are in a directory:
[package_name.INCLUDE]
and the source is in [package_name.SRC]
I am hoping not to have to edit all of the sources to change the
#include "..."s.
I want to port a freeware package. It's C code is littered with
includes like:
#include "package_name/include_file.h"
I've tried the DECC$***_INCLUDE logicals, the CC command quilifier /INCLUDE_DIRECTORY and logicals, rooted and otherwise, defining "package_name". Can't get the C compiler to find include_file.h.
On 10/15/2024 3:21 PM, Brian Schenkenberger wrote:
On 2024-10-15 19:15:00 +0000, John Dallman said:
In article <vemd23$1qdt1$1@dont-email.me>, mail@SendSpamHere.ORG (Brian
Schenkenberger) wrote:
I want to port a freeware package. It's C code is littered with
includes like:
#include "package_name/include_file.h"
I've tried the DECC$***_INCLUDE logicals, the CC command quilifier
/INCLUDE_DIRECTORY and logicals, rooted and otherwise, defining
"package_name". Can't get the C compiler to find include_file.h.
Don't try to define "package name". General C practice is to regard that >>> as a directory name that the compiler should look for, used to collect
specific headers together.
Instead, try using the various ways of specifying where you want include >>> files to be read from to indicate the directory that holds the
"package_name" directory.
The compiler should look for the directory called "package_nane" and the >>> "include_file.h" within it.
In the distribution, the includes are in a directory:
[package_name.INCLUDE]
and the source is in [package_name.SRC]
I am hoping not to have to edit all of the sources to change the
#include "..."s.
$ define package_name [package_name.INCLUDE]
should work.
$ cc/include will not work with this weird setup. If you changed the
includes to be:
#include "include_file.h"
or:
#include "package_name/include/include_file.h" or
then it would work.
Writing some DCL that does an edit/edt/comm with a substitute on
all .c files in a directory tree is not that hard to write.
In the distribution, the includes are in a directory:
[package_name.INCLUDE]
and the source is in [package_name.SRC]
I am hoping not to have to edit all of the sources to change the
#include "..."s.
On 2024-10-15 19:15:00 +0000, John Dallman said:
In article <vemd23$1qdt1$1@dont-email.me>, mail@SendSpamHere.ORG (Brian
Schenkenberger) wrote:
I want to port a freeware package. It's C code is littered with
includes like:
#include "package_name/include_file.h"
I've tried the DECC$***_INCLUDE logicals, the CC command quilifier
/INCLUDE_DIRECTORY and logicals, rooted and otherwise, defining
"package_name". Can't get the C compiler to find include_file.h.
Don't try to define "package name". General C practice is to regard that
as a directory name that the compiler should look for, used to collect
specific headers together.
Instead, try using the various ways of specifying where you want include
files to be read from to indicate the directory that holds the
"package_name" directory.
The compiler should look for the directory called "package_nane" and the
"include_file.h" within it.
John
In the distribution, the includes are in a directory:
[package_name.INCLUDE]
and the source is in [package_name.SRC]
I am hoping not to have to edit all of the sources to change the
#include "..."s.
$ type bc.eve
all replace "#include ""b/" "#include ""c/"
exit
$ type cd.tpu
eve_all_replace("#include ""c/", "#include ""d/");
eve_exit();
procedure eve_all_replace(fndstr,rplstr)
local fnd_string,
rpl_string, pos_mark, count_integer;
if not (eve$prompt_string(fndstr,fnd_string,"Old string: ",
"No old string given")) then
return;
On Wed, 16 Oct 2024 18:44:44 -0400, Arne Vajhøj wrote:
procedure eve_all_replace(fndstr,rplstr)
local fnd_string,
rpl_string, pos_mark, count_integer;
if not (eve$prompt_string(fndstr,fnd_string,"Old string: ",
"No old string given")) then
return;
When DEC introduced TPU/EVE, I raised my arms to the heavens in joy at finally being liberated from the suffering that was EDT. (Hate EDT. Hate, hate, hate.)
Then I left it behind with VMS ... and a few decades later, finally found
the time to get to grips with Emacs.
In Emacs/ELisp, there is the distinction between a “function” (what TPU would call a “procedure”, I guess) and a “command”. A “function” only
becomes a “command” when you insert the “(interactive ...)” directive near
its start. This is a declarative construct that supplies the information Emacs uses to obtain the right arguments for the function automatically, including prompting the user as necessary, so your code doesn’t have to.
When DEC introduced TPU/EVE, I raised my arms to the heavens in joy at finally being liberated from the suffering that was EDT. (Hate EDT. Hate, hate, hate.)
On Wed, 16 Oct 2024 19:26:52 -0400, Arne Vajhøj wrote:
* command FOOBAR ARG ! the EVE_ prefix makes it a command
But you still had to call eve$prompt_string and all that jazz.
* command FOOBAR ARG ! the EVE_ prefix makes it a command
On 10/16/2024 7:38 PM, Lawrence D'Oliveiro wrote:
On Wed, 16 Oct 2024 19:26:52 -0400, Arne Vajhøj wrote:
* command FOOBAR ARG ! the EVE_ prefix makes it a command
But you still had to call eve$prompt_string and all that jazz.
TPU is a procedural language.
On 10/16/24 5:44 PM, Arne Vajhøj wrote:
On 10/15/2024 7:48 PM, Arne Vajhøj wrote:
$ type bc.eve
all replace "#include ""b/" "#include ""c/"
exit
$ type cd.tpu
eve_all_replace("#include ""c/", "#include ""d/");
eve_exit();
Just realized that one is custom not standard.
procedure eve_all_replace(fndstr,rplstr)
eve_all_replace may be custom, but as far as I know eve_global_replace
is standard.
Here's an example of using TPU as a poor man's Perl:
$ edit/tpu/nodisplay/noinitialization -
/section=sys$library:eve$section.tpu$section -
/command=sys$input/output=myfile.txt myfile.txt
input_file := GET_INFO (COMMAND_LINE, "file_name");
main_buffer:= CREATE_BUFFER ("main", input_file);
POSITION (BEGINNING_OF (main_buffer));
eve_global_replace("foo","bar");
out_file := GET_INFO (COMMAND_LINE, "output_file");
WRITE_FILE (main_buffer, out_file);
quit;
^Z
But yeah, Perl is way easier:
$ perl -pi -e "s/foo/bar/g;" myfile.txt
On 10/15/2024 7:48 PM, Arne Vajhøj wrote:
$ type bc.eve
all replace "#include ""b/" "#include ""c/"
exit
$ type cd.tpu
eve_all_replace("#include ""c/", "#include ""d/");
eve_exit();
Just realized that one is custom not standard.
!
! Replace all occurences of string with another string (without
! confirm).
!
! High-level.
!
procedure eve_all_replace(fndstr,rplstr)
local fnd_string,
rpl_string,
pos_mark,
count_integer;
if not (eve$prompt_string(fndstr,fnd_string,"Old string: ",
"No old string given")) then
return;
endif;
if not (eve$prompt_string(rplstr,rpl_string,"New string ",
"No new string given")) then
return;
endif;
pos_mark:=mark(none);
set (screen_update, off); eve$all_replace(fnd_string,rpl_string,count_integer);
position (pos_mark);
set (screen_update, on);
delete (pos_mark);
message("Total of "+str(count_integer)+" replaces");
endprocedure;
!
! Replace all occurences of string with another string (without
! confirm).
!
! Low-level.
!
procedure eve$all_replace(fndstr,rplstr,count)
local find_mark;
position (beginning_of(current_buffer));
count:=0;
loop
find_mark:=search_quietly(fndstr, forward);
exitif find_mark = 0;
count:=count+1;
position (find_mark);
copy_text (rplstr);
erase_character (length(fndstr));
endloop;
endprocedure;
On 10/16/2024 9:34 PM, Craig A. Berry wrote:
On 10/16/24 5:44 PM, Arne Vajhøj wrote:
On 10/15/2024 7:48 PM, Arne Vajhøj wrote:
$ type bc.eve
all replace "#include ""b/" "#include ""c/"
exit
$ type cd.tpu
eve_all_replace("#include ""c/", "#include ""d/");
eve_exit();
Just realized that one is custom not standard.
procedure eve_all_replace(fndstr,rplstr)
eve_all_replace may be custom, but as far as I know eve_global_replace
is standard.
Yes - it is.
I wonder why I have that eve_all_replace.