55 #if defined( HAVE_FEATURES_H )
56 # include <features.h>
59 #if defined( HAVE_NL_TYPES_H )
60 # include <nl_types.h>
70 #define RXQUEUE_CLEAR -2
71 #define BAD_MESSAGE -6
73 #define MSG_BUF_SIZE 256
74 #define LINEBUFSIZE 65472
76 #define REXXMESSAGEFILE "rexx.cat"
88 size_t get_line(
char *,
size_t,
size_t *);
98 const char *quename=NULL;
117 for (i=1; i<argc; i++)
120 if ((t[0]==
'/') || (t[0]==
'-'))
123 if ( !strcasecmp(t,
"/FIFO") &&
128 else if ( !strcasecmp(t,
"/LIFO") &&
133 else if ( !strcasecmp(t,
"/CLEAR") &&
169 if (!(quename = getenv(
"RXQUEUE")) || !quename)
241 const char *quename )
246 #if defined( HAVE_NL_TYPES_H )
250 const char *pszMessage;
251 char *pInsert = NULL;
258 ( void ) memset( DataArea,
260 sizeof( DataArea ) ) ;
304 #if defined( HAVE_CATOPEN )
308 snprintf(DataArea,
sizeof DataArea,
"%s/%s", ORX_CATDIR,
REXXMESSAGEFILE);
309 if ((catd = catopen(DataArea, 0)) == (nl_catd)
CATD_ERR)
311 printf(
"\nCannot open REXX message catalog %s. Not in NLSPATH or %s.\n",
316 pszMessage = catgets(catd, set_num, MsgNumber, NULL);
320 snprintf(DataArea,
sizeof DataArea,
"%s/%s", ORX_CATDIR,
REXXMESSAGEFILE);
321 if ((catd = catopen(DataArea, 0)) == (nl_catd)
CATD_ERR)
323 snprintf(DataArea,
sizeof DataArea,
"\nCannot open REXX message catalog %s. Not in NLSPATH or %s.\n",
328 pszMessage = catgets(catd, set_num, MsgNumber, NULL);
331 strcpy(DataArea,
"Error message not found!");
335 strcpy(DataArea, pszMessage);
346 snprintf(DataArea,
sizeof DataArea,
"*** Cannot get description for error!");
349 pInsert = strstr(DataArea,
"%1");
354 snprintf(achIMessage,
sizeof achIMessage, DataArea,quename);
355 pszMessage = achIMessage;
359 pszMessage = &DataArea[0];
362 printf(
"\nREX%d: %s\n", MsgNumber, pszMessage);
389 static char savechar =
'\0';
390 static bool eof =
false;
403 *buffer++ = savechar;
408 actual = fread(&newchar, 1, 1, stdin);
409 while (!ferror(stdin))
428 actual = fread(&newchar, 1, 1, stdin);
430 if (!ferror(stdin) && actual && newchar !=
'\n')
436 else if (newchar ==
'\n')
441 else if (newchar == 0x1a)
456 if (length < bufsize)
463 actual = fread(&newchar, 1, 1, stdin);
#define Error_RXQUE_syntax_msg
#define Error_RXQUE_notinit_msg
#define Error_RXQUE_name_msg
#define Error_RXQUE_exist_msg
#define Error_RXQUE_nomem_msg
#define Error_RXQUE_size_msg
#define Error_RXQUE_access_msg
RexxReturnCode REXXENTRY RexxClearQueue(CONSTANT_STRING)
RexxReturnCode REXXENTRY RexxAddQueue(CONSTANT_STRING, PCONSTRXSTRING, size_t)
#define MAKERXSTRING(r, p, l)
RexxReturnCode REXXENTRY RexxQueryQueue(CONSTANT_STRING, size_t *)
int main(int argc, char *argv[])
size_t get_line(char *, size_t, size_t *)
void options_error(int type, const char *queuename)