[Info-vax] proper format for JPEG files

Richard Maher maher_rj at hotspamnotmail.com
Mon Aug 1 09:39:08 EDT 2011


Hi Phillip,

"Phillip Helbig---undress to reply" <helbig at astro.multiCLOTHESvax.de> wrote 
in message news:j0f8q6$b1b$1 at online.de...
> What is the "proper" format for JPEG files on VMS, in particular if they
> are served by a web server and displayed in a web browser?  I have some
> which are
>
>   Record format:      Fixed length 512 byte records
>   Record attributes:  None
>
> and some which are
>
>   Record format:      Stream_LF, maximum 0 bytes, longest 32767 bytes
>   Record attributes:  Carriage return carriage control
>
> and both work.  (The former were transferred via FTP from a Windows
> system (sorry, I don't have a VMS machine with a DVD reader) and the
> latter saved from the web via a web browser.)
>

FWIW, the Tier3 Applet Uploader sets the FAC=BIO and the FOP=UFO and I was 
about to jump up and down and say I/others need STREAM (not STREAM_LF) but 
then I see that Fixed-Length 512 byte records are perfectly acceptable as 
well.

See below for more detail (or ask in 
http://h30499.www3.hp.com/t5/Languages-and-Scripting/bd-p/itrc-291 and I can 
leave a formatted copy :-) but basically I was looking for the absolute 
fastest way to get an Applet/SWF/JS or HTML file down the line. I too am 
limited to a buffer size of 32768 but I think that was more to do with _BG: 
$QIO limitations than new big i/o disk-driver functionality.

Anyway, I still opt for STREAM even though I can't remember why at the 
moment. Maybe because TCP/IP is a stream-oriented protocol and although I 
love DECnet record-boundries there's just not many of them around :-(

Just grab that big bag o' bytes that is the file and pump it down the wire 
as quickly as possible! Least number of asynchronous disk/net I/Os possible 
and don't ask RMS or anyone else for implicit delimiters or metadata. If it 
ain't on the disk then it ain't!

Cheers Richard Maher

;+
;************************************************************************************
;* 
*
;*              COPYRIGHT BY TIER3 SOFTWARE LTD. ALL RIGHTS RESERVED. 
*
;* 
*
;*    THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED 
ONLY    *
;*    IN ACCORDANCE  WITH THE TERMS AND CONDITIONS OF SUCH LICENSE AND  WITH 
THE    *
;*    THE INCLUSION  OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE  OR ANY 
OTHER    *
;*    COPIES  THEREOF MAY NOT  BE PROVIDED  OR OTHERWISE MADE AVAILABLE  TO 
ANY    *
;*    OTHER  PERSON.  NO  TITLE TO  AND OWNERSHIP  OF  THE  SOFTWARE  IS 
HEREBY    *
;*    TRANSFERRED. 
*
;* 
*
;*    THE INFORMATION  IN THIS SOFTWARE  IS SUBJECT TO CHANGE WITHOUT NOTICE 
AND    *
;*    SHOULD NOT BE CONSTRUED AS A COMMITMENT BY TIER3 SOFTWARE LTD. 
*
;* 
*
;************************************************************************************
;-
            .title          T3$APP_LDR_DEF - Applet Loader external data
;           .author         Richard Maher

            .library        /sys$library:lib.mlb/
;+
;           $library/create/macro inet.mlb sys$library:ucx$inetdef
;-
            .library        /inet/

            $inetsymdef     GLOBAL
            $siocdef        GLOBAL
            $inetacpfsymdef GLOBAL
            $inetacpsymdef  GLOBAL
            $ineterrdef     GLOBAL
            $lnmdef         GLOBAL
            $psldef         GLOBAL
            $prvdef         GLOBAL
            $opcdef         GLOBAL
            $opcmsg         GLOBAL
            $xabitmdef      GLOBAL
            $libvmdef
            $iodef
            $ssdef

            max_node_len         =        6
            enable               =        1
            disable              =        0
            line_feed            =       10
            space                =       32
            open_arg_cnt         =        9
            dir_flag_offset      =       48

            io_readnowait        ==       <io$_readvblk!io$m_nowait>
            io_listen            ==       <io$_access!io$m_accept>
            io_close             ==       <io$_deaccess!io$m_shutdown>
            acp_gethostentbyname ==       <inetacp$c_hostent_offset * 256 + 
inetacp_func$c_gethostbyname>
            acp_gethostbyaddr    ==       <inetacp$c_trans          * 256 + 
inetacp_func$c_gethostbyaddr>
            io_block_size        ==       16

            .psect 
sndopr_msgbuf,nopic,ovr,rel,gbl,long,noshr,noexe,rd,wrt
            .byte           opc$_rq_rqst
            .blkb              3
            .long              0
            .blkb            255

            .psect 
socket_area,nopic,ovr,rel,gbl,long,noshr,noexe,rd,wrt
listen_chan:.word              0
accept_chan:.word              0
accept_cond:.word              0
            .blkb              6
addr_dom:   .word              0
port_number:.word              0
host_addr:  .long              0
            .blkb              8
rsn_len:    .long              0

            .psect 
t3$ldr_zone,nopic,ovr,rel,gbl,long,noshr,noexe,rd,wrt
zone_id:    .long           0

            .psect 
zone_flags,nopic,ovr,rel,gbl,long,noshr,noexe,rd,wrt
            .long           <lib$m_vm_get_fill0!lib$m_vm_extend_area>

            .psect          t3$$data,pic,con,rel,lcl,noshr,noexe,rd,wrt,quad

suc_rec:
file_chan:   .word          0
file_ffb:    .word          0
file_ebk:    .long          0
file_esl:    .long          0
type_len:    .long          0
type_offset: .long          0

free_bytes:  .blkl          1
free_addr:   .blkl          1

            .psect          t3$$code,pic,con,rel,lcl,shr,exe,rd,nowrt,quad

            .call_entry     home_args=false,    -
                            label=t3$$open_file

             cmpb           (ap),#open_arg_cnt
             bgeq           10$
             movzwl         #ss$_insfarg,r0
             ret

10$:         movl          4(ap),r5                       ; FAB address
             movb          #fab$c_bid,fab$b_bid(r5)
             movb          #fab$c_bln,fab$b_bln(r5)
             movl          8(ap),r6                       ; NAM address
             movb          #nam$c_bid,nam$b_bid(r6)
             movb          #nam$c_bln,nam$b_bln(r6)
             movl          r6,fab$l_nam(r5)
             movl          12(ap),r4                      ; FHCXAB address
             movb          #xab$c_fhc,xab$b_cod(r4)
             movb          #xab$c_fhclen,xab$b_bln(r4)
             movl          r4,fab$l_xab(r5)
             movl          16(ap),r7                      ; ITMXAB address
             movb          #xab$c_itm,xab$b_cod(r7)
             movb          #xab$c_itmlen,xab$b_bln(r7)
             movb          #xab$k_sensemode,xab$b_mode(r7)
             movl          r7,xab$l_nxt(r4)
             movl          20(ap),nam$l_esa(r6)           ; Result area
             movb          #nam$c_maxrss,nam$b_ess(r6)
             movb          #nam$m_synchk,nam$b_nop(r6)    ; No I/O for parse
             movl          24(ap),fab$l_fna(r5)           ; Input Filename
             movb          28(ap),fab$b_fns(r5)           ; and size
             movl          32(ap),xab$l_itemlist(r7)      ; fch$m_directory
             movl          36(ap),fab$l_ctx(r5)           ; Setup Link_Item

             $parse        fab=r5
             blbc          r0,90$

             bitl 
          #<nam$m_node!nam$m_wildcard!nam$m_search_list>, -
                            nam$l_fnb(r6)                 ; Local files only 
and no wildcards
             beqlu          20$
             movl           #rms$_syn,fab$l_sts(r5)
             clrl           fab$l_stv(r5)
             brw            90$

20$:         movb          #fab$m_bio,fab$b_fac(r5)
             movl          #<fab$m_ufo!fab$m_asy>,fab$l_fop(r5)
             movb          #<fab$m_upi!fab$m_shrget>,fab$b_shr(r5)

             $open         fab=r5, -
                           err=g^t3$$open_err, -
                           suc=g^t3$$open_suc
             ret

90$:         $dclast_s      astadr=g^t3$$open_err, -
                            astprm=r5
             blbc           r0,99$
             movl           #rms$_pending,r0
             ret

99$:         pushl          r0
             calls          #1,g^lib$stop
             ret

            .call_entry     home_args=false,    -
                            label=t3$$open_err

             movl           4(ap),r5
             pushal         fab$l_stv(r5)
             pushal         fab$l_sts(r5)
             movl           fab$l_nam(r5),r4
             tstb           nam$b_esl(r4)
             beqlu          10$
             movzbl         nam$b_esl(r4),file_esl
             pushal         file_esl
             pushl          nam$l_esa(r4)
             brb            20$
10$:         movzbl         fab$b_fns(r5),file_esl
             pushal         file_esl
             pushl          fab$l_fna(r5)
20$:         pushl          fab$l_ctx(r5)
             calls          #5,g^file_error

             pushl          r5
             calls          #1,g^t3$$free_fab

             ret

            .call_entry     home_args=false,    -
                            label=t3$$open_suc

             movl           4(ap),r5
             movw           fab$l_stv(r5),file_chan

             movl           fab$l_xab(r5),r4
             movw           xab$w_ffb(r4),file_ffb
             movl           xab$l_ebk(r4),file_ebk

             movl           fab$l_nam(r5),r4
             movzbl         nam$b_esl(r4),file_esl
             movzbl         nam$b_type(r4),type_len
             subl3          nam$l_esa(r4),nam$l_type(r4),type_offset
             incl           type_offset

             tstl           file_ebk
             bnequ          10$
             movl           #rms$_eof,fab$l_sts(r5)
             brw            90$

10$:         cmpb           fab$b_org(r5),#fab$c_seq
             beqlu          20$
             movl           #rms$_org,fab$l_sts(r5)
             brw            90$

20$:         tstl           type_len
             bnequ          30$
             movl           #rms$_typ,fab$l_sts(r5)
             brw            90$

30$:         movl           fab$l_ctx(r5),r6
             tstl           dir_flag_offset(r6)
             beqlu          40$
             movl           #rms$_prv,fab$l_sts(r5)
             brw            90$

40$:         pushl          nam$l_esa(r4)
             pushal         suc_rec
             pushl          r6
             calls          #3,g^file_opened

             pushl          r5
             calls          #1,g^t3$$free_fab

             ret

90$:         $dassgn_s      chan=fab$l_stv(r5)
             blbc           r0,99$

             clrl           fab$l_stv(r5)
             $dclast_s      astadr=g^t3$$open_err, -
                            astprm=r5
             blbc           r0,99$

             ret

99$:         pushl          r0
             calls          #1,g^lib$stop

             ret

            .call_entry     home_args=false,    -
                            label=t3$$free_fab

             movl           4(ap),r5

             pushal         zone_id
             pushal         fab$l_nam(r5)
             movzbl         #nam$c_bln,free_bytes
             pushal         free_bytes
             calls          #3,g^lib$free_vm
             blbc           r0,99$

             pushal         zone_id
             movl           fab$l_xab(r5),r6
             pushal         xab$l_nxt(r6)
             movzbl         #xab$c_itmlen,free_bytes
             pushal         free_bytes
             calls          #3,g^lib$free_vm
             blbc           r0,99$

             pushal         zone_id
             pushal         fab$l_xab(r5)
             movzbl         #xab$c_fhclen,free_bytes
             pushal         free_bytes
             calls          #3,g^lib$free_vm
             blbc           r0,99$

             pushal         zone_id
             movl           r5,free_addr
             pushal         free_addr
             movzbl         #fab$c_bln,free_bytes
             pushal         free_bytes
             calls          #3,g^lib$free_vm
             blbc           r0,99$

             ret

99$:         pushl          r0
             calls          #1,g^lib$stop

            .end 





More information about the Info-vax mailing list