diff options
author | akiyoshi <akiyoshi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-17 05:03:33 +0000 |
---|---|---|
committer | akiyoshi <akiyoshi@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-17 05:03:33 +0000 |
commit | 906ca0fd2a4b6050d2b8a9a14131f5380362fa18 (patch) | |
tree | 501206304a77d34f39385118a0bd29a2491dd9a4 /vms | |
parent | 6b296bd4078bb2eadf0a5c33324de021a2956325 (diff) | |
download | ruby-906ca0fd2a4b6050d2b8a9a14131f5380362fa18.tar.gz ruby-906ca0fd2a4b6050d2b8a9a14131f5380362fa18.tar.xz ruby-906ca0fd2a4b6050d2b8a9a14131f5380362fa18.zip |
Add private initialization routine for VMS.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vms')
-rw-r--r-- | vms/vmsruby_private.c | 52 | ||||
-rw-r--r-- | vms/vmsruby_private.h | 7 |
2 files changed, 59 insertions, 0 deletions
diff --git a/vms/vmsruby_private.c b/vms/vmsruby_private.c new file mode 100644 index 000000000..c1cbfcebe --- /dev/null +++ b/vms/vmsruby_private.c @@ -0,0 +1,52 @@ +#include "vmsruby_private.h" +#include <stdio.h> +#include <stdlib.h> + +void _vmsruby_init(void) +{ + _vmsruby_set_switch("DECC$WLS", "TRUE"); +} + + +#include <starlet.h> +#include <string.h> +#include <descrip.h> +#include <lnmdef.h> + +struct item_list_3 { + short buflen; + short itmcod; + void *bufadr; + void *retlen; +}; + +long _vmsruby_set_switch(char *name, char *value) +{ + long status; + struct item_list_3 itemlist[20]; + int i; + + i = 0; + itemlist[i].itmcod = LNM$_STRING; + itemlist[i].buflen = strlen(value); + itemlist[i].bufadr = value; + itemlist[i].retlen = NULL; + i++; + itemlist[i].itmcod = 0; + itemlist[i].buflen = 0; + + $DESCRIPTOR(TABLE_d, "LNM$PROCESS"); + $DESCRIPTOR(lognam_d, ""); + + lognam_d.dsc$a_pointer = name; + lognam_d.dsc$w_length = strlen(name); + + status = sys$crelnm ( + 0, + &TABLE_d, + &lognam_d, + 0, /* usermode */ + itemlist); + + return status; +} diff --git a/vms/vmsruby_private.h b/vms/vmsruby_private.h new file mode 100644 index 000000000..24703dc7f --- /dev/null +++ b/vms/vmsruby_private.h @@ -0,0 +1,7 @@ +#ifndef VMSRUBY_H_INCLUDED +#define VMSRUBY_H_INCLUDED + +void _vmsruby_init(void); +long _vmsruby_set_switch(char *, char *); + +#endif /* VMSRUBY_H_INCLUDED */ |