summaryrefslogtreecommitdiff
path: root/vms/vms.c
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2015-02-19 20:51:15 -0600
committerCraig A. Berry <craigberry@mac.com>2015-02-19 20:51:15 -0600
commitce12d4b724e7322226a0165d33da7dcb1c8d333a (patch)
tree660c24eb38c42d7c34aa8462e1c9ec87d8e80443 /vms/vms.c
parent4ae858b05a7a2864dafa96969ff142be15d22997 (diff)
downloadperl-ce12d4b724e7322226a0165d33da7dcb1c8d333a.tar.gz
Fix some style issues in vms/vms.c.
This normalizes function definitions and addresses the most egregious of the Totally Forgot to Indent At All problems that are rampant throughout this file. For now I've punted on normalizing indents and tried to be consistent with whatever local variant seems to be in use. There are 2-, 3- (!), and 4-space indents, along with a liberal sprinkling of tab characters, most (but not all) of which seem to be intended to be equivalent to 8 spaces. I considered normalizing indents with some like astyle -c --style=linux vms.c but that produces 8400+ changed lines, which doesn't seem worth it.
Diffstat (limited to 'vms/vms.c')
-rw-r--r--vms/vms.c735
1 files changed, 429 insertions, 306 deletions
diff --git a/vms/vms.c b/vms/vms.c
index 1c02020b4a..032387bdfa 100644
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -270,10 +270,8 @@ static int vms_debug_on_exception = 0;
static int vms_debug_fileify = 0;
/* Simple logical name translation */
-static int simple_trnlnm
- (const char * logname,
- char * value,
- int value_len)
+static int
+simple_trnlnm(const char * logname, char * value, int value_len)
{
const $DESCRIPTOR(table_dsc, "LNM$FILE_DEV");
const unsigned long attr = LNM$M_CASE_BLIND;
@@ -310,10 +308,11 @@ static int simple_trnlnm
* changes to many other conversion routines.
*/
-static int is_unix_filespec(const char *path)
+static int
+is_unix_filespec(const char *path)
{
-int ret_val;
-const char * pch1;
+ int ret_val;
+ const char * pch1;
ret_val = 0;
if (strncmp(path,"\"^UP^",5) != 0) {
@@ -335,13 +334,11 @@ const char * pch1;
/* This routine converts a UCS-2 character to be VTF-7 encoded.
*/
-static void ucs2_to_vtf7
- (char *outspec,
- unsigned long ucs2_char,
- int * output_cnt)
+static void
+ucs2_to_vtf7(char *outspec, unsigned long ucs2_char, int * output_cnt)
{
-unsigned char * ucs_ptr;
-int hex;
+ unsigned char * ucs_ptr;
+ int hex;
ucs_ptr = (unsigned char *)&ucs2_char;
@@ -382,11 +379,11 @@ int hex;
*
* The return value is the number of characters read from the input string
*/
-static int copy_expand_unix_filename_escape
- (char *outspec, const char *inspec, int *output_cnt, const int * utf8_fl)
+static int
+copy_expand_unix_filename_escape(char *outspec, const char *inspec, int *output_cnt, const int * utf8_fl)
{
-int count;
-int utf8_flag;
+ int count;
+ int utf8_flag;
utf8_flag = 0;
if (utf8_fl)
@@ -578,11 +575,11 @@ int utf8_flag;
* The return value is the number of characters read from the input
* string
*/
-static int copy_expand_vms_filename_escape
- (char *outspec, const char *inspec, int *output_cnt)
+static int
+copy_expand_vms_filename_escape(char *outspec, const char *inspec, int *output_cnt)
{
-int count;
-int scnt;
+ int count;
+ int scnt;
count = 0;
*output_cnt = 0;
@@ -669,34 +666,24 @@ int scnt;
* string, then the passed file specification is probably a UNIX style
* path.
*/
-static int vms_split_path
- (const char * path,
- char * * volume,
- int * vol_len,
- char * * root,
- int * root_len,
- char * * dir,
- int * dir_len,
- char * * name,
- int * name_len,
- char * * ext,
- int * ext_len,
- char * * version,
- int * ver_len)
-{
-struct dsc$descriptor path_desc;
-int status;
-unsigned long flags;
-int ret_stat;
-struct filescan_itmlst_2 item_list[9];
-const int filespec = 0;
-const int nodespec = 1;
-const int devspec = 2;
-const int rootspec = 3;
-const int dirspec = 4;
-const int namespec = 5;
-const int typespec = 6;
-const int verspec = 7;
+static int
+vms_split_path(const char * path, char * * volume, int * vol_len, char * * root, int * root_len,
+ char * * dir, int * dir_len, char * * name, int * name_len,
+ char * * ext, int * ext_len, char * * version, int * ver_len)
+{
+ struct dsc$descriptor path_desc;
+ int status;
+ unsigned long flags;
+ int ret_stat;
+ struct filescan_itmlst_2 item_list[9];
+ const int filespec = 0;
+ const int nodespec = 1;
+ const int devspec = 2;
+ const int rootspec = 3;
+ const int dirspec = 4;
+ const int namespec = 5;
+ const int typespec = 6;
+ const int verspec = 7;
/* Assume the worst for an easy exit */
ret_stat = -1;
@@ -817,7 +804,9 @@ const int verspec = 7;
}
/* Routine to determine if the file specification ends with .dir */
-static int is_dir_ext(char * e_spec, int e_len, char * vs_spec, int vs_len) {
+static int
+is_dir_ext(char * e_spec, int e_len, char * vs_spec, int vs_len)
+{
/* e_len must be 4, and version must be <= 2 characters */
if (e_len != 4 || vs_len > 2)
@@ -1050,7 +1039,8 @@ Perl_vmstrnenv(const char *lnm, char *eqv, unsigned long int idx,
/*{{{ int my_trnlnm(const char *lnm, char *eqv, unsigned long int idx)*/
/* Define as a function so we can access statics. */
-int Perl_my_trnlnm(pTHX_ const char *lnm, char *eqv, unsigned long int idx)
+int
+Perl_my_trnlnm(pTHX_ const char *lnm, char *eqv, unsigned long int idx)
{
int flags = 0;
@@ -1252,7 +1242,7 @@ Perl_my_getenv_len(pTHX_ const char *lnm, unsigned long *len, bool sys)
/* Get rid of "000000/ in rooted filespecs */
if (*len > 7) {
- char * zeros;
+ char * zeros;
zeros = strstr(buf, "/000000/");
if (zeros != NULL) {
int mlen;
@@ -2424,13 +2414,14 @@ Perl_my_kill(int pid, int sig)
#define DCL_IVVERB 0x38090
#endif
-int Perl_vms_status_to_unix(int vms_status, int child_flag)
+int
+Perl_vms_status_to_unix(int vms_status, int child_flag)
{
-int facility;
-int fac_sp;
-int msg_no;
-int msg_status;
-int unix_status;
+ int facility;
+ int fac_sp;
+ int msg_no;
+ int msg_status;
+ int unix_status;
/* Assume the best or the worst */
if (vms_status & STS$M_SUCCESS)
@@ -2606,9 +2597,10 @@ int unix_status;
* error statuses that caused the errno value to be set.
*/
-int Perl_unix_status_to_vms(int unix_status)
+int
+Perl_unix_status_to_vms(int unix_status)
{
-int test_unix_status;
+ int test_unix_status;
/* Trivial cases first */
/*---------------------*/
@@ -3641,9 +3633,8 @@ store_pipelocs(pTHX)
PerlMem_free(unixdir);
}
-static I32
-Perl_cando_by_name_int
- (pTHX_ I32 bit, bool effective, const char *fname, int opts);
+static I32 Perl_cando_by_name_int(pTHX_ I32 bit, bool effective,
+ const char *fname, int opts);
#if !defined(PERL_IMPLICIT_CONTEXT)
#define cando_by_name_int Perl_cando_by_name_int
#else
@@ -3790,7 +3781,8 @@ vmspipe_tempfile(pTHX)
}
-static int vms_is_syscommand_xterm(void)
+static int
+vms_is_syscommand_xterm(void)
{
const static struct dsc$descriptor_s syscommand_dsc =
{ 11, DSC$K_DTYPE_T, DSC$K_CLASS_S, "SYS$COMMAND" };
@@ -3856,7 +3848,8 @@ static int vms_is_syscommand_xterm(void)
}
/* If we are on a DECTerm, we can pretend to fork xterms when requested */
-static PerlIO * create_forked_xterm(pTHX_ const char *cmd, const char *mode)
+static PerlIO*
+create_forked_xterm(pTHX_ const char *cmd, const char *mode)
{
int status;
int ret_stat;
@@ -4452,7 +4445,8 @@ Perl_my_popen(pTHX_ const char *cmd, const char *mode)
/* Routine to close and cleanup a pipe info structure */
-static I32 my_pclose_pinfo(pTHX_ pInfo info) {
+static I32
+my_pclose_pinfo(pTHX_ pInfo info) {
unsigned long int retsts;
int done, n;
@@ -4759,9 +4753,10 @@ my_gconvert(double val, int ndig, int trail, char *buf)
/*}}}*/
#if defined(__VAX) || !defined(NAML$C_MAXRSS)
-static int rms_free_search_context(struct FAB * fab)
+static int
+rms_free_search_context(struct FAB * fab)
{
-struct NAM * nam;
+ struct NAM * nam;
nam = fab->fab$l_nam;
nam->nam$b_nop |= NAM$M_SYNCHK;
@@ -4803,9 +4798,10 @@ struct NAM * nam;
#define rms_nam_name_type_l_size(nam) \
(nam.nam$b_name + nam.nam$b_type)
#else
-static int rms_free_search_context(struct FAB * fab)
+static int
+rms_free_search_context(struct FAB * fab)
{
-struct NAML * nam;
+ struct NAML * nam;
nam = fab->fab$l_naml;
nam->naml$b_nop |= NAM$M_SYNCHK;
@@ -4868,7 +4864,8 @@ struct NAML * nam;
* however in 8.3 the unlink/remove/delete routines will only properly handle
* them if one of the PCP modes is active.
*/
-static int rms_erase(const char * vmsname)
+static int
+rms_erase(const char * vmsname)
{
int status;
struct FAB myfab = cc$rms_fab;
@@ -4901,28 +4898,28 @@ vms_rename_with_acl(pTHX_ const struct dsc$descriptor_s * vms_src_dsc,
/* I can not find online documentation for $change_acl
* it appears to be replaced by $set_security some time ago */
-const unsigned int access_mode = 0;
-$DESCRIPTOR(obj_file_dsc,"FILE");
-char *vmsname;
-char *rslt;
-unsigned long int jpicode = JPI$_UIC;
-int aclsts, fndsts, rnsts = -1;
-unsigned int ctx = 0;
-struct dsc$descriptor_s fildsc = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
-struct dsc$descriptor_s * clean_dsc;
-
-struct myacedef {
- unsigned char myace$b_length;
- unsigned char myace$b_type;
- unsigned short int myace$w_flags;
- unsigned long int myace$l_access;
- unsigned long int myace$l_ident;
-} newace = { sizeof(struct myacedef), ACE$C_KEYID, 0,
- ACE$M_READ | ACE$M_WRITE | ACE$M_DELETE | ACE$M_CONTROL,
- 0},
- oldace = { sizeof(struct myacedef), ACE$C_KEYID, 0, 0, 0};
-
-struct item_list_3
+ const unsigned int access_mode = 0;
+ $DESCRIPTOR(obj_file_dsc,"FILE");
+ char *vmsname;
+ char *rslt;
+ unsigned long int jpicode = JPI$_UIC;
+ int aclsts, fndsts, rnsts = -1;
+ unsigned int ctx = 0;
+ struct dsc$descriptor_s fildsc = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
+ struct dsc$descriptor_s * clean_dsc;
+
+ struct myacedef {
+ unsigned char myace$b_length;
+ unsigned char myace$b_type;
+ unsigned short int myace$w_flags;
+ unsigned long int myace$l_access;
+ unsigned long int myace$l_ident;
+ } newace = { sizeof(struct myacedef), ACE$C_KEYID, 0,
+ ACE$M_READ | ACE$M_WRITE | ACE$M_DELETE | ACE$M_CONTROL,
+ 0},
+ oldace = { sizeof(struct myacedef), ACE$C_KEYID, 0, 0, 0};
+
+ struct item_list_3
findlst[3] = {{sizeof oldace, OSS$_ACL_FIND_ENTRY, &oldace, 0},
{sizeof oldace, OSS$_ACL_READ_ENTRY, &oldace, 0},
{0,0,0,0}},
@@ -5059,12 +5056,12 @@ struct item_list_3
int
Perl_rename(pTHX_ const char *src, const char * dst)
{
-int retval;
-int pre_delete = 0;
-int src_sts;
-int dst_sts;
-Stat_t src_st;
-Stat_t dst_st;
+ int retval;
+ int pre_delete = 0;
+ int src_sts;
+ int dst_sts;
+ Stat_t src_st;
+ Stat_t dst_st;
/* Validate the source file */
src_sts = flex_lstat(src, &src_st);
@@ -5827,18 +5824,31 @@ mp_do_rmsexpand
}
/*}}}*/
/* External entry points */
-char *Perl_rmsexpand(pTHX_ const char *spec, char *buf, const char *def, unsigned opt)
-{ return do_rmsexpand(spec,buf,0,def,opt,NULL,NULL); }
-char *Perl_rmsexpand_ts(pTHX_ const char *spec, char *buf, const char *def, unsigned opt)
-{ return do_rmsexpand(spec,buf,1,def,opt,NULL,NULL); }
-char *Perl_rmsexpand_utf8
- (pTHX_ const char *spec, char *buf, const char *def,
- unsigned opt, int * fs_utf8, int * dfs_utf8)
-{ return do_rmsexpand(spec,buf,0,def,opt, fs_utf8, dfs_utf8); }
-char *Perl_rmsexpand_utf8_ts
- (pTHX_ const char *spec, char *buf, const char *def,
- unsigned opt, int * fs_utf8, int * dfs_utf8)
-{ return do_rmsexpand(spec,buf,1,def,opt, fs_utf8, dfs_utf8); }
+char *
+Perl_rmsexpand(pTHX_ const char *spec, char *buf, const char *def, unsigned opt)
+{
+ return do_rmsexpand(spec, buf, 0, def, opt, NULL, NULL);
+}
+
+char *
+Perl_rmsexpand_ts(pTHX_ const char *spec, char *buf, const char *def, unsigned opt)
+{
+ return do_rmsexpand(spec, buf, 1, def, opt, NULL, NULL);
+}
+
+char *
+Perl_rmsexpand_utf8(pTHX_ const char *spec, char *buf, const char *def,
+ unsigned opt, int * fs_utf8, int * dfs_utf8)
+{
+ return do_rmsexpand(spec, buf, 0, def, opt, fs_utf8, dfs_utf8);
+}
+
+char *
+Perl_rmsexpand_utf8_ts(pTHX_ const char *spec, char *buf, const char *def,
+ unsigned opt, int * fs_utf8, int * dfs_utf8)
+{
+ return do_rmsexpand(spec, buf, 1, def, opt, fs_utf8, dfs_utf8);
+}
/*
@@ -6380,7 +6390,8 @@ int_fileify_dirspec(const char *dir, char *buf, int *utf8_fl)
/*{{{ char *fileify_dirspec[_ts](char *dir, char *buf, int * utf8_fl)*/
-static char *mp_do_fileify_dirspec(pTHX_ const char *dir,char *buf,int ts, int *utf8_fl)
+static char *
+mp_do_fileify_dirspec(pTHX_ const char *dir,char *buf,int ts, int *utf8_fl)
{
static char __fileify_retbuf[VMS_MAXRSS];
char * fileified, *ret_spec, *ret_buf;
@@ -6411,19 +6422,36 @@ static char *mp_do_fileify_dirspec(pTHX_ const char *dir,char *buf,int ts, int *
/*}}}*/
/* External entry points */
-char *Perl_fileify_dirspec(pTHX_ const char *dir, char *buf)
-{ return do_fileify_dirspec(dir,buf,0,NULL); }
-char *Perl_fileify_dirspec_ts(pTHX_ const char *dir, char *buf)
-{ return do_fileify_dirspec(dir,buf,1,NULL); }
-char *Perl_fileify_dirspec_utf8(pTHX_ const char *dir, char *buf, int * utf8_fl)
-{ return do_fileify_dirspec(dir,buf,0,utf8_fl); }
-char *Perl_fileify_dirspec_utf8_ts(pTHX_ const char *dir, char *buf, int * utf8_fl)
-{ return do_fileify_dirspec(dir,buf,1,utf8_fl); }
-
-static char * int_pathify_dirspec_simple(const char * dir, char * buf,
+char *
+Perl_fileify_dirspec(pTHX_ const char *dir, char *buf)
+{
+ return do_fileify_dirspec(dir, buf, 0, NULL);
+}
+
+char *
+Perl_fileify_dirspec_ts(pTHX_ const char *dir, char *buf)
+{
+ return do_fileify_dirspec(dir, buf, 1, NULL);
+}
+
+char *
+Perl_fileify_dirspec_utf8(pTHX_ const char *dir, char *buf, int * utf8_fl)
+{
+ return do_fileify_dirspec(dir, buf, 0, utf8_fl);
+}
+
+char *
+Perl_fileify_dirspec_utf8_ts(pTHX_ const char *dir, char *buf, int * utf8_fl)
+{
+ return do_fileify_dirspec(dir, buf, 1, utf8_fl);
+}
+
+static char *
+int_pathify_dirspec_simple(const char * dir, char * buf,
char * v_spec, int v_len, char * r_spec, int r_len,
char * d_spec, int d_len, char * n_spec, int n_len,
- char * e_spec, int e_len, char * vs_spec, int vs_len) {
+ char * e_spec, int e_len, char * vs_spec, int vs_len)
+{
/* VMS specification - Try to do this the simple way */
if ((v_len + r_len > 0) || (d_len > 0)) {
@@ -6513,7 +6541,8 @@ static char * int_pathify_dirspec_simple(const char * dir, char * buf,
/* Internal routine to make sure or convert a directory to be in a */
/* path specification. No utf8 flag because it is not changed or used */
-static char *int_pathify_dirspec(const char *dir, char *buf)
+static char *
+int_pathify_dirspec(const char *dir, char *buf)
{
char * v_spec, * r_spec, * d_spec, * n_spec, * e_spec, * vs_spec;
int sts, v_len, r_len, d_len, n_len, e_len, vs_len;
@@ -6805,7 +6834,8 @@ static char *int_pathify_dirspec(const char *dir, char *buf)
}
/*{{{ char *pathify_dirspec[_ts](char *path, char *buf)*/
-static char *mp_do_pathify_dirspec(pTHX_ const char *dir,char *buf, int ts, int * utf8_fl)
+static char *
+mp_do_pathify_dirspec(pTHX_ const char *dir,char *buf, int ts, int * utf8_fl)
{
static char __pathify_retbuf[VMS_MAXRSS];
char * pathified, *ret_spec, *ret_buf;
@@ -6837,18 +6867,34 @@ static char *mp_do_pathify_dirspec(pTHX_ const char *dir,char *buf, int ts, int
/* External entry points */
-char *Perl_pathify_dirspec(pTHX_ const char *dir, char *buf)
-{ return do_pathify_dirspec(dir,buf,0,NULL); }
-char *Perl_pathify_dirspec_ts(pTHX_ const char *dir, char *buf)
-{ return do_pathify_dirspec(dir,buf,1,NULL); }
-char *Perl_pathify_dirspec_utf8(pTHX_ const char *dir, char *buf, int *utf8_fl)
-{ return do_pathify_dirspec(dir,buf,0,utf8_fl); }
-char *Perl_pathify_dirspec_utf8_ts(pTHX_ const char *dir, char *buf, int *utf8_fl)
-{ return do_pathify_dirspec(dir,buf,1,utf8_fl); }
+char *
+Perl_pathify_dirspec(pTHX_ const char *dir, char *buf)
+{
+ return do_pathify_dirspec(dir, buf, 0, NULL);
+}
+
+char *
+Perl_pathify_dirspec_ts(pTHX_ const char *dir, char *buf)
+{
+ return do_pathify_dirspec(dir, buf, 1, NULL);
+}
+
+char *
+Perl_pathify_dirspec_utf8(pTHX_ const char *dir, char *buf, int *utf8_fl)
+{
+ return do_pathify_dirspec(dir, buf, 0, utf8_fl);
+}
+
+char *
+Perl_pathify_dirspec_utf8_ts(pTHX_ const char *dir, char *buf, int *utf8_fl)
+{
+ return do_pathify_dirspec(dir, buf, 1, utf8_fl);
+}
/* Internal tounixspec routine that does not use a thread context */
/*{{{ char *int_tounixspec[_ts](char *spec, char *buf, int *)*/
-static char *int_tounixspec(const char *spec, char *rslt, int * utf8_fl)
+static char *
+int_tounixspec(const char *spec, char *rslt, int * utf8_fl)
{
char *dirend, *cp1, *cp3, *tmp;
const char *cp2;
@@ -7192,8 +7238,8 @@ static char *int_tounixspec(const char *spec, char *rslt, int * utf8_fl)
* VMS device root or concealed root.
*/
{
- int ulen;
- char * zeros;
+ int ulen;
+ char * zeros;
ulen = strlen(rslt);
@@ -7219,7 +7265,8 @@ static char *int_tounixspec(const char *spec, char *rslt, int * utf8_fl)
/*{{{ char *tounixspec[_ts](char *spec, char *buf, int *)*/
-static char *mp_do_tounixspec(pTHX_ const char *spec, char *buf, int ts, int * utf8_fl)
+static char *
+mp_do_tounixspec(pTHX_ const char *spec, char *buf, int ts, int * utf8_fl)
{
static char __tounixspec_retbuf[VMS_MAXRSS];
char * unixspec, *ret_spec, *ret_buf;
@@ -7250,14 +7297,29 @@ static char *mp_do_tounixspec(pTHX_ const char *spec, char *buf, int ts, int * u
} /* end of do_tounixspec() */
/*}}}*/
/* External entry points */
-char *Perl_tounixspec(pTHX_ const char *spec, char *buf)
- { return do_tounixspec(spec,buf,0, NULL); }
-char *Perl_tounixspec_ts(pTHX_ const char *spec, char *buf)
- { return do_tounixspec(spec,buf,1, NULL); }
-char *Perl_tounixspec_utf8(pTHX_ const char *spec, char *buf, int * utf8_fl)
- { return do_tounixspec(spec,buf,0, utf8_fl); }
-char *Perl_tounixspec_utf8_ts(pTHX_ const char *spec, char *buf, int * utf8_fl)
- { return do_tounixspec(spec,buf,1, utf8_fl); }
+char *
+Perl_tounixspec(pTHX_ const char *spec, char *buf)
+{
+ return do_tounixspec(spec, buf, 0, NULL);
+}
+
+char *
+Perl_tounixspec_ts(pTHX_ const char *spec, char *buf)
+{
+ return do_tounixspec(spec,buf,1, NULL);
+}
+
+char *
+Perl_tounixspec_utf8(pTHX_ const char *spec, char *buf, int * utf8_fl)
+{
+ return do_tounixspec(spec,buf,0, utf8_fl);
+}
+
+char *
+Perl_tounixspec_utf8_ts(pTHX_ const char *spec, char *buf, int * utf8_fl)
+{
+ return do_tounixspec(spec,buf,1, utf8_fl);
+}
#if __CRTL_VER >= 70200000 && !defined(__VAX)
@@ -7276,26 +7338,25 @@ char *Perl_tounixspec_utf8_ts(pTHX_ const char *spec, char *buf, int * utf8_fl)
It is used only internally by posix_to_vmsspec_hardway().
*/
-static int posix_root_to_vms
- (char *vmspath, int vmspath_len,
- const char *unixpath,
- const int * utf8_fl)
-{
-int sts;
-struct FAB myfab = cc$rms_fab;
-rms_setup_nam(mynam);
-struct dsc$descriptor_s dvidsc = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
-struct dsc$descriptor_s specdsc = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
-char * esa, * esal, * rsa, * rsal;
-int dir_flag;
-int unixlen;
-
- dir_flag = 0;
- vmspath[0] = '\0';
- unixlen = strlen(unixpath);
- if (unixlen == 0) {
- return RMS$_FNF;
- }
+static int
+posix_root_to_vms(char *vmspath, int vmspath_len,
+ const char *unixpath, const int * utf8_fl)
+{
+ int sts;
+ struct FAB myfab = cc$rms_fab;
+ rms_setup_nam(mynam);
+ struct dsc$descriptor_s dvidsc = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
+ struct dsc$descriptor_s specdsc = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, 0};
+ char * esa, * esal, * rsa, * rsal;
+ int dir_flag;
+ int unixlen;
+
+ dir_flag = 0;
+ vmspath[0] = '\0';
+ unixlen = strlen(unixpath);
+ if (unixlen == 0) {
+ return RMS$_FNF;
+ }
#if __CRTL_VER >= 80200000
/* If not a posix spec already, convert it */
@@ -7312,8 +7373,8 @@ int unixlen;
else
#endif
{
- int path_len;
- int i,j;
+ int path_len;
+ int i,j;
/* Check to see if this is under the POSIX root */
if (decc_disable_posix_root) {
@@ -7485,14 +7546,11 @@ int unixlen;
*/
static int
-slash_dev_special_to_vms
- (const char * unixptr,
- char * vmspath,
- int vmspath_len)
+slash_dev_special_to_vms(const char *unixptr, char *vmspath, int vmspath_len)
{
-char * nextslash;
-int len;
-int cmp;
+ char * nextslash;
+ int len;
+ int cmp;
unixptr += 4;
nextslash = strchr(unixptr, '/');
@@ -7520,25 +7578,24 @@ int cmp;
through with out interpretation instead of being escaped.
*/
-static int posix_to_vmsspec_hardway
- (char *vmspath, int vmspath_len,
- const char *unixpath,
- int dir_flag,
- int * utf8_fl) {
-
-char *esa;
-const char *unixptr;
-const char *unixend;
-char *vmsptr;
-const char *lastslash;
-const char *lastdot;
-int unixlen;
-int vmslen;
-int dir_start;
-int dir_dot;
-int quoted;
-char * v_spec, * r_spec, * d_spec, * n_spec, * e_spec, * vs_spec;
-int sts, v_len, r_len, d_len, n_len, e_len, vs_len;
+static int
+posix_to_vmsspec_hardway(char *vmspath, int vmspath_len, const char *unixpath,
+ int dir_flag, int * utf8_fl)
+{
+
+ char *esa;
+ const char *unixptr;
+ const char *unixend;
+ char *vmsptr;
+ const char *lastslash;
+ const char *lastdot;
+ int unixlen;
+ int vmslen;
+ int dir_start;
+ int dir_dot;
+ int quoted;
+ char * v_spec, * r_spec, * d_spec, * n_spec, * e_spec, * vs_spec;
+ int sts, v_len, r_len, d_len, n_len, e_len, vs_len;
if (utf8_fl != NULL)
*utf8_fl = 0;
@@ -7993,9 +8050,9 @@ int sts, v_len, r_len, d_len, n_len, e_len, vs_len;
} /* End of relative/absolute path handling */
while ((unixptr <= unixend) && (vmslen < vmspath_len)){
- int dash_flag;
- int in_cnt;
- int out_cnt;
+ int dash_flag;
+ int in_cnt;
+ int out_cnt;
dash_flag = 0;
@@ -8227,10 +8284,11 @@ int sts, v_len, r_len, d_len, n_len, e_len, vs_len;
#endif
/* Eventual routine to convert a UTF-8 specification to VTF-7. */
-static char * utf8_to_vtf7(char * rslt, const char * path, int *utf8_fl)
+static char *
+utf8_to_vtf7(char * rslt, const char * path, int *utf8_fl)
{
-char * result;
-int utf8_flag;
+ char * result;
+ int utf8_flag;
/* If a UTF8 flag is being passed, honor it */
utf8_flag = 0;
@@ -8268,8 +8326,9 @@ int utf8_flag;
} STMT_END
/*{{{ char *tovmsspec[_ts](char *path, char *buf, int * utf8_flag)*/
-static char *int_tovmsspec
- (const char *path, char *rslt, int dir_flag, int * utf8_flag) {
+static char *
+int_tovmsspec(const char *path, char *rslt, int dir_flag, int * utf8_flag)
+{
char *dirend;
char *lastdot;
char *cp1;
@@ -8730,9 +8789,10 @@ static char *int_tovmsspec
/*{{{ char *tovmsspec[_ts](char *path, char *buf, int * utf8_flag)*/
-static char *mp_do_tovmsspec
- (pTHX_ const char *path, char *buf, int ts, int dir_flag, int * utf8_flag) {
- static char __tovmsspec_retbuf[VMS_MAXRSS];
+static char *
+mp_do_tovmsspec(pTHX_ const char *path, char *buf, int ts, int dir_flag, int * utf8_flag)
+{
+ static char __tovmsspec_retbuf[VMS_MAXRSS];
char * vmsspec, *ret_spec, *ret_buf;
vmsspec = NULL;
@@ -8761,19 +8821,35 @@ static char *mp_do_tovmsspec
} /* end of mp_do_tovmsspec() */
/*}}}*/
/* External entry points */
-char *Perl_tovmsspec(pTHX_ const char *path, char *buf)
- { return do_tovmsspec(path,buf,0,NULL); }
-char *Perl_tovmsspec_ts(pTHX_ const char *path, char *buf)
- { return do_tovmsspec(path,buf,1,NULL); }
-char *Perl_tovmsspec_utf8(pTHX_ const char *path, char *buf, int * utf8_fl)
- { return do_tovmsspec(path,buf,0,utf8_fl); }
-char *Perl_tovmsspec_utf8_ts(pTHX_ const char *path, char *buf, int * utf8_fl)
- { return do_tovmsspec(path,buf,1,utf8_fl); }
+char *
+Perl_tovmsspec(pTHX_ const char *path, char *buf)
+{
+ return do_tovmsspec(path, buf, 0, NULL);
+}
+
+char *
+Perl_tovmsspec_ts(pTHX_ const char *path, char *buf)
+{
+ return do_tovmsspec(path, buf, 1, NULL);
+}
+
+char *
+Perl_tovmsspec_utf8(pTHX_ const char *path, char *buf, int * utf8_fl)
+{
+ return do_tovmsspec(path, buf, 0, utf8_fl);
+}
+
+char *
+Perl_tovmsspec_utf8_ts(pTHX_ const char *path, char *buf, int * utf8_fl)
+{
+ return do_tovmsspec(path, buf, 1, utf8_fl);
+}
/*{{{ char *int_tovmspath(char *path, char *buf, const int *)*/
/* Internal routine for use with out an explicit context present */
-static char * int_tovmspath(const char *path, char *buf, int * utf8_fl) {
-
+static char *
+int_tovmspath(const char *path, char *buf, int * utf8_fl)
+{
char * ret_spec, *pathified;
if (path == NULL)
@@ -8798,7 +8874,9 @@ static char * int_tovmspath(const char *path, char *buf, int * utf8_fl) {
}
/*{{{ char *tovmspath[_ts](char *path, char *buf, const int *)*/
-static char *mp_do_tovmspath(pTHX_ const char *path, char *buf, int ts, int * utf8_fl) {
+static char *
+mp_do_tovmspath(pTHX_ const char *path, char *buf, int ts, int * utf8_fl)
+{
static char __tovmspath_retbuf[VMS_MAXRSS];
int vmslen;
char *pathified, *vmsified, *cp;
@@ -8840,18 +8918,35 @@ static char *mp_do_tovmspath(pTHX_ const char *path, char *buf, int ts, int * ut
} /* end of do_tovmspath() */
/*}}}*/
/* External entry points */
-char *Perl_tovmspath(pTHX_ const char *path, char *buf)
- { return do_tovmspath(path,buf,0, NULL); }
-char *Perl_tovmspath_ts(pTHX_ const char *path, char *buf)
- { return do_tovmspath(path,buf,1, NULL); }
-char *Perl_tovmspath_utf8(pTHX_ const char *path, char *buf, int *utf8_fl)
- { return do_tovmspath(path,buf,0,utf8_fl); }
-char *Perl_tovmspath_utf8_ts(pTHX_ const char *path, char *buf, int *utf8_fl)
- { return do_tovmspath(path,buf,1,utf8_fl); }
+char *
+Perl_tovmspath(pTHX_ const char *path, char *buf)
+{
+ return do_tovmspath(path, buf, 0, NULL);
+}
+
+char *
+Perl_tovmspath_ts(pTHX_ const char *path, char *buf)
+{
+ return do_tovmspath(path, buf, 1, NULL);
+}
+
+char *
+Perl_tovmspath_utf8(pTHX_ const char *path, char *buf, int *utf8_fl)
+{
+ return do_tovmspath(path, buf, 0, utf8_fl);
+}
+
+char *
+Perl_tovmspath_utf8_ts(pTHX_ const char *path, char *buf, int *utf8_fl)
+{
+ return do_tovmspath(path, buf, 1, utf8_fl);
+}
/*{{{ char *tounixpath[_ts](char *path, char *buf, int * utf8_fl)*/
-static char *mp_do_tounixpath(pTHX_ const char *path, char *buf, int ts, int * utf8_fl) {
+static char *
+mp_do_tounixpath(pTHX_ const char *path, char *buf, int ts, int * utf8_fl)
+{
static char __tounixpath_retbuf[VMS_MAXRSS];
int unixlen;
char *pathified, *unixified, *cp;
@@ -8894,14 +8989,29 @@ static char *mp_do_tounixpath(pTHX_ const char *path, char *buf, int ts, int * u
} /* end of do_tounixpath() */
/*}}}*/
/* External entry points */
-char *Perl_tounixpath(pTHX_ const char *path, char *buf)
- { return do_tounixpath(path,buf,0,NULL); }
-char *Perl_tounixpath_ts(pTHX_ const char *path, char *buf)
- { return do_tounixpath(path,buf,1,NULL); }
-char *Perl_tounixpath_utf8(pTHX_ const char *path, char *buf, int * utf8_fl)
- { return do_tounixpath(path,buf,0,utf8_fl); }
-char *Perl_tounixpath_utf8_ts(pTHX_ const char *path, char *buf, int * utf8_fl)
- { return do_tounixpath(path,buf,1,utf8_fl); }
+char *
+Perl_tounixpath(pTHX_ const char *path, char *buf)
+{
+ return do_tounixpath(path, buf, 0, NULL);
+}
+
+char *
+Perl_tounixpath_ts(pTHX_ const char *path, char *buf)
+{
+ return do_tounixpath(path, buf, 1, NULL);
+}
+
+char *
+Perl_tounixpath_utf8(pTHX_ const char *path, char *buf, int * utf8_fl)
+{
+ return do_tounixpath(path, buf, 0, utf8_fl);
+}
+
+char *
+Perl_tounixpath_utf8_ts(pTHX_ const char *path, char *buf, int * utf8_fl)
+{
+ return do_tounixpath(path, buf, 1, utf8_fl);
+}
/*
* @(#)argproc.c 2.2 94/08/16 Mark Pizzolato (mark AT infocomm DOT com)
@@ -9194,10 +9304,8 @@ mp_getredirection(pTHX_ int *ac, char ***av)
} /* end of getredirection() */
/*}}}*/
-static void add_item(struct list_item **head,
- struct list_item **tail,
- char *value,
- int *count)
+static void
+add_item(struct list_item **head, struct list_item **tail, char *value, int *count)
{
if (*head == 0)
{
@@ -9214,26 +9322,25 @@ static void add_item(struct list_item **head,
++(*count);
}
-static void mp_expand_wild_cards(pTHX_ char *item,
- struct list_item **head,
- struct list_item **tail,
- int *count)
-{
-int expcount = 0;
-unsigned long int context = 0;
-int isunix = 0;
-int item_len = 0;
-char *had_version;
-char *had_device;
-int had_directory;
-char *devdir,*cp;
-char *vmsspec;
-$DESCRIPTOR(filespec, "");
-$DESCRIPTOR(defaultspec, "SYS$DISK:[]");
-$DESCRIPTOR(resultspec, "");
-unsigned long int lff_flags = 0;
-int sts;
-int rms_sts;
+static void
+mp_expand_wild_cards(pTHX_ char *item, struct list_item **head,
+ struct list_item **tail, int *count)
+{
+ int expcount = 0;
+ unsigned long int context = 0;
+ int isunix = 0;
+ int item_len = 0;
+ char *had_version;
+ char *had_device;
+ int had_directory;
+ char *devdir,*cp;
+ char *vmsspec;
+ $DESCRIPTOR(filespec, "");
+ $DESCRIPTOR(defaultspec, "SYS$DISK:[]");
+ $DESCRIPTOR(resultspec, "");
+ unsigned long int lff_flags = 0;
+ int sts;
+ int rms_sts;
#ifdef VMS_LONGNAME_SUPPORT
lff_flags = LIB$M_FIL_LONG_NAMES;
@@ -9391,18 +9498,19 @@ pipe_and_fork(pTHX_ char **cmargv)
}
}
-static int background_process(pTHX_ int argc, char **argv)
-{
-char command[MAX_DCL_SYMBOL + 1] = "$";
-$DESCRIPTOR(value, "");
-static $DESCRIPTOR(cmd, "BACKGROUND$COMMAND");
-static $DESCRIPTOR(null, "NLA0:");
-static $DESCRIPTOR(pidsymbol, "SHELL_BACKGROUND_PID");
-char pidstring[80];
-$DESCRIPTOR(pidstr, "");
-int pid;
-unsigned long int flags = 17, one = 1, retsts;
-int len;
+static int
+background_process(pTHX_ int argc, char **argv)
+{
+ char command[MAX_DCL_SYMBOL + 1] = "$";
+ $DESCRIPTOR(value, "");
+ static $DESCRIPTOR(cmd, "BACKGROUND$COMMAND");
+ static $DESCRIPTOR(null, "NLA0:");
+ static $DESCRIPTOR(pidsymbol, "SHELL_BACKGROUND_PID");
+ char pidstring[80];
+ $DESCRIPTOR(pidstr, "");
+ int pid;
+ unsigned long int flags = 17, one = 1, retsts;
+ int len;
len = my_strlcat(command, argv[0], sizeof(command));
while (--argc && (len < MAX_DCL_SYMBOL))
@@ -9552,8 +9660,8 @@ vms_image_init(int *argcp, char ***argvp)
* directory. This needs to be removed.
*/
if (decc_filename_unix_report) {
- char * zeros;
- int ulen;
+ char * zeros;
+ int ulen;
ulen = strlen(argvp[0][0]);
if (ulen > 7) {
zeros = strstr(argvp[0][0], "/000000/");
@@ -10770,8 +10878,8 @@ setup_cmddsc(pTHX_ const char *incmd, int check_img, int *suggest_quote,
bool
Perl_vms_do_aexec(pTHX_ SV *really,SV **mark,SV **sp)
{
-bool exec_sts;
-char * cmd;
+ bool exec_sts;
+ char * cmd;
if (sp > mark) {
if (vfork_called) { /* this follows a vfork - act Unixish */
@@ -10852,9 +10960,9 @@ int do_spawn2(pTHX_ const char *, int);
int
Perl_do_aspawn(pTHX_ SV* really, SV** mark, SV** sp)
{
-unsigned long int sts;
-char * cmd;
-int flags = 0;
+ unsigned long int sts;
+ char * cmd;
+ int flags = 0;
if (sp > mark) {
@@ -10974,7 +11082,8 @@ static unsigned int *sockflags, sockflagsize;
* likely to be opened by a name.
*/
/*{{{ FILE *my_fdopen(int fd, const char *mode)*/
-FILE *my_fdopen(int fd, const char *mode)
+FILE *
+my_fdopen(int fd, const char *mode)
{
FILE *fp = fdopen(fd, mode);
@@ -11002,7 +11111,8 @@ FILE *my_fdopen(int fd, const char *mode)
* via freopen(). >> Todo
*/
/*{{{ int my_fclose(FILE *fp)*/
-int my_fclose(FILE *fp) {
+int
+my_fclose(FILE *fp) {
if (fp) {
unsigned int fd = fileno(fp);
unsigned int fdoff = fd / sizeof(unsigned int);
@@ -11173,7 +11283,8 @@ static char __pw_namecache[UAI$S_IDENT+1];
/*
* This routine does most of the work extracting the user information.
*/
-static int fillpasswd (pTHX_ const char *name, struct passwd *pwd)
+static int
+fillpasswd (pTHX_ const char *name, struct passwd *pwd)
{
static struct {
unsigned char length;
@@ -11255,7 +11366,8 @@ static int fillpasswd (pTHX_ const char *name, struct passwd *pwd)
* Get information for a named user.
*/
/*{{{struct passwd *getpwnam(char *name)*/
-struct passwd *Perl_my_getpwnam(pTHX_ const char *name)
+struct passwd *
+Perl_my_getpwnam(pTHX_ const char *name)
{
struct dsc$descriptor_s name_desc;
union uicdef uic;
@@ -11292,7 +11404,8 @@ struct passwd *Perl_my_getpwnam(pTHX_ const char *name)
* Called by my_getpwent with uid=-1 to list all users.
*/
/*{{{struct passwd *my_getpwuid(Uid_t uid)*/
-struct passwd *Perl_my_getpwuid(pTHX_ Uid_t uid)
+struct passwd *
+Perl_my_getpwuid(pTHX_ Uid_t uid)
{
const $DESCRIPTOR(name_desc,__pw_namecache);
unsigned short lname;
@@ -11347,7 +11460,8 @@ struct passwd *Perl_my_getpwuid(pTHX_ Uid_t uid)
* Get information for next user.
*/
/*{{{struct passwd *my_getpwent()*/
-struct passwd *Perl_my_getpwent(pTHX)
+struct passwd *
+Perl_my_getpwent(pTHX)
{
return (my_getpwuid((unsigned int) -1));
}
@@ -11357,7 +11471,8 @@ struct passwd *Perl_my_getpwent(pTHX)
* Finish searching rights database for users.
*/
/*{{{void my_endpwent()*/
-void Perl_my_endpwent(pTHX)
+void
+Perl_my_endpwent(pTHX)
{
if (contxt) {
_ckvmssts(sys$finish_rdb(&contxt));
@@ -11423,7 +11538,8 @@ static time_t toloc_dst(time_t utc) {
*/
/*{{{time_t my_time(time_t *timep)*/
-time_t Perl_my_time(pTHX_ time_t *timep)
+time_t
+Perl_my_time(pTHX_ time_t *timep)
{
time_t when;
struct tm *tm_p;
@@ -11545,7 +11661,8 @@ Perl_my_localtime(pTHX_ const time_t *timep)
static const long int utime_baseadjust[2] = { 0x4beb4000, 0x7c9567 };
/*{{{int my_utime(const char *path, const struct utimbuf *utimes)*/
-int Perl_my_utime(pTHX_ const char *file, const struct utimbuf *utimes)
+int
+Perl_my_utime(pTHX_ const char *file, const struct utimbuf *utimes)
{
#if __CRTL_VER >= 70300000
struct utimbuf utc_utimes, *utc_utimesp;
@@ -11761,7 +11878,8 @@ int Perl_my_utime(pTHX_ const char *file, const struct utimbuf *utimes)
* on the first call.
*/
#define LOCKID_MASK 0x80000000 /* Use 0 to force device name use only */
-static mydev_t encode_dev (pTHX_ const char *dev)
+static mydev_t
+encode_dev (pTHX_ const char *dev)
{
int i;
unsigned long int f;
@@ -11851,8 +11969,7 @@ Perl_flex_stat_int(pTHX_ const char *fspec, Stat_t *statbufp, int lstat_flag);
#define flex_stat_int(a,b,c) Perl_flex_stat_int(aTHX_ a,b,c)
static I32
-Perl_cando_by_name_int
- (pTHX_ I32 bit, bool effective, const char *fname, int opts)
+Perl_cando_by_name_int(pTHX_ I32 bit, bool effective, const char *fname, int opts)
{
char usrname[L_cuserid];
struct dsc$descriptor_s usrdsc =
@@ -12994,9 +13111,7 @@ hushexit_fromperl(pTHX_ CV *cv)
PerlIO *
-Perl_vms_start_glob
- (pTHX_ SV *tmpglob,
- IO *io)
+Perl_vms_start_glob(pTHX_ SV *tmpglob, IO *io)
{
PerlIO *fp;
struct vs_str_st *rslt;
@@ -13481,12 +13596,12 @@ int vms_fid_to_name(char * outname, int outlen,
#pragma message disable MISALGNDMEM
#pragma member_alignment save
#pragma nomember_alignment
-struct statbuf_t {
- char * st_dev;
- unsigned short st_ino[3];
- unsigned short old_st_mode;
- unsigned long padl[30]; /* plenty of room */
-} statbuf;
+ struct statbuf_t {
+ char * st_dev;
+ unsigned short st_ino[3];
+ unsigned short old_st_mode;
+ unsigned long padl[30]; /* plenty of room */
+ } statbuf;
#pragma message restore
#pragma member_alignment restore
@@ -13835,11 +13950,17 @@ mp_do_vms_realname(pTHX_ const char *filespec, char *outbuf,
/*}}}*/
/* External entry points */
-char *Perl_vms_realpath(pTHX_ const char *filespec, char *outbuf, int *utf8_fl)
-{ return do_vms_realpath(filespec, outbuf, utf8_fl); }
+char *
+Perl_vms_realpath(pTHX_ const char *filespec, char *outbuf, int *utf8_fl)
+{
+ return do_vms_realpath(filespec, outbuf, utf8_fl);
+}
-char *Perl_vms_realname(pTHX_ const char *filespec, char *outbuf, int *utf8_fl)
-{ return do_vms_realname(filespec, outbuf, utf8_fl); }
+char *
+Perl_vms_realname(pTHX_ const char *filespec, char *outbuf, int *utf8_fl)
+{
+ return do_vms_realname(filespec, outbuf, utf8_fl);
+}
/* case_tolerant */
@@ -13847,20 +13968,22 @@ char *Perl_vms_realname(pTHX_ const char *filespec, char *outbuf, int *utf8_fl)
/* OpenVMS provides a case sensitive implementation of ODS-5 and this is
* controlled by a process setting.
*/
-int do_vms_case_tolerant(void)
+int
+do_vms_case_tolerant(void)
{
return vms_process_case_tolerant;
}
/*}}}*/
/* External entry points */
+int
+Perl_vms_case_tolerant(void)
+{
#if __CRTL_VER >= 70301000 && !defined(__VAX)
-int Perl_vms_case_tolerant(void)
-{ return do_vms_case_tolerant(); }
+ return do_vms_case_tolerant();
#else
-int Perl_vms_case_tolerant(void)
-{ return vms_process_case_tolerant; }
+ return vms_process_case_tolerant;
#endif
-
+}
/* Start of DECC RTL Feature handling */