Beispiel #1
0
/*
**  bld_cmtName ()
*/
STATUS
bld_cmtName ( char *errmsg )
{
    STATUS                 ret_val = OK ;

    if (!commentNameBuilt)
    {
        if ((ret_val = Create_stf_file(SEP_ME_TAG_NODEL, ERx("ct"),
                                       &cmtFile, &cmtLoc, errmsg)) != OK)
        {
            disp_line(msg,0,0);
        }
        else
        {
            cmtName = STtalloc(SEP_ME_TAG_NODEL, cmtFile);
            commentNameBuilt = TRUE;
        }
    }

    return (ret_val);
}
Beispiel #2
0
STATUS
Trans_SEPfile(char **Token,LOCTYPE *typeOfLoc,bool Dont_free,i2 ME_tag)
{
    STATUS                 syserr ;
    char                  *newstr = NULL ;
    char                  *temp_ptr = NULL ;
    char                  *tmp_buffer1 = NULL ;
    char                  *tmp_buffer2 = NULL ;
    char                  *tmp_ptr1 = NULL ;
    char                  *tmp_ptr2 = NULL ;
    char                  *tmp_ptr3 = NULL ;
    char                  *token_ptr = NULL ;
    char                  *tmp_token = NULL ;

    if (ME_tag == SEP_ME_TAG_NODEL && Dont_free != TRUE)
	Dont_free = TRUE;

    if (tracing&TRACE_PARM)
    {
	SIfprintf(traceptr,ERx("Trans_SEPfile> *Token = %s\n"),*Token);
	if (Dont_free)
	    SIfprintf(traceptr,ERx("                Dont_free = TRUE\n"));
	else
	    SIfprintf(traceptr,ERx("                Dont_free = FALSE\n"));
    }

    tmp_token = *Token;
    if ((token_ptr = FIND_SEPstring(tmp_token,ERx("@FILE("))) == NULL)
    {
	if (tracing&TRACE_PARM)
	    SIfprintf(traceptr,ERx("Trans_SEPfile> FIND_SEPstring is FALSE\n"));

	return (FALSE);
    }
    if (tracing&TRACE_PARM)
        SIfprintf(traceptr,ERx("Trans_SEPfile> FIND_SEPstring is TRUE\n"));

    tmp_buffer1 = SEP_MEalloc(SEP_ME_TAG_MISC, 128, TRUE, (STATUS *) NULL);
    tmp_buffer2 = SEP_MEalloc(SEP_ME_TAG_MISC, 128, TRUE, (STATUS *) NULL);

    if (token_ptr != tmp_token)
    {
	for (tmp_ptr1 = tmp_buffer1, tmp_ptr2 = tmp_token;
	     tmp_ptr2 != token_ptr; )
	    CMcpyinc(tmp_ptr2,tmp_ptr1);
    }
    else
    {
	tmp_ptr2 = token_ptr;
    }

    for (tmp_ptr3 = tmp_buffer2; CMcmpcase(tmp_ptr2,ERx(")")); )
	CMcpyinc(tmp_ptr2,tmp_ptr3);

    CMcpychar(tmp_ptr2,tmp_ptr3);
    CMnext(tmp_ptr2);
    newstr = SEP_MEalloc(SEP_ME_TAG_MISC, 128, TRUE, (STATUS *) NULL);

    if ((syserr = getLocation(tmp_buffer2,newstr,typeOfLoc)) == OK)
    {
	if (tracing&TRACE_PARM)
	{
	    SIfprintf(traceptr,ERx("Trans_SEPfile> newstr = %s\n"),newstr);
	    SIfprintf(traceptr,ERx("Trans_SEPfile> tmp_buffer1 = %s\n"),
                      tmp_buffer1);
            SIfprintf(traceptr,ERx("Trans_SEPfile> tmp_buffer2 = %s\n"),
                      tmp_buffer2);
	}
	STcat(tmp_buffer1, newstr);
	STcat(tmp_buffer1, tmp_ptr2);

        if (tracing&TRACE_PARM)
            SIfprintf(traceptr,ERx("Trans_SEPfile> tmp_buffer1 = %s\n"),
                      tmp_buffer1);

	temp_ptr = *Token;
	*Token = STtalloc(ME_tag,tmp_buffer1);
        if (Dont_free != TRUE)
	    MEfree(temp_ptr);
    }
    MEfree(tmp_buffer1);
    MEfree(tmp_buffer2);
    MEfree(newstr);

    if (tracing&TRACE_PARM)
        SIfprintf(traceptr,ERx("Trans_SEPfile> *Token = %s\n"),*Token);
 
    return (syserr);
}