Re: Logical device for openVMS implemented

"Igor V. Melichev" <[email protected]>
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <[email protected]>
Jouk,

I've tried to understand your change, and found it (the understanding) isn't
simple.
IMO the explanation to be improved.

1. You wrote : "the logical device (an environment variable) contains a
search list
of directories all ending on '.]'". What is "logical device" in this
sentence ?
Is it same as <logicaldevice> above ? From the code I guess it is not.
So what is it exactly ?

2. You coded :

    logical = getenv( buffer );

At this moment the buffer contains a file name prefix.
You consider it as a name for environment variable,
which (I guess) you assume to substitute the prefix.
This behavior is too different from one on other platforms.
Can you explain a reason why the GS behavior must be so different ?

3. (2) requires a clear explanation and change to GS documentation.
Actually I strongly against such change.

4. Where the magic constant ":[000000]" comes from ?

5. You wrote : "ending on '.]'". I recall it is a kind of wildcard on VMS,
which correspond to "/*" on Unix. Meanwhile gp_file_name_combine was not
intended
to process wildcards, and malfunctions if you pass a Postscript wildcard to
it on Windows.
I strongly against a processing of wildcards in gp_file_name_combine.
Instead that gp_file_name_combine is assumed to take a truncated path and
concatenate it with a relative path.

If you want to process wildcards, you should find a different place of code
for doing this.
Possibly the place is outside Ghostscript. In any case please first define
(in English) what must happen. For example, what is the result of combining
"\a\b*" and "\bc" : is it "\a\b*\bc" or "\a\bc" or else ?

Generally, I strongly against this patch.
Al least it requires a clarification and documentation.

Igor.



----- Original Message ----- 
From: "Jacob (=Jouk) Jansen" <[email protected]>
To: <[email protected]>
Sent: Monday, September 08, 2003 11:49 AM
Subject: [gs-code-review] Logical device for openVMS implemented


> Hi All,
>
> I would like to commit a patch to gp_vms.c (see below). This patch allows
> the access of files in subdirectories i.e. /Decoding/Unicode.
>
> To understand the patch one need to know a little on OpenVMS file syntax
> There are 3 possibilties:
>     1 : <device>:[<dir>.<subdir>.<subdir>]<filename>
>     2 : <logicaldevice>:[<dir>.<subdir>.<subdir>]<filename>
>     3 : <logicaldirectory>:<filename>
>
> case 1 is not implemented and I never saw this in gs.
> case 3 is the case that was implented up to now and is unaffected by the
>        patch. this is nesscesarry because sometimes sys$scratch a logical
>        defined by the system as logical directory is used. No
subdirectories
>        can be accessed in this mode.
>
>
> case 2 : the logical device (an environment variable) contains a search
list
>   of directories all ending on '.]' (this is checked). Note that to get
this
>   feature the logical GS_LIB should be addapted in the users definition.
>   I will put add remark on hoe to do this in doc/gp-vms.hlp
>
>
>
>                    Jouk
>
>
>
>
> ************
> File $DISK4:[JOUKJ.PUBLIC.GHOST.gs_2003_09_05.gs.src]gp_vms.c;32
>   574   char* logical;
>   575   int tmp_plen , llen , log_dev = 0;
>   576
> ******
> File $DISK5:[JOUKJ.CVS.GS.gs.src]gp_vms.c;16
>   574   int tmp_plen;
>   575
> ************
> ************
> File $DISK4:[JOUKJ.PUBLIC.GHOST.gs_2003_09_05.gs.src]gp_vms.c;32
>   590           buffer[ tmp_plen ] = 0;
>   591   logical = getenv( buffer );
>   592   llen = strlen( logical );
>   593   if ( llen > 1 )
>   594     {
>   595        if ( logical[ llen - 2 ] == '.' && logical[ llen - 1 ] ==
']' )
>   596          log_dev = 1;
>   597     }
>   598   if ( log_dev == 0 )
>   599     {
>   600        memcpy(buffer + tmp_plen , ":" , 1 );
>   601        llen = 1;
>   602     }
> ******
> File $DISK5:[JOUKJ.CVS.GS.gs.src]gp_vms.c;16
>   589   memcpy(buffer + tmp_plen , ":" , 1 );
>   590   memcpy(buffer + tmp_plen + 1, fname, flen);
>   591   if ( memchr( fname , '.' , flen ) != 0 )
>   592     {
>   593        buffer[ tmp_plen + flen + 1] = 0;
>   594        *blen = tmp_plen + flen + 1;
>   595     }
> ************
> ************
> File $DISK4:[JOUKJ.PUBLIC.GHOST.gs_2003_09_05.gs.src]gp_vms.c;32
>   605        if ( memchr( fname , ']' , flen ) == 0 )
>   606          {
>   607     memcpy(buffer + tmp_plen , ":[000000]" , 9 );
>   608     llen = 9;
>   609          }
>   610        else
>   611          {
>   612     memcpy(buffer + tmp_plen , ":[" , 2 );
>   613     llen = 2;
>   614          }
>   615     }
>   616   memcpy(buffer + tmp_plen + llen , fname, flen);
>   617   if ( memchr( fname , '.' , flen ) != 0 )
>   618     {
>   619        buffer[ tmp_plen + flen + llen ] = 0;
>   620        *blen = tmp_plen + flen + llen ;
>   621     }
>   622   else
>   623     {
>   624        memcpy(buffer + tmp_plen + flen + llen , "." , 1 );
>   625        buffer[ tmp_plen + flen + llen + 1 ] = 0;
>   626        *blen = tmp_plen + flen + llen + 1;
>   627     }
> ******
> File $DISK5:[JOUKJ.CVS.GS.gs.src]gp_vms.c;16
>   598        memcpy(buffer + tmp_plen + flen + 1 , "." , 1 );
>   599        buffer[ tmp_plen + flen + 2] = 0;
>   600        *blen = tmp_plen + flen + 2;
>   601     }
> ************
>
> Number of difference sections found: 3
> Number of difference records found: 36
>
> DIFFERENCES
/IGNORE=()/MERGED=1/OUTPUT=$DISK4:[JOUKJ.PUBLIC.GHOST.gs_2003_09_05.gs.src]m
ail.txt;1-
>     $DISK4:[JOUKJ.PUBLIC.GHOST.gs_2003_09_05.gs.src]gp_vms.c;32-
>     $DISK5:[JOUKJ.CVS.GS.gs.src]gp_vms.c;16
>
>
> Bush : All votes are equal but some votes are more equal than others.
>
>
>---------------------------------------------------------------------------
---<
>
>   Jouk Jansen
>
>   [email protected]
>
>   Technische Universiteit Delft        tttttttttt  uu     uu  ddddddd
>   Nationaal centrum voor HREM          tttttttttt  uu     uu  dd    dd
>   Rotterdamseweg 137                       tt      uu     uu  dd     dd
>   2628 AL Delft                            tt      uu     uu  dd     dd
>   Nederland                                tt      uu     uu  dd    dd
>   tel. 31-15-2782272                       tt       uuuuuuu   ddddddd
>
>
>---------------------------------------------------------------------------
---<
>
> _______________________________________________
> gs-code-review mailing list
> [email protected]
> http://www.ghostscript.com/mailman/listinfo/gs-code-review
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.