VMS port of libssh2 including VMS specific build procedures
This commit is contained in:
parent
28ef62be20
commit
ad1ec1c9e4
124
vms/libssh2_make_example.dcl
Normal file
124
vms/libssh2_make_example.dcl
Normal file
@ -0,0 +1,124 @@
|
||||
$!
|
||||
$!
|
||||
$ olddir = f$environment("default")
|
||||
$ on control_y then goto YExit
|
||||
$!
|
||||
$ gosub Init
|
||||
$ if .not. init_status then goto YExit
|
||||
$!
|
||||
$ if what .eqs. "ALL"
|
||||
$ then
|
||||
$ call MakeAll
|
||||
$ else
|
||||
$ call Make
|
||||
$endif
|
||||
$!
|
||||
$YExit:
|
||||
$ set noon
|
||||
$! deassign exadir
|
||||
$! deassign objdir
|
||||
$ delete 'link_opts';*
|
||||
$ set default 'olddir'
|
||||
$exit
|
||||
|
||||
$MakeAll: subroutine
|
||||
$!
|
||||
$ set noon
|
||||
$Loop:
|
||||
$ this = f$search("exadir:*.c;0")
|
||||
$ if this .eqs. "" then goto EndLoop
|
||||
$!
|
||||
$ what = f$parse( this,,,"name")
|
||||
$ call Make
|
||||
$!
|
||||
$ goto Loop
|
||||
$EndLoop:
|
||||
$!
|
||||
$exit
|
||||
$endsubroutine
|
||||
|
||||
|
||||
$Make: subroutine
|
||||
$!
|
||||
$ set noon
|
||||
$!
|
||||
$ cc 'cc_include' 'cc_flags'/object=objdir:'what' exadir:'what'
|
||||
$ sev = $severity
|
||||
$ if sev .and. 2
|
||||
$ then
|
||||
$ say "Error compiling ''what', not linked."
|
||||
$ else
|
||||
$ if .not. (sev .and. 1)
|
||||
$ then
|
||||
$ say "Compile warnings in ''what'"
|
||||
$ endif
|
||||
$ link/exe='what'.exe objdir:'what'.obj, 'link_opts'/opt
|
||||
$ endif
|
||||
$!
|
||||
$!
|
||||
$End:
|
||||
$ delete objdir:'what'.obj;*
|
||||
$exit
|
||||
$endsubroutine
|
||||
|
||||
|
||||
$Init:
|
||||
$!
|
||||
$!
|
||||
$ init_status = 1
|
||||
$ thisid = f$integer( %x'f$getjpi(0,"pid")') + "''f$cvtime(,,"second")'"
|
||||
$ mdir = f$environment("procedure")
|
||||
$ mdir = mdir - f$parse(mdir,,,"name") - f$parse(mdir,,,"type") - f$parse(mdir,,,"version")
|
||||
$ set default 'mdir'
|
||||
$!
|
||||
$ objdir = "[.example_objects]"
|
||||
$ exadir = "[-.example]"
|
||||
$!
|
||||
$ objdirfile = objdir - "[." - "]" + ".dir"
|
||||
$ if f$search( objdirfile ) .eqs. ""
|
||||
$ then
|
||||
$ create/directory 'objdir'
|
||||
$ endif
|
||||
$!
|
||||
$ define objdir 'objdir'
|
||||
$ define exadir 'exadir'
|
||||
$!
|
||||
$ cc_include = "/include=([],[-.include])"
|
||||
$ cc_flags = "/name=shortened/show=all"
|
||||
$ link_opts = "objdir:libssh2_''thisid'.opt"
|
||||
$!
|
||||
$!
|
||||
$ what = "''p1'"
|
||||
$ if what .eqs. "" .or. f$edit(p1,"trim,collapse,upcase") .eqs. "ALL"
|
||||
$ then
|
||||
$ what = "ALL"
|
||||
$ else
|
||||
$ what = f$parse(what,,,"name")
|
||||
$ if f$search("exadir:''what'.c") .eqs. ""
|
||||
$ then
|
||||
$ write sys$output "Can't make ''what'"
|
||||
$ init_status = 0
|
||||
$ endif
|
||||
$ endif
|
||||
$!
|
||||
$ currentlib = f$search("libssh2*.exe")
|
||||
$!
|
||||
$ define libssh2 'currentlib'
|
||||
$!
|
||||
$ how = "''p2'"
|
||||
$ if how .eqs. "" .or. f$edit(p2,"trim,collapse,upcase") .eqs. "STATIC"
|
||||
$ then
|
||||
$ open/write lout 'link_opts'
|
||||
$ write lout "libssh2.olb/lib"
|
||||
$ write lout "sys$share:ssl$libcrypto_shr32.exe/share"
|
||||
$ write lout "sys$share:ssl$libssl_shr32.exe/share"
|
||||
$ write lout "gnv$libzshr/share"
|
||||
$ close lout
|
||||
$ else
|
||||
$ how = "SHARED"
|
||||
$ open/write lout 'link_opts'
|
||||
$ write lout "libssh2/share"
|
||||
$ close lout
|
||||
$ endif
|
||||
$!
|
||||
$return
|
91
vms/libssh2_make_help.dcl
Normal file
91
vms/libssh2_make_help.dcl
Normal file
@ -0,0 +1,91 @@
|
||||
$!
|
||||
$!
|
||||
$!
|
||||
$ olddir = f$environment( "default" )
|
||||
$ on control_y then goto End
|
||||
$ on error then goto End
|
||||
$!
|
||||
$ gosub Init
|
||||
$!
|
||||
$ man2help sys$input: libssh2.hlp -b 1
|
||||
|
||||
LIBSSH2
|
||||
|
||||
OpenVMS port of the public domain libssh2 library, which
|
||||
provides an API to implement client SSH communciation.
|
||||
|
||||
License information is available at the copying subtopic.
|
||||
|
||||
$!
|
||||
$ open/append mh libssh2.hlp
|
||||
$ write mh helpversion
|
||||
$ close mh
|
||||
$!
|
||||
$ man2help -a [-]readme.; libssh2.hlp -b 2
|
||||
$ man2help -a [-]authors.; libssh2.hlp -b 2
|
||||
$ man2help -a [-]copying.; libssh2.hlp -b 2
|
||||
$ man2help -a [-]news.; libssh2.hlp -b 2
|
||||
$ man2help -a [-]release-notes.; libssh2.hlp -b 2
|
||||
$ man2help -a [-]hacking.; libssh2.hlp -b 2
|
||||
$ man2help -a [-]todo.; libssh2.hlp -b 2
|
||||
$!
|
||||
$ man2help -a sys$input: libssh2.hlp -b 2
|
||||
|
||||
API_Reference
|
||||
|
||||
Reference of all implemented API calls in
|
||||
libssh2.
|
||||
|
||||
$!
|
||||
$ man2help -a [-.docs]*.3 libssh2.hlp -b 3
|
||||
$!
|
||||
$ library/help/create libssh2.hlb libssh2.hlp
|
||||
$!
|
||||
$End:
|
||||
$ set default 'olddir'
|
||||
$exit
|
||||
$!
|
||||
$!-------------------------------------------------------
|
||||
$!
|
||||
$Init:
|
||||
$!
|
||||
$ thisdir = f$environment( "procedure" )
|
||||
$ thisdir = f$parse(thisdir,,,"device") + f$parse(thisdir,,,"directory")
|
||||
$ set default 'thisdir'
|
||||
$!
|
||||
$ say = "write sys$output"
|
||||
$!
|
||||
$ pipe search [-.include]*.h libssh2_version_major/nohead | (read sys$input l ; l = f$element(2," ",f$edit(l,"trim,compress")) ; -
|
||||
define/job majorv &l )
|
||||
$ pipe search [-.include]*.h libssh2_version_minor/nohead | (read sys$input l ; l = f$element(2," ",f$edit(l,"trim,compress")) ; -
|
||||
define/job minorv &l )
|
||||
$ pipe search [-.include]*.h libssh2_version_patch/nohead | (read sys$input l ; l = f$element(2," ",f$edit(l,"trim,compress")) ; -
|
||||
define/job patchv &l )
|
||||
$!
|
||||
$ majorv = f$trnlnm("majorv")
|
||||
$ minorv = f$integer(f$trnlnm("minorv"))
|
||||
$ patchv = f$integer( f$trnlnm("patchv"))
|
||||
$!
|
||||
$ helpversion = "This help library is based on build version ''majorv'.''minorv'.''patchv' of libssh2."
|
||||
$!
|
||||
$ deassign/job majorv
|
||||
$ deassign/job minorv
|
||||
$ deassign/job patchv
|
||||
$!
|
||||
$ if f$search( "man2help.exe" ) .eqs. ""
|
||||
$ then
|
||||
$ cc man2help
|
||||
$ link man2help
|
||||
$ endif
|
||||
$!
|
||||
$ man2help := $'thisdir'man2help.exe
|
||||
$!
|
||||
$ if f$search("libssh2.hlp") .nes. ""
|
||||
$ then
|
||||
$ delete libssh2.hlp;*
|
||||
$ endif
|
||||
$ if f$search("libssh2.hlb") .nes. ""
|
||||
$ then
|
||||
$ delete libssh2.hlb;*
|
||||
$ endif
|
||||
$return
|
222
vms/libssh2_make_kit.dcl
Normal file
222
vms/libssh2_make_kit.dcl
Normal file
@ -0,0 +1,222 @@
|
||||
$!
|
||||
$ olddir = f$environment("default")
|
||||
$ on error then goto End
|
||||
$!
|
||||
$ gosub Init
|
||||
$!
|
||||
$ call WriteProductDescriptionFile
|
||||
$ call WriteProductTextFile
|
||||
$!
|
||||
$! backup tree
|
||||
$!
|
||||
$ backup [-...]*.*;0/excl=([]*.exe,*.obj,*.opt,*.hlp,*.hlb,*.bck,*.com,*.pcsi*) -
|
||||
libssh2-'versionname''datename'_src.bck/save
|
||||
$ purge libssh2-'versionname''datename'_src.bck
|
||||
$!
|
||||
$! backup examples
|
||||
$!
|
||||
$ backup [-.example]*.c;0 libssh2_examples-'versionname''datename'.bck/save
|
||||
$ dire libssh2_examples-'versionname''datename'.bck
|
||||
$ purge libssh2_examples-'versionname''datename'.bck
|
||||
$!
|
||||
$ set default [-]
|
||||
$!
|
||||
$ defdir = f$environment( "default" )
|
||||
$ thisdev = f$parse(defdir,,,"device","no_conceal")
|
||||
$ thisdir = f$parse(defdir,,,"directory","no_conceal") - "][" - "][" - "][" - "]["
|
||||
$!
|
||||
$ libssh2_kf = thisdev + thisdir
|
||||
$ libssh2_kf = libssh2_kf - "]" + ".]"
|
||||
$!
|
||||
$ set default 'mdir'
|
||||
$!
|
||||
$ define/translation_attributes=concealed libssh2_kf 'libssh2_kf'
|
||||
$!
|
||||
$ product package libssh2 -
|
||||
/base='arch' -
|
||||
/producer=jcb -
|
||||
/source=[] - ! where to find PDF and PTF
|
||||
/destination=[] - ! where to put .PCSI file
|
||||
/material=libssh2_kf:[000000...] - ! where to find product material
|
||||
/version="''vms_majorv'.''minorv'-''patchv'''datename'" -
|
||||
/format=sequential
|
||||
$!
|
||||
$End:
|
||||
$!
|
||||
$ set noon
|
||||
$ if f$search("*.pcsi$desc;*") .nes. "" then delete *.pcsi$desc;*
|
||||
$ if f$search("*.pcsi$text;*") .nes. "" then delete *.pcsi$text;*
|
||||
$ if f$search("libssh2-''versionname'''datename'_src.bck;*") .nes. "" then delete libssh2-'versionname''datename'_src.bck;*
|
||||
$ if f$search("libssh2_examples-''versionname'''datename'.bck;*") .nes. "" then delete libssh2_examples-'versionname''datename'.bck;*
|
||||
$!
|
||||
$ if f$trnlnm("libssh2_kf") .nes. "" then deassign libssh2_kf
|
||||
$ set default 'olddir'
|
||||
$!
|
||||
$exit
|
||||
$!
|
||||
$!--------------------------------------------------------------------------------
|
||||
$!
|
||||
$Init:
|
||||
$ set process/parse=extended
|
||||
$!
|
||||
$ say = "write sys$output"
|
||||
$!
|
||||
$ mdir = f$environment("procedure")
|
||||
$ mdir = mdir - f$parse(mdir,,,"name") - f$parse(mdir,,,"type") - f$parse(mdir,,,"version")
|
||||
$!
|
||||
$ set default 'mdir'
|
||||
$!
|
||||
$ pipe search [-.include]*.h libssh2_version_major/nohead | (read sys$input l ; l = f$element(2," ",f$edit(l,"trim,compress")) ; -
|
||||
define/job majorv &l )
|
||||
$ pipe search [-.include]*.h libssh2_version_minor/nohead | (read sys$input l ; l = f$element(2," ",f$edit(l,"trim,compress")) ; -
|
||||
define/job minorv &l )
|
||||
$ pipe search [-.include]*.h libssh2_version_patch/nohead | (read sys$input l ; l = f$element(2," ",f$edit(l,"trim,compress")) ; -
|
||||
define/job patchv &l )
|
||||
$!
|
||||
$ majorv = f$trnlnm("majorv")
|
||||
$ minorv = f$integer(f$trnlnm("minorv"))
|
||||
$ patchv = f$integer( f$trnlnm("patchv"))
|
||||
$!
|
||||
$ deassign/job majorv
|
||||
$ deassign/job minorv
|
||||
$ deassign/job patchv
|
||||
$!
|
||||
$ vms_majorv = f$trnlnm("vms_majorv")
|
||||
$ if vms_majorv .eqs. "" then vms_majorv = majorv
|
||||
$!
|
||||
$ arch = "UNKNOWN"
|
||||
$ if f$getsyi("arch_type") .eq. 2 then arch = "AXPVMS"
|
||||
$ if f$getsyi("arch_type") .eq. 3 then arch = "I64VMS"
|
||||
$!
|
||||
$ if arch .eqs. "UNKNOWN"
|
||||
$ then
|
||||
$ say "Unsupported or unknown architecture, only works on Alpha and Itanium"
|
||||
$ exit 2
|
||||
$ endif
|
||||
$!
|
||||
$! is this a proper release or a daily snapshot?
|
||||
$! crummy, but should work.
|
||||
$!
|
||||
$ daily = "TRUE"
|
||||
$ firstdash = f$locate("-",mdir)
|
||||
$ restdir = f$extract( firstdash + 1, 80, mdir)
|
||||
$ seconddash = f$locate("-", restdir)
|
||||
$ if seconddash .ge. f$length( restdir )
|
||||
$ then
|
||||
$ daily = "FALSE"
|
||||
$ datename = ""
|
||||
$ else
|
||||
$ datename = "D" + f$extract(seconddash+1,8,restdir)
|
||||
$ endif
|
||||
$!
|
||||
$ if daily
|
||||
$ then
|
||||
$ productname = "JCB ''arch' LIBSSH2 V''vms_majorv'.''minorv'-''patchv'''datename'"
|
||||
$ else
|
||||
$ productname = "JCB ''arch' LIBSSH2 V''vms_majorv'.''minorv'-''patchv'"
|
||||
$ endif
|
||||
$!
|
||||
$ productfilename = "JCB-''arch'-LIBSSH2-" + f$fao("V!2ZL!2ZL-!2ZL!AS-1", f$integer(vms_majorv),minorv,patchv,datename)
|
||||
$!
|
||||
$ versionname = "''vms_majorv'_''minorv'_''patchv'"
|
||||
$!
|
||||
$return
|
||||
$!
|
||||
$!--------------------------------------------------------------------------------
|
||||
$!
|
||||
$WriteProductDescriptionFile: subroutine
|
||||
$!
|
||||
$ open/write pd 'productfilename'.PCSI$DESC
|
||||
$!
|
||||
$ write pd "product ''productname' full ;"
|
||||
$ write pd " software DEC ''arch' VMS ;"
|
||||
$ write pd " if (not <software DEC ''arch' VMS version minimum V8.3>) ;
|
||||
$ write pd " error NEED_VMS83 ;"
|
||||
$ write pd " end if ;"
|
||||
$ write pd " software HP ''arch' SSL version minimum V1.3;"
|
||||
$ write pd " if (not <software HP ''arch' SSL version minimum V1.3>) ;
|
||||
$ write pd " error NEED_SSL ;"
|
||||
$ write pd " end if ;"
|
||||
$ write pd " execute preconfigure (""set process/parse_type=extended"");"
|
||||
$ write pd " execute postinstall (""set process/parse_type=extended"","
|
||||
$ write pd " ""rename pcsi$destination:[gnv]usr.dir usr.DIR"","
|
||||
$ write pd " ""rename pcsi$destination:[gnv.usr]include.dir include.DIR"","
|
||||
$ write pd " ""rename pcsi$destination:[gnv.usr.include]libssh2.dir libssh2.DIR"","
|
||||
$ write pd " ""rename pcsi$destination:[gnv.usr.include.libssh2]libssh2.h libssh2.h"","
|
||||
$ write pd " ""rename pcsi$destination:[gnv.usr.include.libssh2]libssh2_publickey.h libssh2_publickey.h"","
|
||||
$ write pd " ""rename pcsi$destination:[gnv.usr.include.libssh2]libssh2_sftp.h libssh2_sftp.h"","
|
||||
$ write pd " ""rename pcsi$destination:[gnv.usr.include.libssh2]libssh2_config.h libssh2_config.h"","
|
||||
$ write pd " ""rename pcsi$destination:[gnv.usr]lib.dir lib.DIR"","
|
||||
$ write pd " ""rename pcsi$destination:[gnv.usr.lib]gnv$libssh2_''versionname'.exe gnv$libssh2_''versionname'.exe"","
|
||||
$ write pd " ""rename pcsi$destination:[gnv.usr.share.doc.libssh2]libssh2.hlb libssh2.hlb"");"
|
||||
$ write pd " information RELEASE_NOTES phase after ;"
|
||||
$ write pd " option EXAMPLE default 0 ;"
|
||||
$ write pd " directory ""[gnv.usr.share.doc.libssh2.examples]"" ;"
|
||||
$ write pd " file ""[gnv.usr.share.doc.libssh2.examples]libssh2_examples-''versionname'''datename'.bck"";"
|
||||
$ write pd " end option ;"
|
||||
$ write pd " option SOURCE default 0 ;"
|
||||
$ write pd " directory ""[gnv.common_src]"" ;"
|
||||
$ write pd " file ""[gnv.common_src]libssh2-''versionname'''datename'_src.bck"";"
|
||||
$ write pd " end option ;"
|
||||
$ write pd " directory ""[gnv]"" ;"
|
||||
$ write pd " directory ""[gnv.usr]"" ;"
|
||||
$ write pd " directory ""[gnv.usr.lib]"" ;"
|
||||
$ write pd " directory ""[gnv.usr.include]"" ;"
|
||||
$ write pd " directory ""[gnv.usr.include.libssh2]"" ;"
|
||||
$ write pd " directory ""[gnv.usr.share]"" ;"
|
||||
$ write pd " directory ""[gnv.usr.share.doc]"" ;"
|
||||
$ write pd " directory ""[gnv.usr.share.doc.libssh2]"" ;"
|
||||
$ write pd " file ""[gnv.usr.include.libssh2]libssh2.h"" source ""[include]libssh2.h"";"
|
||||
$ write pd " file ""[gnv.usr.include.libssh2]libssh2_publickey.h"" source ""[include]libssh2_publickey.h"";"
|
||||
$ write pd " file ""[gnv.usr.include.libssh2]libssh2_sftp.h"" source ""[include]libssh2_sftp.h"";"
|
||||
$ write pd " file ""[gnv.usr.include.libssh2]libssh2_config.h"" source ""[vms]libssh2_config.h"";"
|
||||
$ write pd " file ""[gnv.usr.share.doc.libssh2]libssh2.hlb"" source ""[vms]libssh2.hlb"";"
|
||||
$ write pd " file ""[gnv.usr.share.doc.libssh2]libssh2-''versionname'.news"" source ""[000000]NEWS."";"
|
||||
$ write pd " file ""[gnv.usr.share.doc.libssh2]libssh2-''versionname'.release_notes"" source ""[vms]readme.vms"";"
|
||||
$ write pd " file ""[gnv.usr.lib]gnv$libssh2_''versionname'.exe"" source ""[vms]libssh2_''versionname'.exe"";"
|
||||
$ write pd "end product ;"
|
||||
$ close pd
|
||||
$exit
|
||||
$endsubroutine
|
||||
$!
|
||||
$!--------------------------------------------------------------------------------
|
||||
$!
|
||||
$WriteProductTextFile: subroutine
|
||||
$!
|
||||
$ open/write pt 'productfilename'.PCSI$TEXT
|
||||
$ write pt "=PRODUCT ''productname' Full"
|
||||
$ write pt "1 'PRODUCER"
|
||||
$ write pt "=prompt libssh2 is an open source product ported to VMS by Jose Baars"
|
||||
$ write pt "This software product is provided with no warranty."
|
||||
$ write pt "For license information see the LIBSSH2 help library."
|
||||
$ write pt "1 'PRODUCT"
|
||||
$ write pt "=prompt JCB LIBSSH2 for OpenVMS"
|
||||
$ write pt ""
|
||||
$ write pt "libssh2 is an open source client side library that aims to implement"
|
||||
$ write pt "the SSH protocol. This is the OpenVMS port of that library."
|
||||
$ write pt "Further information at http://www.libssh2.org."
|
||||
$ write pt ""
|
||||
$ write pt "1 NEED_VMS83"
|
||||
$ write pt "=prompt OpenVMS 8.3 or later is not installed on your system."
|
||||
$ write pt "This product requires OpenVMS 8.3 or later to function."
|
||||
$ write pt ""
|
||||
$ write pt "1 NEED_SSL"
|
||||
$ write pt "=prompt HP SSL 1.3 or later is not installed on your system."
|
||||
$ write pt "This product requires HP SSL 1.3 or later to function."
|
||||
$ write pt ""
|
||||
$ write pt "1 RELEASE_NOTES"
|
||||
$ write pt "=prompt Release notes and the libssh2 help library are available in [gnv.usr.share.doc.libssh2] directory."
|
||||
$ write pt ""
|
||||
$ write pt "1 EXAMPLE"
|
||||
$ write pt "=prompt Do you want the libssh2 C programming examples ? "
|
||||
$ write pt "The libssh2 coding examples will be available in backup saveset "
|
||||
$ write pt "[gnv.usr.share.doc.libssh2.examples]libssh2_examples_''versionname'.bck"
|
||||
$ write pt ""
|
||||
$ write pt "1 SOURCE"
|
||||
$ write pt "=prompt Do you want the complete libssh2 source tree ? "
|
||||
$ write pt "The libssh2 source tree will be available in backup saveset "
|
||||
$ write pt "[gnv.common_src]libssh2_''versionname'''datename'_src.bck"
|
||||
$close pt
|
||||
$exit
|
||||
$ endsubroutine
|
||||
|
344
vms/libssh2_make_lib.dcl
Normal file
344
vms/libssh2_make_lib.dcl
Normal file
@ -0,0 +1,344 @@
|
||||
$!
|
||||
$!
|
||||
$ olddir = f$environment("default")
|
||||
$ on control_y then goto YExit
|
||||
$!
|
||||
$ gosub Init
|
||||
$ if .not. init_status then goto YExit
|
||||
$!
|
||||
$ call CompileAll
|
||||
$ call BuildTransferVectors
|
||||
$ call LinkShared
|
||||
$!
|
||||
$ call Cleanup
|
||||
$!
|
||||
$YExit:
|
||||
$ set noon
|
||||
$!
|
||||
$ deassign srcdir
|
||||
$ if f$search("objdir:*.*;*") .nes. "" then delete objdir:*.*;*
|
||||
$ deassign objdir
|
||||
$ delete library_objects.dir;*
|
||||
$!
|
||||
$ set default 'olddir'
|
||||
$exit
|
||||
$!
|
||||
$!---------------------------------------------------------------------
|
||||
$!
|
||||
$Init:
|
||||
$!
|
||||
$!
|
||||
$ init_status = 1
|
||||
$ thisid = f$integer( %x'f$getjpi(0,"pid")')
|
||||
$ mdir = f$environment("procedure")
|
||||
$ mdir = mdir - f$parse(mdir,,,"name") - f$parse(mdir,,,"type") - f$parse(mdir,,,"version")
|
||||
$ set default 'mdir'
|
||||
$!
|
||||
$ objdir = "[.library_objects]"
|
||||
$ srcdir = "[-.src]"
|
||||
$!
|
||||
$ objdirfile = objdir - "[." - "]" + ".dir"
|
||||
$ if f$search( objdirfile ) .eqs. ""
|
||||
$ then
|
||||
$ create/directory 'objdir'
|
||||
$ endif
|
||||
$!
|
||||
$ define objdir 'objdir'
|
||||
$ define srcdir 'srcdir'
|
||||
$!
|
||||
$ cc_include = "/include=([],[-.include])"
|
||||
$ link_opts = "objdir:libssh2_''thisid'.opt"
|
||||
$!
|
||||
$ pipe search [-.include]libssh2.h libssh2_version_major/nohead | (read sys$input l ; l = f$element(2," ",f$edit(l,"trim,compress")) ; -
|
||||
define/job majorv &l )
|
||||
$ pipe search [-.include]libssh2.h libssh2_version_minor/nohead | (read sys$input l ; l = f$element(2," ",f$edit(l,"trim,compress")) ; -
|
||||
define/job minorv &l )
|
||||
$ pipe search [-.include]libssh2.h libssh2_version_patch/nohead | (read sys$input l ; l = f$element(2," ",f$edit(l,"trim,compress")) ; -
|
||||
define/job patchv &l )
|
||||
$!
|
||||
$ majorv = f$trnlnm("majorv")
|
||||
$ minorv = f$integer(f$trnlnm("minorv"))
|
||||
$ patchv = f$integer( f$trnlnm("patchv"))
|
||||
$!
|
||||
$ OLBONLY = "FALSE"
|
||||
$ if p1 .eqs. "OLBONLY"
|
||||
$ then
|
||||
$ OLBONLY = "TRUE"
|
||||
$ endif
|
||||
$!
|
||||
$ deassign/job majorv
|
||||
$ deassign/job minorv
|
||||
$ deassign/job patchv
|
||||
$!
|
||||
$return
|
||||
$!
|
||||
$!---------------------------------------------------------------------
|
||||
$!
|
||||
$Cleanup: subroutine
|
||||
$!
|
||||
$ set noon
|
||||
$ purge *.opt
|
||||
$ purge *.olb
|
||||
$ purge *.exe
|
||||
$!
|
||||
$exit 1
|
||||
$endsubroutine
|
||||
$!
|
||||
$!---------------------------------------------------------------------
|
||||
$!
|
||||
$LinkShared: subroutine
|
||||
$!
|
||||
$!
|
||||
$!
|
||||
$ cversion = f$fao("!3ZL",minorv) + f$fao("!3ZL",patchv)
|
||||
$!
|
||||
$! General linking options in link_libssh2_version...opt
|
||||
$! Vectors in link_libssh2_vectors...opt
|
||||
$!
|
||||
$ open/write uitv link_libssh2_version_'majorv'_'minorv'_'patchv'.opt
|
||||
$ write uitv "GSMATCH=LEQUAL,''majorv',''cversion'"
|
||||
$ write uitv "IDENTIFICATION=""LIBSSH2 ''majorv'.''minorv'.''patchv'"""
|
||||
$ write uitv "sys$share:ssl$libcrypto_shr32.exe/share"
|
||||
$ write uitv "sys$share:ssl$libssl_shr32.exe/share"
|
||||
$ write uitv "gnv$libzshr/share"
|
||||
$ close uitv
|
||||
$!
|
||||
$ link/shared/exe=libssh2_'majorv'_'minorv'_'patchv'.exe -
|
||||
libssh2.olb/lib, -
|
||||
link_libssh2_version_'majorv'_'minorv'_'patchv'.opt/opt, -
|
||||
link_libssh2_vectors_'majorv'_'minorv'_'patchv'.opt/opt
|
||||
$!
|
||||
$exit
|
||||
$endsubroutine
|
||||
$!
|
||||
$!---------------------------------------------------------------------
|
||||
$!
|
||||
$CompileAll: subroutine
|
||||
$!
|
||||
$ set noon
|
||||
$!
|
||||
$ if f$search("objdir:*.obj;*") .nes ""
|
||||
$ then
|
||||
$ delete objdir:*.obj;*
|
||||
$ endif
|
||||
$ if f$search("[.cxx_repository]cxx$demangler_db.;") .nes ""
|
||||
$ then
|
||||
$ delete [.cxx_repository]cxx$demangler_db.;*
|
||||
$ endif
|
||||
$!
|
||||
$! Compile all .c files in [-.src], first as_is
|
||||
$! and then as default all uppercase names
|
||||
$! and add the resulting object to object libraries
|
||||
$! libssh2_up.olb and libssh2_as_is.olb.
|
||||
$!
|
||||
$ case = 0
|
||||
$ if OLBONLY then case = 1
|
||||
$CaseLoop:
|
||||
$!
|
||||
$ if case .eq. 0
|
||||
$ then!camel case names
|
||||
$ cc_flags = "/names=(shortened,as_is)"
|
||||
$ objlib = "libssh2_asis.olb"
|
||||
$ endif
|
||||
$!
|
||||
$ if case .eq. 1
|
||||
$ then!uppercase names
|
||||
$ if f$search("[.cxx_repository]cxx$demangler_db.;") .nes ""
|
||||
$ then
|
||||
$ rename [.cxx_repository]cxx$demangler_db.; *.lowercase
|
||||
$ purge [.cxx_repository]cxx$demangler_db.lowercase
|
||||
$ endif
|
||||
$!
|
||||
$ cc_flags = "/names=(shortened)"
|
||||
$ objlib = "libssh2_up.olb"
|
||||
$ endif
|
||||
$!
|
||||
$ if f$search("''objlib';*") .nes. "" then delete 'objlib';*
|
||||
$ library/create 'objlib'
|
||||
$!
|
||||
$Loop:
|
||||
$ this = f$search("srcdir:*.c;0")
|
||||
$ if this .eqs. "" then goto EndLoop
|
||||
$!
|
||||
$ what = f$parse( this,,,"name")
|
||||
$!
|
||||
$ call CompileAndAdd
|
||||
$!
|
||||
$ goto Loop
|
||||
$EndLoop:
|
||||
$ case = case + 1
|
||||
$ delete objdir:*.obj;*
|
||||
$ if case .lt 2 then goto CaseLoop
|
||||
$!
|
||||
$ rename libssh2_up.olb libssh2.olb
|
||||
$ if f$search("[.cxx_repository]cxx$demangler_db.;") .nes ""
|
||||
$ then
|
||||
$ rename [.cxx_repository]cxx$demangler_db.; *.uppercase
|
||||
$ purge [.cxx_repository]cxx$demangler_db.uppercase
|
||||
$ endif
|
||||
$!
|
||||
$ if OLBONLY then exit 4
|
||||
$!
|
||||
$! For each function that is too long, create a global symbol
|
||||
$! low$'shortened-uppercase-name' with as value lowercase shortened
|
||||
$! name in it, so we can add the proper lower or mixed case
|
||||
$! shortened name later when building the transfer vectors
|
||||
$! for the shared image.
|
||||
$! This is to prevent two very long similar function names
|
||||
$! that are shortened getting mixed up when sorted alphabetically.
|
||||
$!
|
||||
$ inputfile = "[.cxx_repository]cxx$demangler_db.lowercase"
|
||||
$ gosub GetShortened
|
||||
$!
|
||||
$ inputfile = "[.cxx_repository]cxx$demangler_db.uppercase"
|
||||
$ gosub GetShortened
|
||||
$!
|
||||
$exit
|
||||
$!
|
||||
$GetShortened:
|
||||
$!
|
||||
$ open/read s 'inputfile'
|
||||
$ namecount = 0
|
||||
$ReadLoop:
|
||||
$!
|
||||
$ read/end=endreadloop s regel
|
||||
$!
|
||||
$ shortname = f$element(0,"$",regel) + "$"
|
||||
$ longname = f$element(1,"$",regel)
|
||||
$!
|
||||
$ symvalue = ""
|
||||
$!
|
||||
$ if shortname .eqs. f$edit(shortname,"upcase")
|
||||
$ then
|
||||
$! this is an uppercase shortname, add it
|
||||
$ symname = "u$''longname'"
|
||||
$ symvalue = "''shortname'"
|
||||
$ low$'shortname' == l$'longname'
|
||||
$!
|
||||
$ delete/symbol l$'longname'
|
||||
$!
|
||||
$ else
|
||||
$! this is an lowercase shortname
|
||||
$ symname = "l$''longname'"
|
||||
$ symvalue = "''shortname'"
|
||||
$ 'symname' = "''symvalue'"
|
||||
$ endif
|
||||
$!
|
||||
$ namecount = namecount + 1
|
||||
$!
|
||||
$ goto ReadLoop
|
||||
$EndReadLoop:
|
||||
$!
|
||||
$close s
|
||||
$return
|
||||
$!
|
||||
$endsubroutine
|
||||
$!
|
||||
$!---------------------------------------------------------------------
|
||||
$!
|
||||
$CompileAndAdd: subroutine
|
||||
$!
|
||||
$ on error then goto End
|
||||
$!
|
||||
$ cc /warn=disable=longextern/lis=objdir:/show=all 'cc_include' 'cc_flags'/object=objdir:'what'.obj srcdir:'what'.c
|
||||
$ library/insert 'objlib' objdir:'what'.obj
|
||||
$!
|
||||
$End:
|
||||
$exit
|
||||
$endsubroutine
|
||||
$!
|
||||
$!---------------------------------------------------------------------
|
||||
$!
|
||||
$BuildTransferVectors: subroutine
|
||||
$!
|
||||
$! Do a balanced read of the uppercase library names
|
||||
$! and the mixed case library names, and build the
|
||||
$! transfer vectors with uppercase entry points
|
||||
$! with an alternative in mixed case.
|
||||
$! For shortened names, use the low$* symbols
|
||||
$! to avoid being fooled by the sort.
|
||||
$!
|
||||
$ thislib = "libssh2.olb"
|
||||
$ library/lis=libu.'thisid'/names libssh2.olb
|
||||
$ library/lis=lib_asisu.'thisid'/names libssh2_asis.olb
|
||||
$!
|
||||
$! case blind sort of all modules in both the uppercase
|
||||
$! as the case sensitive object library.
|
||||
$!
|
||||
$ sort libu.'thisid' lib.'thisid'/spec=sys$input
|
||||
/COLLATING_SEQUENCE=(SEQUENCE= ("A" - "Z","0"-"9","_"), FOLD)
|
||||
$ sort lib_asisu.'thisid' lib_asis.'thisid'/spec=sys$input
|
||||
/COLLATING_SEQUENCE=(SEQUENCE= ("A" - "Z","0"-"9","_"), FOLD)
|
||||
$!
|
||||
$ open/read in lib.'thisid'
|
||||
$ open/read inasis lib_asis.'thisid'
|
||||
$ open/write uit link_libssh2_vectors_'majorv'_'minorv'_'patchv'.opt
|
||||
$!
|
||||
$ write uit "CASE_SENSITIVE=YES"
|
||||
$ write uit "SYMBOL_VECTOR= ( -"
|
||||
$!
|
||||
$ mode = 0
|
||||
$ uitregel = ""
|
||||
$!
|
||||
$ReadLoop:
|
||||
$!
|
||||
$ read/end=ReadAsis in regel
|
||||
$ReadAsis:
|
||||
$ read/end=EndReadLoop inasis asisregel
|
||||
$!
|
||||
$ regel = f$edit( regel, "trim,compress" )
|
||||
$ asisregel = f$edit( asisregel, "trim,compress" )
|
||||
$!
|
||||
$ if f$element(0," ",regel) .eqs. "Module" .or. -
|
||||
f$extract(0,1,regel) .eqs. "_" .or. -
|
||||
f$element(1," ",regel) .nes. " " .or. -
|
||||
regel .eqs. ""
|
||||
$ then
|
||||
$ goto ReadLoop
|
||||
$ endif
|
||||
$!
|
||||
$ if uitregel .nes. "" .and. mode .eq. 1
|
||||
$ then
|
||||
$ write uit "''uitregel'=PROCEDURE, -"
|
||||
$ write uit "''uitasis'/''uitregel'=PROCEDURE, -"
|
||||
$!
|
||||
$ uitregel = ""
|
||||
$ uitasis = ""
|
||||
$ endif
|
||||
$!
|
||||
$ uitregel = regel
|
||||
$ if f$type( low$'uitregel' ) .nes. ""
|
||||
$ then
|
||||
$ uitasis = low$'uitregel'
|
||||
$ delete/symbol/global low$'uitregel'
|
||||
$ else
|
||||
$ uitasis = asisregel
|
||||
$ endif
|
||||
$!
|
||||
$ mode = 1
|
||||
$!
|
||||
$ goto ReadLoop
|
||||
$EndreadLoop:
|
||||
$!
|
||||
$! To get the closing brace after the last procedure
|
||||
$! keyword.
|
||||
$!
|
||||
$ if uitregel .nes. ""
|
||||
$ then
|
||||
$ write uit "''uitregel'=PROCEDURE, -"
|
||||
$ write uit "''uitasis'/''uitregel'=PROCEDURE)"
|
||||
$ endif
|
||||
$!
|
||||
$ write uit "CASE_SENSITIVE=NO"
|
||||
$!
|
||||
$ close in
|
||||
$ close inasis
|
||||
$ close uit
|
||||
$!
|
||||
$ delete lib*.'thisid';*
|
||||
$!
|
||||
$exit
|
||||
$endsubroutine
|
||||
$!
|
||||
$!---------------------------------------------------------------------
|
||||
$!
|
506
vms/man2help.c
Normal file
506
vms/man2help.c
Normal file
@ -0,0 +1,506 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <starlet.h>
|
||||
#include <lib$routines.h>
|
||||
#include <ssdef.h>
|
||||
#include <descrip.h>
|
||||
#include <rms.h>
|
||||
|
||||
typedef struct manl{
|
||||
struct manl *next;
|
||||
char *filename;
|
||||
}man, *manPtr;
|
||||
|
||||
typedef struct pf_fabnam{
|
||||
struct FAB dfab;
|
||||
struct RAB drab;
|
||||
struct namldef dnam;
|
||||
char expanded_filename[NAM$C_MAXRSS + 1];
|
||||
} pfn, *pfnPtr;
|
||||
|
||||
/*----------------------------------------------------------*/
|
||||
|
||||
fpcopy( char *output, char *input, int len )
|
||||
{
|
||||
char *is, *os;
|
||||
int i;
|
||||
|
||||
if ( len ){
|
||||
for ( is = input, os = output, i = 0; i < len ; ++i, ++is, ++os){
|
||||
*os = *is;
|
||||
}
|
||||
*os = 0;
|
||||
}else{
|
||||
output[0] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*----------------------------------------------------------*/
|
||||
/* give part of ilename in partname. See code for proper
|
||||
value of i ( 0 = node, 1 = dev, 2 = dir,3 = name etc.
|
||||
*/
|
||||
|
||||
int fnamepart( char *inputfile, char *part, int whatpart )
|
||||
{
|
||||
pfnPtr pf;
|
||||
int status;
|
||||
char ipart[6][256], *i, *p;
|
||||
|
||||
pf = calloc( 1, sizeof( pfn ) );
|
||||
|
||||
pf->dfab = cc$rms_fab;
|
||||
pf->drab = cc$rms_rab;
|
||||
pf->dnam = cc$rms_naml;
|
||||
|
||||
pf->dfab.fab$l_naml = &pf->dnam;
|
||||
|
||||
pf->dfab.fab$l_fna = (char *) -1;
|
||||
pf->dfab.fab$l_dna = (char *) -1;
|
||||
pf->dfab.fab$b_fns = 0;
|
||||
pf->dfab.fab$w_ifi = 0;
|
||||
|
||||
pf->dnam.naml$l_long_defname = NULL; //inputfile;
|
||||
pf->dnam.naml$l_long_defname_size = 0;//strlen( inputfile );
|
||||
|
||||
pf->dnam.naml$l_long_filename = inputfile;
|
||||
pf->dnam.naml$l_long_filename_size = strlen( inputfile);
|
||||
|
||||
pf->dnam.naml$l_long_expand = pf->expanded_filename;
|
||||
pf->dnam.naml$l_long_expand_alloc = NAM$C_MAXRSS ;
|
||||
|
||||
pf->dnam.naml$b_nop |= NAML$M_SYNCHK | NAML$M_PWD;
|
||||
|
||||
status = sys$parse( &pf->dfab, 0,0);
|
||||
if ( !(status&1) ){
|
||||
free( pf );
|
||||
return( status );
|
||||
}
|
||||
|
||||
fpcopy ( ipart[0], pf->dnam.naml$l_long_node , pf->dnam.naml$l_long_node_size);
|
||||
fpcopy ( ipart[1], pf->dnam.naml$l_long_dev , pf->dnam.naml$l_long_dev_size);
|
||||
fpcopy ( ipart[2], pf->dnam.naml$l_long_dir , pf->dnam.naml$l_long_dir_size);
|
||||
fpcopy ( ipart[3], pf->dnam.naml$l_long_name , pf->dnam.naml$l_long_name_size);
|
||||
fpcopy ( ipart[4], pf->dnam.naml$l_long_type , pf->dnam.naml$l_long_type_size);
|
||||
fpcopy ( ipart[5], pf->dnam.naml$l_long_ver , pf->dnam.naml$l_long_ver_size);
|
||||
|
||||
for( i = ipart[ whatpart ], p = part; *i; ++i, ++p){
|
||||
if ( p == part ){
|
||||
*p = toupper( *i );
|
||||
}else{
|
||||
*p = tolower( *i );
|
||||
}
|
||||
}
|
||||
*p = 0;
|
||||
|
||||
free( pf );
|
||||
return(1);
|
||||
}
|
||||
/*----------------------------------------------------------*/
|
||||
|
||||
int find_file(char *filename,char *gevonden,int *findex)
|
||||
{
|
||||
int status;
|
||||
struct dsc$descriptor gevondend;
|
||||
struct dsc$descriptor filespec;
|
||||
char gevonden_file[NAM$C_MAXRSS + 1];
|
||||
|
||||
filespec.dsc$w_length = strlen(filename);
|
||||
filespec.dsc$b_dtype = DSC$K_DTYPE_T;
|
||||
filespec.dsc$b_class = DSC$K_CLASS_S;
|
||||
filespec.dsc$a_pointer = filename;
|
||||
|
||||
gevondend.dsc$w_length = NAM$C_MAXRSS;
|
||||
gevondend.dsc$b_dtype = DSC$K_DTYPE_T;
|
||||
gevondend.dsc$b_class = DSC$K_CLASS_S;
|
||||
gevondend.dsc$a_pointer = gevonden_file;
|
||||
|
||||
status=lib$find_file(&filespec,&gevondend,findex,0,0,0,0);
|
||||
|
||||
if ( (status & 1) == 1 ){
|
||||
strcpy(gevonden,strtok(gevonden_file," "));
|
||||
}else{
|
||||
gevonden[0] = 0;
|
||||
}
|
||||
|
||||
return(status);
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
|
||||
manPtr addman( manPtr *manroot,char *filename )
|
||||
{
|
||||
manPtr m,f;
|
||||
|
||||
m = calloc( 1, sizeof( man) );
|
||||
if ( !m ) return( NULL );
|
||||
|
||||
m->filename = strdup( filename );
|
||||
|
||||
if ( *manroot == NULL ){
|
||||
*manroot = m;
|
||||
}else{
|
||||
for( f = *manroot; f->next ; f = f->next );
|
||||
f->next = m;
|
||||
}
|
||||
return(m);
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
void freeman( manPtr *manroot )
|
||||
{
|
||||
manPtr m,n;
|
||||
|
||||
for( m = *manroot; m ; m = n ){
|
||||
free( m->filename );
|
||||
n = m->next;
|
||||
free ( m );
|
||||
}
|
||||
*manroot = NULL;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
|
||||
int listofmans( char *filespec, manPtr *manroot )
|
||||
{
|
||||
manPtr r;
|
||||
int status;
|
||||
int ffindex=0;
|
||||
char gevonden[NAM$C_MAXRSS + 1];
|
||||
|
||||
while(1){
|
||||
status = find_file( filespec, gevonden, &ffindex );
|
||||
|
||||
if ( (status&1) ){
|
||||
r = addman( manroot, gevonden );
|
||||
if ( r == NULL ) return(2);
|
||||
}else{
|
||||
if ( !( status&1)) break;
|
||||
}
|
||||
}
|
||||
|
||||
lib$find_file_end( &ffindex);
|
||||
if ( status == RMS$_NMF) status = 1;
|
||||
|
||||
|
||||
return( status );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
|
||||
int convertman ( char *filespec, FILE *hlp , int base_level )
|
||||
{
|
||||
FILE *man;
|
||||
char *in, *uit;
|
||||
char *m,*h;
|
||||
size_t len, thislen, maxlen= 50000;
|
||||
int bol,mode, return_status=1;
|
||||
char subjectname[ NAM$C_MAXRSS + 1 ];
|
||||
|
||||
in = calloc( 1, maxlen + 1 );
|
||||
uit = calloc( 1, maxlen + 1 );
|
||||
|
||||
if ( in == NULL || uit == NULL ) return(2);
|
||||
|
||||
man = fopen( filespec, "r");
|
||||
if ( man == NULL ) return(vaxc$errno);
|
||||
|
||||
for( len = 0; !feof( man ) && len < maxlen ; len += thislen ){
|
||||
thislen = fread( in + len, 1, maxlen - len, man );
|
||||
}
|
||||
|
||||
fclose (man);
|
||||
|
||||
m = in;
|
||||
h = uit;
|
||||
|
||||
*(m + len ) = 0;
|
||||
|
||||
for ( mode = 0, bol = 1 ; *m; ++m ){
|
||||
|
||||
switch ( mode ){
|
||||
case 0:
|
||||
switch(*m){
|
||||
case '.':
|
||||
if ( bol ){
|
||||
mode = 1;
|
||||
}else{
|
||||
*h = *m;
|
||||
++h;
|
||||
}
|
||||
break;
|
||||
case '\\':
|
||||
if ( bol ){
|
||||
*h = ' ';++h;
|
||||
*h = ' ';++h;
|
||||
}
|
||||
mode = 2;
|
||||
break;
|
||||
default:
|
||||
if ( bol ){
|
||||
*h = ' ';++h;
|
||||
*h = ' ';++h;
|
||||
}
|
||||
*h = *m;
|
||||
++h;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 1: /* after . at bol */
|
||||
|
||||
switch(*m){
|
||||
case '\\':
|
||||
while( *m != '\n' && *m != '\r' && *m )++m;
|
||||
mode = 0;
|
||||
break;
|
||||
case 'B':
|
||||
++m;
|
||||
*h = ' ';++h;
|
||||
mode = 0;
|
||||
break;
|
||||
case 'I':
|
||||
/* remove preceding eol */
|
||||
if ( *(m+1) != 'P' ){
|
||||
--h;
|
||||
while ( (*h == '\n' || *h == '\r') && h > uit )--h;
|
||||
++h;
|
||||
}
|
||||
|
||||
/* skip .Ix */
|
||||
for(;*m != ' ' && *m != '\n' && *m != '\r'; ++m);
|
||||
|
||||
/* copy line up to EOL */
|
||||
|
||||
for(;*m != '\n' && *m != '\r' && *m; ++m, ++h)*h = *m;
|
||||
|
||||
/* if line ends in ., this is an EOL */
|
||||
|
||||
if ( *(h-1) == '.'){
|
||||
--h;
|
||||
--m;
|
||||
}else{
|
||||
/* if line does not end in ., skip EOL in source */
|
||||
|
||||
if ( *(m+1) == '\n' || *(m+1) == '\r')++m;
|
||||
}
|
||||
mode = 0;
|
||||
break;
|
||||
case 'S':
|
||||
if ( *(m+1) == 'H' ){
|
||||
*h = '\n';++h;
|
||||
if ( strncmp( m+3 ,"NAME",4) == 0 ||
|
||||
strncmp( m+3 ,"SYNOPSIS",8) == 0 ||
|
||||
strncmp( m+3 ,"DESCRIPTION",11) == 0 ){
|
||||
while( *m != '\n' && *m != '\r')++m;
|
||||
mode = 0;
|
||||
}else{
|
||||
++m;
|
||||
|
||||
/* write help level, and flag it */
|
||||
|
||||
*h = '0' + base_level + 1;++h;
|
||||
return_status |= 2;
|
||||
|
||||
*h = ' ';++h;
|
||||
|
||||
/* skip H (or whatever after S) and blank */
|
||||
++m;++m;
|
||||
|
||||
for(;*m != '\n' && *m != '\r' && *m; ++m, ++h){
|
||||
|
||||
/* write help label in lowercase, skip quotes */
|
||||
/* fill blanks with underscores */
|
||||
|
||||
if ( *m != '\"' ){
|
||||
*h = tolower( *m );
|
||||
if (*h == ' ') *h = '_';
|
||||
}else{
|
||||
--h;
|
||||
}
|
||||
}
|
||||
|
||||
/* Add a linefeed or two */
|
||||
|
||||
*h = *m;++h;
|
||||
*h = *m;++h;
|
||||
|
||||
mode = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'T':
|
||||
if ( *(m+1) == 'H' ){
|
||||
*h = '0' + base_level; ++h;
|
||||
return_status |= 2;
|
||||
*h = ' ';++h;
|
||||
for ( m = m + 3; *m != ' ' && *m ; ++m, ++h ){
|
||||
*h = *m;
|
||||
}
|
||||
while( *m != '\n' && *m != '\r' && *m )++m;
|
||||
mode = 0;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
++m;
|
||||
mode = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 2: /* after \ skip two characters or print the backslash */
|
||||
switch(*m){
|
||||
case '\\':
|
||||
*h = *m;
|
||||
++h;
|
||||
mode = 0;
|
||||
break;
|
||||
default:
|
||||
++m;
|
||||
mode = 0;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
} /*end switch mode */
|
||||
|
||||
bol = 0;
|
||||
if ( *m == '\n' || *m == '\r') bol = 1;
|
||||
|
||||
}/* end for mode */
|
||||
|
||||
*h = 0;
|
||||
|
||||
|
||||
if ( (return_status&2) ){
|
||||
fprintf( hlp, "%s\n\n", uit);
|
||||
}else{
|
||||
fnamepart( filespec, subjectname,3);
|
||||
if ( *subjectname ){
|
||||
fprintf( hlp, "%d %s\n\n%s\n\n", base_level, subjectname, uit);
|
||||
}else{
|
||||
/* No filename (as is the case with a logical), use first word as subject name */
|
||||
char *n,*s;
|
||||
|
||||
for(n = in; isspace( *n );++n);
|
||||
for(s = subjectname; !(isspace( *n )); ++n,++s)*s = *n;
|
||||
*s = 0;
|
||||
|
||||
fprintf( hlp, "%d %s\n\n%s\n\n", base_level, subjectname, uit);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
printf( "read %d from %s, written %d to helpfile, return_status = %d\n",
|
||||
len, filespec, strlen(uit), return_status );
|
||||
*/
|
||||
|
||||
free( m );
|
||||
free( h );
|
||||
|
||||
return ( 1);
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
|
||||
int convertmans( char *filespec, char *hlpfilename, int base_level, int append )
|
||||
{
|
||||
int status=1;
|
||||
manPtr manroot=NULL, m;
|
||||
FILE *hlp;
|
||||
|
||||
if ( append ){
|
||||
hlp = fopen( hlpfilename,"a+");
|
||||
}else{
|
||||
hlp = fopen( hlpfilename,"w");
|
||||
}
|
||||
|
||||
if ( hlp == NULL ) return( vaxc$errno );
|
||||
|
||||
status = listofmans( filespec, &manroot );
|
||||
if ( !(status&1) ) return( status );
|
||||
|
||||
for ( m = manroot ; m ; m = m->next ){
|
||||
status = convertman( m->filename, hlp , base_level );
|
||||
if ( !(status&1) ){
|
||||
fprintf(stderr,"Convertman of %s went wrong\n", m->filename);
|
||||
break;
|
||||
}
|
||||
}
|
||||
freeman( &manroot );
|
||||
return( status );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
void print_help()
|
||||
{
|
||||
fprintf( stderr, "Usage: [-a] [-b x] convertman <manfilespec> <helptextfile>\n" );
|
||||
fprintf( stderr, " -a append <manfilespec> to <helptextfile>\n" );
|
||||
fprintf( stderr, " -b <baselevel> if no headers found create one with level <baselevel>\n" );
|
||||
fprintf( stderr, " and the filename as title.\n" );
|
||||
}
|
||||
/*--------------------------------------------*/
|
||||
|
||||
main ( int argc, char **argv )
|
||||
{
|
||||
int status;
|
||||
int i,j;
|
||||
int append, base_level, basechange;
|
||||
char *manfile=NULL;
|
||||
char *helpfile=NULL;
|
||||
|
||||
if ( argc < 3 ){
|
||||
print_help();
|
||||
return( 1 ) ;
|
||||
}
|
||||
|
||||
append = 0;
|
||||
base_level = 1;
|
||||
basechange = 0;
|
||||
|
||||
for ( i = 1; i < argc; ++i){
|
||||
if ( argv[i][0] == '-' ){
|
||||
for( j = 1; argv[i][j] ; ++j ){
|
||||
switch( argv[i][j] ){
|
||||
case 'a':
|
||||
append = 1;
|
||||
break;
|
||||
case 'b':
|
||||
if ( (i+1) < argc ){
|
||||
base_level = atoi( argv[ i + 1 ] );
|
||||
basechange = 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ( basechange){
|
||||
basechange = 0;
|
||||
i = i + 1;
|
||||
}
|
||||
}else{
|
||||
if ( manfile == NULL ){
|
||||
manfile = strdup( argv[i]);
|
||||
} else if ( helpfile == NULL ){
|
||||
helpfile = strdup( argv[i]);
|
||||
} else {
|
||||
fprintf( stderr, "Unrecognized parameter : %s\n", argv[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* fprintf( stderr,"manfile: %s, helpfile: %s, append: %d, base_level : %d\n",
|
||||
manfile, helpfile, append, base_level);
|
||||
*/
|
||||
|
||||
status = convertmans( manfile, helpfile, base_level, append );
|
||||
|
||||
free( manfile );
|
||||
free( helpfile );
|
||||
|
||||
return( status );
|
||||
}
|
||||
|
||||
|
319
vms/readme.vms
Normal file
319
vms/readme.vms
Normal file
@ -0,0 +1,319 @@
|
||||
*These are the porting notes to OpenVMS, as of 7 April 2010
|
||||
by Jose Baars. This file will be installed as
|
||||
libssh2*.release_notes by the product install kit.
|
||||
|
||||
|
||||
LIBSSH2
|
||||
-------
|
||||
|
||||
LIBSSH2 is a client-side library written in C that aims to
|
||||
implement the SSH2 protocol. It is an open source project,
|
||||
to be found at http://libssh2.org.
|
||||
|
||||
GNV
|
||||
---
|
||||
|
||||
The library uses the GNV prefix, on advise of the kind supporter
|
||||
of the GNV project, John Malmberg.
|
||||
|
||||
Installing the PCSI kit
|
||||
=======================
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
- VMS version 8.3 minimal.
|
||||
See the remarks at prerequisites for building the kit
|
||||
- TCP/IP stack, both TCP/IP services and Multinet should work.
|
||||
See the remarks at prerequisites for building the kit
|
||||
- HP OPENSSL V1.3 minimal.
|
||||
See the remarks at prerequisites for building the kit
|
||||
- JEM ZLIB V1.2-3E1 minimal.
|
||||
See the remarks at prerequisites for building the kit
|
||||
|
||||
The first three dependencies are tested at installation time, and
|
||||
installation will fail if any these products are not installed.
|
||||
The ZLIB dependency is not tested by the product installation
|
||||
procedure, as libssh2 will probably be installed as part of
|
||||
multiple libraries including zlib.
|
||||
|
||||
Install
|
||||
-------
|
||||
|
||||
|
||||
The kit will install gnv$libssh2.exe in a directory tree that might
|
||||
already be available on your system if you have installed other gnv*
|
||||
libraries or utilities.
|
||||
|
||||
The directory tree for gnv$libssh2.exe will be like this:
|
||||
|
||||
[gnv] -- [usr] -- [include] -- [libssh2] include files for libssh2
|
||||
[lib] gnv$libssh2_x_y_z.exe
|
||||
[share] -- [doc] -- [libssh2] libssh2.hlb,
|
||||
release notes (this file),
|
||||
libssh2 release notes
|
||||
|
||||
optional:
|
||||
[example] libssh2_examples-x_y_z.bck
|
||||
[common_src] libssh2-x_y_z_src.bck
|
||||
|
||||
By default, it will install the shared image and include files to
|
||||
SYS$COMMON:[GNV...].
|
||||
|
||||
You can override this destination by specifying the destination
|
||||
directory after /DESTINATION= on the product install command line.
|
||||
This is particularly of use when installing the library on a cluster
|
||||
without a common system disk.
|
||||
|
||||
Please ignore the following warnings, as the kit is not signed :
|
||||
|
||||
%PCSI-I-CANNOTVAL, cannot validate dev:[dir]JCB-AXPVMS-LIBSSH2-V0102-05D20100402-1.PCSI
|
||||
-PCSI-I-NOTSIGNED, product kit is not signed and therefore has no manifest file
|
||||
|
||||
Optionally, you can install a backup saveset with some programming examples,
|
||||
or a backupo saveset with the complete libssh2 source tree.
|
||||
|
||||
you will need to answer 'NO' to the question
|
||||
'Do you want the default for all options'.
|
||||
|
||||
and 'YES' to either or both the following questions:
|
||||
|
||||
Do you want the libssh2 C programming examples ? [NO]
|
||||
|
||||
Do you want the complete libssh2 source tree ? [NO]
|
||||
|
||||
|
||||
Post installation tasks
|
||||
-----------------------
|
||||
|
||||
Although we will try to maintain upward compatibility of libssh2,
|
||||
this can not be guaranteed by the libssh2 project itself for OpenVMS,
|
||||
nor eternally by us.
|
||||
|
||||
To use libssh2 effectively, you will have to define a system logical
|
||||
to point to the shared image. If you are willing to take the gamble,
|
||||
define this logical in your systartup like so:
|
||||
|
||||
$ define/system/executive gnv$libssh2 dev:[dir..]gnv$libssh2_x_y_z.exe
|
||||
|
||||
Optionally, you can install the executbale like so:
|
||||
|
||||
$ mc sysgen install dev:[dir..]gnv$libssh2_x_y_z.exe/open/share/header
|
||||
|
||||
Link your programs against gnv$libssh2, and when upgrading libssh2
|
||||
test thoroughly.
|
||||
|
||||
If you want to be extra cautious define a system logical like this:
|
||||
|
||||
$ define/system/executive gnv$libssh2_x_y_z dev:[dir..]gnv$libssh2_x_y_z.exe
|
||||
|
||||
Link programs against gnv$libssh2_x_y_z, and when upgrading libssh2
|
||||
link against new versions.
|
||||
|
||||
It is probably more convenient in the last case to link against the object
|
||||
library provided in the source backup saveset. Both an uppercase and a
|
||||
mixed case object library, called libssh2.olb and libssh2_asis.olb
|
||||
are provided.
|
||||
|
||||
|
||||
Compiling and linking against libssh2
|
||||
-------------------------------------
|
||||
|
||||
The shared image library has a vector table with both uppercase and
|
||||
mixed case entry points, allowing to link directly against the shared
|
||||
image wether you need the /NAMES=AS_IS or not.
|
||||
|
||||
To link successfully, you MUST use /NAMES=shortened, as some function
|
||||
names in libssh2 are longer than the VMS maximum of 32 characters.
|
||||
|
||||
If you chose to install the examples, you can unpack the backup
|
||||
saveset by
|
||||
|
||||
backup/sel=*.c device:[gnv.usr.share.doc.libssh2.examples]libssh2_examples-x_y_z.bck -
|
||||
[]
|
||||
|
||||
They can by compiled and linked by these commands ( provided you have defined
|
||||
the gnv$libssh2 logical) :
|
||||
|
||||
$ cc/include=dev:[gnv.usr.include.libssh2] xxx.c/names=shortened
|
||||
$ link/opt=sys$input: xxx.obj
|
||||
gnv$libssh2/share
|
||||
|
||||
|
||||
|
||||
|
||||
Building gnv$libssh2
|
||||
====================
|
||||
|
||||
You can build gnv$libssh2 yourself, which may have advantages, as the library is
|
||||
in full development, very regularly new features are added.
|
||||
|
||||
For production use, it is probably advisable to use a stable version, and
|
||||
link against that. To check out new features, statically linking against
|
||||
the object library is probably more practical, to avoid compatibility
|
||||
issues.
|
||||
|
||||
|
||||
Prerequisites
|
||||
-------------
|
||||
|
||||
You will need to have the following available:
|
||||
|
||||
- An Alpha or Itanium VMS system. Due to dependencies on zlib, ssl and ODS-5,
|
||||
support on VAXen would be cumbersome at least.
|
||||
|
||||
- VMS version 8.3 minimal. This is a requirement of gnv$zlibshr.exe against
|
||||
which shared image library libssh2 is linked. If you use another zlib
|
||||
to link against, you can make it work under lower versions of VMS.
|
||||
I have made it work on VMS 7.3-2 with not a lot of difficulty.
|
||||
Also, if you are not interested in compression, you can choose not
|
||||
to link against zlib at all; in that case comment out the
|
||||
#define LIBSSH2_HAVE_ZLIB in libssh2_config.h.
|
||||
|
||||
- TCP/IP services or Multinet for OpenVMS.
|
||||
TCPWare has not been tested.
|
||||
|
||||
- The HP OpenSSL product. Of course, with tweaking, you can probably link
|
||||
it against the OpenSSL library, but that is not what I have used.
|
||||
|
||||
- A C compiler. I don't know any other working C compilers than
|
||||
the DEC/Compac/HP-C compiler on VMS.
|
||||
|
||||
- An ODS-5 disk. With tweaking you'll get it to work on an ODS-2
|
||||
disk, but it is unpractical to do so.
|
||||
|
||||
- A version of VMSTAR that understands ODS-5 disks and extended
|
||||
filenames. Look here:
|
||||
http://ftp.process.com/ftp/vms-freeware/fileserv/vmstar.zip
|
||||
|
||||
- gunzip, available for instance at Steven M Schweda's website:
|
||||
http://antinode.info/ftp/gzip/gzip-1_3_12b_vms/gzip-1_3_12b_vms.zip
|
||||
|
||||
Optional:
|
||||
|
||||
- curl, to be found at http://curl.haxx.se
|
||||
You might want to use curl to download the libssh2 kit directly
|
||||
to you VMS machine. Interestingly, sftp in curl is implemented using
|
||||
libssh2, soon to be expected on VMS as well, hopefully.
|
||||
|
||||
Downloading libssh2
|
||||
-------------------
|
||||
|
||||
At the website of libssh2, you can find stable and daily gzipped
|
||||
tarballs. if you have a computer connected to internet you can
|
||||
download a daily build yourself by a procedure that looks a lot like
|
||||
this ( fill out your own proxy user/password, set up right symbols to
|
||||
gunzip, vmstar and curl and set up the libssh2 build version):
|
||||
|
||||
$ libssh2_version = "1.2.6"
|
||||
$!
|
||||
$ proxy_line = " ""-U"" ""''proxy_userpass'"" ""-x"" ""''proxy_hostport'"" "
|
||||
$!
|
||||
$ currentday = f$cvtime(,,"date") - "-" - "-"
|
||||
$!
|
||||
$ set def mydev:[mydir.libssh2]
|
||||
$!
|
||||
$ if f$search("libssh2-''libssh2_version'-''currentday'.tar.gz") .nes. ""
|
||||
$ then
|
||||
$ delete libssh2-'libssh2_version'-'currentday'.tar.gz;*
|
||||
$ endif
|
||||
$!
|
||||
$ curl 'proxy_line' "http://libssh2.org/snapshots/libssh2-''libssh2_version'-''currentday'.tar.gz" -
|
||||
-o libssh2-'libssh2_version'-'currentday'.tar.gz
|
||||
$!
|
||||
$!
|
||||
$ if f$search("libssh2-''libssh2_version'-''currentday'.tar.;") .nes. ""
|
||||
$ then
|
||||
$ delete libssh2-'libssh2_version'-'currentday'.tar.;*
|
||||
$ endif
|
||||
$!
|
||||
$ gunzip libssh2-'libssh2_version'-'currentday'.tar.gz
|
||||
$!
|
||||
$ tarfile = f$search("libssh2-''libssh2_version'-''currentday'.tar.;")
|
||||
$ vmstar xf 'tarfile'
|
||||
|
||||
Downloading a stable build will need you to get rid of the currentday.
|
||||
|
||||
After the download, you should have a directory tree with a toplevel
|
||||
directory called [libssh2-x.y.z-yyyymmdd].
|
||||
One of the subdirectories is called vms.
|
||||
|
||||
Getting the libssh2 sources from the source backup in the binary kit
|
||||
--------------------------------------------------------------------
|
||||
|
||||
During installation of the binary kit, you are given the option
|
||||
of installing the sources. If chosen, a backup saveset with
|
||||
the complete libssh2 directory is made available in
|
||||
[gnv.common_src].
|
||||
|
||||
By restoring this backup saveset, you end up with the same
|
||||
set of files as by the direct download from libssh2.org.
|
||||
|
||||
|
||||
Building the library
|
||||
--------------------
|
||||
|
||||
To avoid all kinds of misunderstandings caused by firewalls thinking that
|
||||
a .com file must be an MS-DOS executable, all command procedures are called
|
||||
.dcl.
|
||||
|
||||
Go to the vms subdirectory in the download tree, and issue the following
|
||||
command:
|
||||
|
||||
@libssh2_make_lib.dcl
|
||||
|
||||
This should produce libssh2_x_y_z.exe in this same vms directory.
|
||||
|
||||
|
||||
|
||||
Building the examples
|
||||
---------------------
|
||||
|
||||
A number of examples are also part of the full libssh2 delivery.
|
||||
You can compile and link them either against the object library
|
||||
produced when building the shared image, or against the shared image
|
||||
produced in the step before.
|
||||
|
||||
You can compile only one of the examples by giving only the
|
||||
name part of the filename of the example as p1 to the
|
||||
build procedure:
|
||||
|
||||
@libssh2_make_example.dcl
|
||||
|
||||
or for instance
|
||||
|
||||
@libssh2_make_example.dcl sftp
|
||||
|
||||
By default, libssh2_make_example.dcl links to the object libraries
|
||||
produced by the libssh2_make_lib.dcl procedure. If you want to link
|
||||
against the shared image library made in the same procedure, invoke
|
||||
the procedure like so:
|
||||
|
||||
@libssh2_make_example.dcl sftp "SHARED"
|
||||
|
||||
The procdure defines a process logical gnv$libssh2 pointing to the shared
|
||||
image library in the directory, which obviously will not survive a logout.
|
||||
|
||||
|
||||
Building the help library
|
||||
-------------------------
|
||||
|
||||
The man pages can be converted to a VMS help library by issuing
|
||||
this command :
|
||||
|
||||
@libssh2_make_help.dcl
|
||||
|
||||
It uses a simple but fairly effective c program man2help.c
|
||||
to achieve this.
|
||||
|
||||
Building a PCSI kit
|
||||
-------------------
|
||||
|
||||
When you have built the shared library and the help library,
|
||||
you can build a PCSI kit by issueing this command:
|
||||
|
||||
@libssh2_make_kit.dcl
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user