45#include "MagickCore/studio.h"
46#include "MagickCore/string_.h"
47#include "MagickCore/memory_.h"
48#include "MagickCore/vms.h"
50#if !defined(_AXP_) && (!defined(__VMS_VER) || (__VMS_VER < 70000000))
73void closedir(
DIR *directory)
75 if (IsEventLogging() != MagickFalse)
76 (void) LogMagickEvent(TraceEvent,GetMagickModule(),
"...");
77 assert(directory != (
DIR *) NULL);
78 directory->pattern=DestroyString(directory->pattern);
79 directory=DestroyString(directory);
106DIR *opendir(
char *name)
114 directory=(
DIR *) AcquireMagickMemory(
sizeof(
DIR));
115 if (directory == (
DIR *) NULL)
118 return((
DIR *) NULL);
120 if (strcmp(
".",name) == 0)
122 directory->pattern=(
char *) AcquireQuantumMemory(strlen(name)+
sizeof(
"*.*")+
123 1UL,
sizeof(*directory->pattern));
124 if (directory->pattern == (
char *) NULL)
126 directory=DestroyString(directory);
133 (void) FormatLocaleString(directory->pattern,MagickPathExtent,
"%s*.*",name);
134 directory->context=0;
135 directory->pat.dsc$a_pointer=directory->pattern;
136 directory->pat.dsc$w_length=strlen(directory->pattern);
137 directory->pat.dsc$b_dtype=DSC$K_DTYPE_T;
138 directory->pat.dsc$b_class=DSC$K_CLASS_S;
169 buffer[
sizeof(directory->entry.d_name)];
180 struct dsc$descriptor_s
186 result.dsc$a_pointer=buffer;
187 result.dsc$w_length=
sizeof(buffer)-2;
188 result.dsc$b_dtype=DSC$K_DTYPE_T;
189 result.dsc$b_class=DSC$K_CLASS_S;
190 status=lib$find_file(&directory->pat,&result,&directory->context);
191 if ((status == RMS$_NMF) || (directory->context == 0L))
192 return((
struct dirent *) NULL);
196 buffer[
sizeof(buffer)-1]=
'\0';
197 for (p=buffer; *p; p++)
198 if (isupper((
int) ((
unsigned char) *p)))
199 *p=LocaleToLowercase(*p);
204 while (isspace((
int) ((
unsigned char) *p)) == 0)
207 p=strchr(buffer,
']');
209 (void) CopyMagickString(directory->entry.d_name,p+1,MagickPathExtent);
211 (
void) CopyMagickString(directory->entry.d_name,buffer,MagickPathExtent);
212 directory->entry.d_namlen=strlen(directory->entry.d_name);
213 return(&directory->entry);
243MagickExport MagickBooleanType VMSIsMagickConflict(
const char *magick)
252 struct dsc$descriptor_s
255 assert(magick != (
char *) NULL);
256 device.dsc$w_length=strlen(magick);
257 device.dsc$a_pointer=(
char *) magick;
258 device.dsc$b_class=DSC$K_CLASS_S;
259 device.dsc$b_dtype=DSC$K_DTYPE_T;
260 item_list[0].ile3$w_length=
sizeof(device_class);
261 item_list[0].ile3$w_code=DVI$_DEVCLASS;
262 item_list[0].ile3$ps_bufaddr=&device_class;
263 item_list[0].ile3$ps_retlen_addr=NULL;
264 (void) memset(&item_list[1],0,
sizeof(item_list[1]));
265 status=sys$getdviw(0,0,&device,&item_list,0,0,0,0);
266 if ((status == SS$_NONLOCAL) ||
267 ((status & 0x01) && (device_class & (DC$_DISK | DC$_TAPE))))