Re: Can C #includes like this be made to work onVMS?

Liste des GroupesRevenir à co vms 
Sujet : Re: Can C #includes like this be made to work onVMS?
De : arne (at) *nospam* vajhoej.dk (Arne Vajhøj)
Groupes : comp.os.vms
Date : 16. Oct 2024, 00:48:41
Autres entêtes
Organisation : SunSITE.dk - Supporting Open source
Message-ID : <670eff59$0$705$14726298@news.sunsite.dk>
References : 1 2 3 4
User-Agent : Mozilla Thunderbird
On 10/15/2024 3:54 PM, Arne Vajhøj wrote:
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.
Demo:
$ type z*.c
DKA0:[arne]z1.c;1
#include "a/something.h"
DKA0:[arne]z2.c;1
#include "a/something.h"
DKA0:[arne]z3.c;1
#include "a/something.h"
$ type ab.com
$ loop:
$    fnm = f$search("z*.c")
$    if fnm .eqs. "" then goto endloop
$    define/user sys$input sys$command
$    edit/edt/comm=ab.edt 'fnm'
$    goto loop
$ endloop:
$ exit
$ type ab.edt
s\#include "a/\#include "b/\w
ex
$ @ab
...
$ type z*.c
DKA0:[arne]z1.c;2
#include "b/something.h"
DKA0:[arne]z2.c;2
#include "b/something.h"
DKA0:[arne]z3.c;2
#include "b/something.h"
$ type bc.com
$ loop:
$    fnm = f$search("z*.c")
$    if fnm .eqs. "" then goto endloop
$    define/user sys$input sys$command
$    edit/tpu/init=bc.eve 'fnm'
$    goto loop
$ endloop:
$ exit
$ type bc.eve
all replace "#include ""b/" "#include ""c/"
exit
$ @bc
...
$ type z*.c
DKA0:[arne]z1.c;3
#include "c/something.h"
DKA0:[arne]z2.c;3
#include "c/something.h"
DKA0:[arne]z3.c;3
#include "c/something.h"
$ type cd.com
$ loop:
$    fnm = f$search("z*.c")
$    if fnm .eqs. "" then goto endloop
$    define/user sys$input sys$command
$    edit/tpu/comm=cd.tpu 'fnm'
$    goto loop
$ endloop:
$ exit
$ type cd.tpu
eve_all_replace("#include ""c/", "#include ""d/");
eve_exit();
$ @cd
...
$ type z*.c
DKA0:[arne]z1.c;4
#include "d/something.h"
DKA0:[arne]z2.c;4
#include "d/something.h"
DKA0:[arne]z3.c;4
#include "d/something.h"
Arne
PS: Yes - both gawk and Perl can probably do it in way fewer lines.

Date Sujet#  Auteur
15 Oct 24 * Can C #includes like this be made to work onVMS?20Brian Schenkenberger
15 Oct 24 +- Re: Can C #includes like this be made to work onVMS?1mjos_examine
15 Oct 24 `* Re: Can C #includes like this be made to work onVMS?18John Dallman
15 Oct 24  `* Re: Can C #includes like this be made to work onVMS?17Brian Schenkenberger
15 Oct 24   +- Re: Can C #includes like this be made to work onVMS?1mjos_examine
15 Oct 24   +* Re: Can C #includes like this be made to work onVMS?13Arne Vajhøj
15 Oct 24   i+- Re: Can C #includes like this be made to work onVMS?1Arne Vajhøj
16 Oct 24   i`* Re: Can C #includes like this be made to work onVMS?11Arne Vajhøj
16 Oct 24   i `* Re: Can C #includes like this be made to work onVMS?10Arne Vajhøj
17 Oct 24   i  +* Re: Can C #includes like this be made to work on VMS?6Lawrence D'Oliveiro
17 Oct 24   i  i+* Re: Can C #includes like this be made to work on VMS?4Arne Vajhøj
17 Oct 24   i  ii`* Re: Can C #includes like this be made to work on VMS?3Lawrence D'Oliveiro
17 Oct 24   i  ii `* Re: Can C #includes like this be made to work on VMS?2Arne Vajhøj
17 Oct 24   i  ii  `- Re: Can C #includes like this be made to work on VMS?1Lawrence D'Oliveiro
17 Oct 24   i  i`- Re: Can C #includes like this be made to work on VMS?1Arne Vajhøj
17 Oct 24   i  `* Re: Can C #includes like this be made to work onVMS?3Craig A. Berry
17 Oct 24   i   `* Re: Can C #includes like this be made to work onVMS?2Arne Vajhøj
18 Oct 24   i    `- Re: Can C #includes like this be made to work onVMS?1Arne Vajhøj
16 Oct 24   +- Re: Can C #includes like this be made to work onVMS?1Craig A. Berry
16 Oct 24   `- Re: Can C #includes like this be made to work onVMS?1Mark Berryman

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal