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
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();
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.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 432 |
Nodes: | 16 (2 / 14) |
Uptime: | 29:22:49 |
Calls: | 9,081 |
Calls today: | 4 |
Files: | 13,409 |
Messages: | 6,022,004 |