Exemple #1
0
int seqspec_IDset (Seqspec this1, char *seqID) {
  /**
     Set ID of 'this1' sequence segment
     @param[in] this1 - the Seqspec object
     @param[in] seqID - name of UNIX file containing a sequence (filename must
                        not contain ':') or sequence identifier in the form
                        db:seq
     @param[out] this1 - dbseqname always set; dbname and seqname only set if
                         database sequence; if 0 returned then dbseqname,
                         dbname, seqname are undefined
     @param[out] seqID - destroyed
     @return 1 if parsed ok, 0 else if seqspec_filesOk(1) is in effect,
             file names are considered ok, else only seqIDs of the form
             db:seq are ok
  */
  char *seqname;
  strReplace (&this1->dbseqname,seqID);
  if (strchr (seqID,':')) {
    toupperStr (seqID); // DBNAME:SEQNAME
    if ((seqname = dbseqDissect (seqID)) == NULL)
      return 0;
    strReplace (&this1->dbname,seqID);
    strReplace (&this1->seqname,seqname);
  }
  else { // assume file name
    if (gFilesOk) {
      hlr_free (this1->dbname);
      hlr_free (this1->seqname);
    }
    else
      return 0;
  }
  return 1;
}
//********************************************************************************
char	GetHersheyFontNumerFromName(char *fontName)
{
char	lookUpFontName[32];
char	currentFontName[32];
byte	ii, fontIndex;

	fontIndex	=	0;
	strcpy(lookUpFontName, fontName);
	toupperStr(lookUpFontName);
	
	for (ii=kHershey_FirstFontNumber; ii<kHersheyFont_last; ii++)
	{
		//*	ii is font index
		//*	0 is char index, 0 means the FONT NAME
		GetHersheyFontStringFromIndex(ii, 0, currentFontName);
		toupperStr(currentFontName);
		if (strcmp(lookUpFontName, currentFontName) == 0)
		{
			fontIndex	=	ii;
			break;
		}
	}
	return(fontIndex);
}
Exemple #3
0
int main ()
{
    char line[MAX],space;
    short i;
    while (fgets(line,MAX,stdin)!=NULL)
    {
        if (!strncmp(toupperStr(line),"DESCRIPTION",strlen("DESCRIPTION")))
            break;
    }

    while (fgets(line,MAX,stdin)!=NULL)
    {
        if (line[0]=='\n')
            continue;

        if(line[0]==' ' || line[0]=='\t')
        {
            i=0;
            while((line[i]==' ' || line[i]=='\t') && line[i]!='\0')
                i++;

            space=FALSE;
            for( ; i<strlen(line); i++)
            {
                if((line[i]=='\t' || line[i]==' ') && space==FALSE)
                {
                    putchar(' ');
                    space=TRUE;
                }
                else
                {
                    space=FALSE;
                    putchar(line[i]);
                }
            }
        }
        else
            break;
    }
    return EXIT_SUCCESS;
}