Article 160267 of comp.os.vms: In article <57nirp$14qh@rs18.hrz.th-darmstadt.de>, Martin P.J. Zinser wrote: > > Most probably I'm missing something obvious. I want to define > a search path logical from a C program. I've read TFM, but > this did not enlighten me to much ;-(. My guess is that I setup > the item_list_3 structure wrong. Any help would be very much > appreciated. Below is the program I've came up with until now. > > Greetings, Martin [program example omitted] Try this one: 4#include #include #include #include /* Added */ #include /* Added */ #include unsigned long mode; /* Sorts of logicals: mode=0 plain mode=LNM$M_CONCEALED concealed */ unsigned long accmode = PSL$C_EXEC; unsigned long define_rlogical_name(char *varname, char *string1, char *string2) { struct dsc$descriptor_s renvdsc = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, NULL}; struct dsc$descriptor_s rlnmdsc = {17, DSC$K_DTYPE_T, DSC$K_CLASS_S, "LNM$PROCESS_TABLE"}; struct { short length, code; void *buff; void *retlenaddr; } itmlist[5]; /* Changed from *itmlist */ itmlist[0].length = strlen(string1); itmlist[0].buff = (void *) string1; itmlist[0].code = LNM$_STRING; /* Changed from 0 */ itmlist[1].length = 4; itmlist[1].buff = &mode; itmlist[1].code = LNM$_ATTRIBUTES; itmlist[2].length = strlen(string2); /************/ itmlist[2].buff = (void *) string2; /* Inserted */ itmlist[2].code = LNM$_STRING; /************/ itmlist[3].length = 4; itmlist[3].buff = &mode; itmlist[3].code = LNM$_ATTRIBUTES; itmlist[4].length = 0; itmlist[4].buff = (char *)NULL; itmlist[4].code = 0; renvdsc.dsc$w_length = strlen(varname); renvdsc.dsc$a_pointer = varname; return lib$set_logical (&renvdsc, 0, &rlnmdsc, &accmode, &itmlist); } int main() { mode = LNM$M_CONCEALED | LNM$M_TERMINAL; /* "Attributes", actually */ return define_rlogical_name ("TEST", "foo", "bar"); } Chris Chiesa lvt-cfc@servtech.com