summaryrefslogtreecommitdiff
path: root/mysys/my_lib.c
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2010-07-15 08:26:38 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2010-07-15 08:26:38 -0300
commit6420d6dc4a819cf5304b69d9270da0fcdbfb60ba (patch)
tree7448b8d48b397207357910233d7213495e18b77d /mysys/my_lib.c
parentbdab1de458317c2dc7074eb54cec908ca320272e (diff)
downloadmariadb-git-6420d6dc4a819cf5304b69d9270da0fcdbfb60ba.tar.gz
WL#5486: Remove code for unsupported platforms
Remove VMS specific code.
Diffstat (limited to 'mysys/my_lib.c')
-rw-r--r--mysys/my_lib.c133
1 files changed, 2 insertions, 131 deletions
diff --git a/mysys/my_lib.c b/mysys/my_lib.c
index 820f37360de..890ff0b5dd1 100644
--- a/mysys/my_lib.c
+++ b/mysys/my_lib.c
@@ -40,11 +40,6 @@
# endif
# endif
#endif
-#ifdef VMS
-#include <rms.h>
-#include <iodef.h>
-#include <descrip.h>
-#endif
#if defined(THREAD) && defined(HAVE_READDIR_R)
#define READDIR(A,B,C) ((errno=readdir_r(A,B,&C)) != 0 || !C)
@@ -198,9 +193,6 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
/*
* Convert from directory name to filename.
- * On VMS:
- * xyzzy:[mukesh.emacs] => xyzzy:[mukesh]emacs.dir.1
- * xyzzy:[mukesh] => xyzzy:[000000]mukesh.dir.1
* On UNIX, it's simple: just make sure there is a terminating /
* Returns pointer to dst;
@@ -208,11 +200,8 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
char * directory_file_name (char * dst, const char *src)
{
-#ifndef VMS
-
/* Process as Unix format: just remove test the final slash. */
-
- char * end;
+ char *end;
if (src[0] == 0)
src= (char*) "."; /* Use empty as current */
@@ -223,125 +212,7 @@ char * directory_file_name (char * dst, const char *src)
end[1]='\0';
}
return dst;
-
-#else /* VMS */
-
- long slen;
- long rlen;
- char * ptr, rptr;
- char bracket;
- struct FAB fab = cc$rms_fab;
- struct NAM nam = cc$rms_nam;
- char esa[NAM$C_MAXRSS];
-
- if (! src[0])
- src="[.]"; /* Empty is == current dir */
-
- slen = strlen (src) - 1;
- if (src[slen] == FN_C_AFTER_DIR || src[slen] == FN_C_AFTER_DIR_2 ||
- src[slen] == FN_DEVCHAR)
- {
- /* VMS style - convert [x.y.z] to [x.y]z, [x] to [000000]x */
- fab.fab$l_fna = src;
- fab.fab$b_fns = slen + 1;
- fab.fab$l_nam = &nam;
- fab.fab$l_fop = FAB$M_NAM;
-
- nam.nam$l_esa = esa;
- nam.nam$b_ess = sizeof esa;
- nam.nam$b_nop |= NAM$M_SYNCHK;
-
- /* We call SYS$PARSE to handle such things as [--] for us. */
- if (SYS$PARSE(&fab, 0, 0) == RMS$_NORMAL)
- {
- slen = nam.nam$b_esl - 1;
- if (esa[slen] == ';' && esa[slen - 1] == '.')
- slen -= 2;
- esa[slen + 1] = '\0';
- src = esa;
- }
- if (src[slen] != FN_C_AFTER_DIR && src[slen] != FN_C_AFTER_DIR_2)
- {
- /* what about when we have logical_name:???? */
- if (src[slen] == FN_DEVCHAR)
- { /* Xlate logical name and see what we get */
- (void) strmov(dst,src);
- dst[slen] = 0; /* remove colon */
- if (!(src = getenv (dst)))
- return dst; /* Can't translate */
-
- /* should we jump to the beginning of this procedure?
- Good points: allows us to use logical names that xlate
- to Unix names,
- Bad points: can be a problem if we just translated to a device
- name...
- For now, I'll punt and always expect VMS names, and hope for
- the best! */
-
- slen = strlen (src) - 1;
- if (src[slen] != FN_C_AFTER_DIR && src[slen] != FN_C_AFTER_DIR_2)
- { /* no recursion here! */
- (void) strmov(dst, src);
- return(dst);
- }
- }
- else
- { /* not a directory spec */
- (void) strmov(dst, src);
- return(dst);
- }
- }
-
- bracket = src[slen]; /* End char */
- if (!(ptr = strchr (src, bracket - 2)))
- { /* no opening bracket */
- (void) strmov (dst, src);
- return dst;
- }
- if (!(rptr = strrchr (src, '.')))
- rptr = ptr;
- slen = rptr - src;
- (void) strmake (dst, src, slen);
-
- if (*rptr == '.')
- { /* Put bracket and add */
- dst[slen++] = bracket; /* (rptr+1) after this */
- }
- else
- {
- /* If we have the top-level of a rooted directory (i.e. xx:[000000]),
- then translate the device and recurse. */
-
- if (dst[slen - 1] == ':'
- && dst[slen - 2] != ':' /* skip decnet nodes */
- && strcmp(src + slen, "[000000]") == 0)
- {
- dst[slen - 1] = '\0';
- if ((ptr = getenv (dst))
- && (rlen = strlen (ptr) - 1) > 0
- && (ptr[rlen] == FN_C_AFTER_DIR || ptr[rlen] == FN_C_AFTER_DIR_2)
- && ptr[rlen - 1] == '.')
- {
- (void) strmov(esa,ptr);
- esa[rlen - 1] = FN_C_AFTER_DIR;
- esa[rlen] = '\0';
- return (directory_file_name (dst, esa));
- }
- else
- dst[slen - 1] = ':';
- }
- (void) strmov(dst+slen,"[000000]");
- slen += 8;
- }
- (void) strmov(strmov(dst+slen,rptr+1)-1,".DIR.1");
- return dst;
- }
- (void) strmov(dst, src);
- if (dst[slen] == '/' && slen > 1)
- dst[slen] = 0;
- return dst;
-#endif /* VMS */
-} /* directory_file_name */
+}
#else