From: hoffman@xdelta.zko.dec.nospam Sent: Wednesday, August 29, 2001 3:09 PM To: Info-VAX@Mvb.Saic.Com Subject: Re: C language functionality changed? In article <3B8CD6D0.339F7710@unnecessary.csc.com>, Adrian Birkett writes: .. :I have a query about the C programming language. Please consider the :following code and also please bear in mind that I am new to C, so if :I've missed something glaringly obvious, feel free to point it out in :your usual high spirited manner :-); .. You don't need to tell us you are new to this stuff, we can generally figure that out by ourselves. (No offense is intended.) Please try the attached C code. I've made a few changes :-) to what you posted. No claims to style, etc. You *will* want to review the FAQ text on dynamic descriptors, etc. ---------------------------- #include ----------------------------- For additional, please see the OpenVMS FAQ -- www.openvms.compaq.com --------------------------- pure personal opinion --------------------------- Hoff (Stephen) Hoffman OpenVMS Engineering hoffman#xdelta.zko.dec.com -- #include #include #include #include #include #include #include #include struct ItemList3 { short int ItemLength; short int ItemCode; void *ItemBuffer; void *ItemRetLen; }; #define MAXQNAM 32 #define MAXIL 5 main() { int QuiCtx = -1; int RetStat, RetLen, i; int Efn = 0; unsigned long int QuiIosb[2]; struct ItemList3 Il3[MAXIL+1]; struct dsc$descriptor QueueD = { 0, DSC$K_DTYPE_T, DSC$K_CLASS_D, NULL }; $DESCRIPTOR( PromptD, "Enter Queue Name: "); RetStat = lib$get_input( &QueueD, &PromptD, &RetLen ); if (!$VMS_STATUS_SUCCESS( RetStat )) lib$signal( RetStat ); RetStat = lib$get_ef( &Efn ); if (!$VMS_STATUS_SUCCESS( RetStat )) lib$signal( RetStat ); i = 0; Il3[i].ItemLength = QueueD.dsc$w_length; Il3[i].ItemCode = QUI$_SEARCH_NAME; Il3[i].ItemBuffer = QueueD.dsc$a_pointer; Il3[i++].ItemRetLen = NULL; Il3[i].ItemLength = 0; Il3[i].ItemCode = 0; Il3[i].ItemBuffer = NULL; Il3[i++].ItemRetLen = NULL; RetStat = sys$getquiw(Efn,QUI$_DISPLAY_QUEUE,&QuiCtx,Il3,QuiIosb,0,0); if (!$VMS_STATUS_SUCCESS( RetStat )) lib$signal( RetStat ); switch ( QuiIosb[0] ) { default: printf("Error 0x0%08.8x on $getquiw\n", QuiIosb[0] ); break; case JBC$_NOSUCHQUE: printf("\nQueue \'%*.*s\' does not exist", QueueD.dsc$w_length, QueueD.dsc$w_length, QueueD.dsc$a_pointer ); break; case SS$_NORMAL: case JBC$_NORMAL: printf("\nQueue \'%*.*s\' exists", QueueD.dsc$w_length, QueueD.dsc$w_length, QueueD.dsc$a_pointer ); break; } return SS$_NORMAL; }