Example #1
0
VOID
s_cmd_skip()
{
	i4	type;
	i4     rtn_char;               /* dummy variable for sgskip */

	type = s_g_skip(FALSE, &rtn_char);
	while (!((type == TK_PERIOD && CMalpha(Tokchar+CMbytecnt(Tokchar))) ||
		 type == TK_ENDFILE))
	{
		type = s_g_skip(TRUE, &rtn_char);
	}
}
Example #2
0
VOID
s_break()
{
	/* internal declarations */

	i4		tok_type;		/* next token type */
	i4		rtn_char;		/*
						** dummy variable for s_g_skip()
						** and real variable for
						** s_g_ident().
						*/
	char		*name;			/* break name */
	bool		err;
	char		nrml_buf[(FE_MAXNAME + 1)];

	/* start of routine */

	if (St_b_given)
	{
		s_error(0x3A6, NONFATAL, NULL);
		s_cmd_skip();
		return;
	}
	St_b_given = TRUE;

	save_em();		/* store aside the values of Command fields */

	/* Initialize the fields in Command */

	STcopy(NAM_BREAK, Ctype);
	STcopy(ERx(" "), Csection);
	STcopy(ERx(" "), Ccommand);
	if (Cact_ren == NULL)
	{
		s_error(0x38A, FATAL, NULL);
	}

	Csequence = Cact_ren->ren_bcount;

	err = FALSE;
	while (!err)
	{
		tok_type = s_g_skip(TRUE, &rtn_char);

		switch (tok_type)
		{
			case TK_ENDFILE:
			case TK_PERIOD:
				goto allexit;

			case TK_COMMA:
				break;

			case TK_ALPHA:
			case TK_QUOTE:
			case TK_DOLLAR:
				if (tok_type == TK_ALPHA)
				{
					name = s_g_ident(FALSE,&rtn_char,
							 FALSE);
					if  (rtn_char != UI_REG_ID)
					{
						s_error(0x39D,NONFATAL,
							name,NULL);
						s_cmd_skip();
						err = TRUE;
						break;
					}
					IIUGdbo_dlmBEobject(name,FALSE);
				}
				else if (tok_type == TK_QUOTE)	/* Delim ID */
				{
					if  (!St_xns_given)
					{
						s_error(0x39D,NONFATAL,
							name,NULL);
						s_cmd_skip();
						err = TRUE;
						break;
					}
					name = s_g_ident(FALSE,&rtn_char,
							 FALSE);
					if  (rtn_char != UI_DELIM_ID)
					{
						s_error(0x39D,NONFATAL,
							name,NULL);
						s_cmd_skip();
						err = TRUE;
						break;
					}
					_VOID_ IIUGdlm_ChkdlmBEobject(name,
								&nrml_buf[0],
								FALSE);
					name = &nrml_buf[0];
				}
				else
				{
					name = s_g_name(FALSE);
					IIUGdbo_dlmBEobject(name,FALSE);
				}
				if (s_sbr_find(name) != NULL)
				{	/* already specified */
					s_error(0x39E, NONFATAL, name, NULL);
					s_cmd_skip();
					err = TRUE;
					break;
				}

				/* name not specified.	Add it */

				s_sbr_add(name);
				STcopy(name,Cattid);
				_VOID_ s_w_row();
				break;

			default:
				s_error(0x39D, NONFATAL, NULL);
				s_cmd_skip();
				err = TRUE;
				break;

		}
	}

    allexit:
	get_em();
}
Example #3
0
STATUS
s_lrem_set()
{
    char	*b;
    char	*bend;
    i4		pos;
    i4		n;
    i4		length;
    # ifdef UNIX
    char	word[OOLONGREMSIZE+1]; 
    # else
    char        word[MAXCMD+1];
    # endif
    i4		code;
    i4		count;
    char	*save_Tokchar;
    char	long_remark[OOLONGREMSIZE+1];
    i4          rtn_char;               /* dummy variable for sgskip */

    if (St_lr_given)
    {
	s_error(0x3A9, NONFATAL, NULL);
	s_cmd_skip();
	return FAIL;
    }
    if (Cact_ren == NULL)
    {
	    s_error(0x38A, FATAL, NULL);
    }
    St_lr_given = TRUE;

    /* skip leading white space */

    s_g_skip(TRUE, &rtn_char);

    /* handle rest of remark up to the .ENDREMARK */

    code = S_ERROR;
    b = long_remark;
    bend = b + OOLONGREMSIZE;

    for (;;)
    {
	while (*Tokchar != '\n' && *Tokchar != EOS)
	{
	    if (*Tokchar == '.' && CMalpha(Tokchar+1))
	    {
		/* check for .ENDREMARK */

		save_Tokchar = Tokchar;
		Tokchar++;
		r_gt_word(word);
		CVlower(word);
		code = s_get_scode(word);
		if (code == S_ENDREMARK)
		{
		    break;
		}
		else
		{
		    Tokchar = save_Tokchar;
		}
	    }

	    if (b <= bend-CMbytecnt(Tokchar))
	    {
		if (*Tokchar == '\t')
		{
			/* if tab, replace it with the one blank */
			*b = ' ';
			b++;
			Tokchar++;
		}
		else
		{
		    CMcpyinc(Tokchar, b);
		}
	    }
	    else
	    {
		CMnext(Tokchar);
	    }
	}

	if (code == S_ENDREMARK)
	{
	    *b = EOS;
	    Cact_ren->ren_longrem = STalloc(long_remark);
	    break;
	}
	else
	{
	    if (b < bend)
	    {
	        *b++ = ' ';
	    }
	    count = s_next_line();
	    if (count == 0)
	    {
		/* ERROR: EOF in middle of remark */
		s_error(0x3A3, FATAL, NULL);
		break;
	    }
	}
    }

    return OK;
}
Example #4
0
VOID
s_out_set()
{
	/* internal declarations */

	char		*name = NULL;		/* hold name of table */
	i4             rtn_char;               /* dummy variable for sgskip */

	/* start of routine */


	if (Cact_ren == NULL)
	{
		s_error(906, FATAL, NULL);
	}

	if (St_o_given)
	{	/* already specified */
		s_error(922, NONFATAL, Cact_ren->ren_report, NULL);
	}

	save_em();		/* temp store of fields */

	/* Set up fields in Command */

	STcopy(NAM_OUTPUT,Ctype);
	Csequence = 0;
	STcopy(ERx(" "), Csection);
	STcopy(ERx(" "), Cattid);
	STcopy(ERx(" "), Ccommand);

	switch(s_g_skip(TRUE, &rtn_char))
	{
		case(TK_ALPHA):
		case(TK_NUMBER):
		case(TK_DOLLAR):
			/* should be ok */
			name = s_g_token(FALSE);
			break;

		case(TK_QUOTE):
			/* Keep the quotes #33314 */
			name = s_g_string(FALSE, (i4) TK_QUOTE );
			break;

		case(TK_SQUOTE):
			/* Keep the quotes #33314 */
			name = s_g_string(FALSE, (i4) TK_SQUOTE );
			break;
		default:
			s_error(912, NONFATAL, NULL);
			break;

	}

	if (name != NULL)
	{
		STcopy(name,Ctext);
		_VOID_ s_w_row();

	}

	get_em();

	St_o_given = TRUE;

	return;
}