Exemple #1
0
/*****************************************************************************
*
*   PubdescContentMatch(pub1, pub2)
*
*   returns TRUE if content of pub1 matches content of pub2, FALSE otherwise
*****************************************************************************/
NLM_EXTERN Boolean LIBCALL PubdescContentMatch (PubdescPtr pdp1, PubdescPtr pdp2)
{
    if (pdp1 == NULL && pdp2 == NULL)
    {
        return TRUE;
    }
    else if (pdp1 == NULL || pdp2 == NULL)
    {
        return FALSE;
    }
    else if (pdp1->reftype != pdp2->reftype)
    {
        return FALSE;
    }
    else if (StringCmp (pdp1->name, pdp2->name) != 0
             || StringCmp (pdp1->fig, pdp2->fig) != 0
             || StringCmp (pdp1->maploc, pdp2->maploc) != 0
             || StringCmp (pdp1->seq_raw, pdp2->seq_raw) != 0
             || StringCmp (pdp1->comment, pdp2->comment) != 0)
    {
        return FALSE;
    }
    else if (PubMatch (pdp1->pub, pdp2->pub) != 0)
    {
        return FALSE;
    }
    else
    {
        return TRUE;
    }
}
Exemple #2
0
/*---------------------------------------------------------*/
Int4 iCountItemGet(PMSD pmsdThis, PMMD pmmdThis, PMGD pmgdThis,
                   Int4 iCountStruc)
{
    Int4 iCount = 0, iCountLive = 0;
    Int2 iDomain = 0;

    if (pmgdThis == NULL)
        iDomain = 0;
    else
        iDomain = pmgdThis->iDomain;

    for (iCount = 0; iCount < iDomainCount; iCount++) {
        if (!domaindata[iCount]->bVisibleParent)
            continue;
        if (StringCmp(pmsdThis->pcPDBName, domaindata[iCount]->pcPDBName)
            == 0
            && StringCmp(pmmdThis->pcMolName,
                         domaindata[iCount]->pcMolName) == 0
            && iDomain == domaindata[iCount]->iDomain
            && iCountStruc == domaindata[iCount]->iStrucIndex)
            return (iCountLive + 1);
        iCountLive++;

    }

    return 0;
}
Exemple #3
0
static void FindBlastNR (SeqAnnotPtr sap, Pointer userdata)

{
  AnnotDescrPtr  adp;
  ObjectIdPtr    oip;
  UserFieldPtr   ufp;
  UserObjectPtr  uop;

  if (sap == NULL || sap->type != 2) return;
  for (adp = sap->desc; adp != NULL; adp = adp->next) {
    if (adp->choice != Annot_descr_user) continue;
    for (uop = adp->data.ptrvalue; uop != NULL; uop = uop->next) {
      oip = uop->type;
      if (oip == NULL) continue;
      if (StringCmp (oip->str, "Blast Type") != 0) continue;
      ufp = uop->data;
      if (ufp == NULL) continue;
      oip = ufp->label;
      if (oip == NULL) continue;
      if (StringCmp (oip->str, "BLASTN - nr") != 0) continue;
      ProcessBlastNR (sap);
      oip->str = MemFree (oip->str);
      oip->str = StringSave ("BLASTN - nr minus mrna");
    }
  }
}
Exemple #4
0
static int ArticleCmp(const void *vp1, const void *vp2){ 
  
  const article *a1 = vp1; 
  const article *a2 = vp2; 

  if(StringCmp(&a1->title,&a2->title) == 0 && StringCmp(&a1->server,&a2->server) == 0) return 0;  

  return StringCmp(&a1->url, &a2->url);
}
Exemple #5
0
//SmartMedia ECC Controll Subroutine
//----- Check_D_ReadError() ----------------------------------------------
int Check_D_ReadError(BYTE *redundant)
{
    // Driver 不做 ECC Check
    return(SUCCESS);
    if (!StringCmp((char *)(redundant+0x0D),(char *)EccBuf,3))
        if (!StringCmp((char *)(redundant+0x08),(char *)(EccBuf+0x03),3))
            return(SUCCESS);

    return(ERROR);
}
Exemple #6
0
//----- Check_D_Correct() ----------------------------------------------
int Check_D_Correct(BYTE *buf,BYTE *redundant)
{
    // Driver 不做 ECC Check
    return(SUCCESS);
    if (StringCmp((char *)(redundant+0x0D),(char *)EccBuf,3))
        if (_Correct_D_SwECC(buf,redundant+0x0D,EccBuf))
            return(ERROR);

    buf+=0x100;
    if (StringCmp((char *)(redundant+0x08),(char *)(EccBuf+0x03),3))
        if (_Correct_D_SwECC(buf,redundant+0x08,EccBuf+0x03))
            return(ERROR);

    return(SUCCESS);
}
Exemple #7
0
static void WriteSortedProteinsToFile (FILE *fp, SeqEntryPtr sep)
{
    AlphaProtPtr app;
  ValNodePtr   prot_list = NULL, vnp;
  CharPtr      prev_name = NULL;

  if (fp == NULL || sep == NULL) {
    return;
  }

  VisitBioseqsInSep (sep, &prot_list, GetProtListCallback);
  prot_list = ValNodeSort (prot_list, SortProtByName);
    for (vnp = prot_list; vnp != NULL; vnp = vnp->next)
  {
      app = (AlphaProtPtr) vnp->data.ptrvalue;
      if (app == NULL) continue;
      if (prev_name != NULL && StringCmp (prev_name, app->prot_name) != 0) {
        fprintf (fp, "\n");
      }

    sep = SeqMgrGetSeqEntryForData (app->bsp);
    SeqEntryFastaStreamEx (sep, fp, STREAM_EXPAND_GAPS | STREAM_CORRECT_INVAL, 70, 0, 0, FALSE, TRUE, FALSE, TRUE, TRUE);

    prev_name = app->prot_name;
    }
    for (vnp = prot_list; vnp != NULL; vnp = vnp->next)
    {
      app = (AlphaProtPtr) vnp->data.ptrvalue;
      if (app == NULL) continue;
      app->prot_name = MemFree (app->prot_name);
      vnp->data.ptrvalue = MemFree (app);
    }
  prot_list = ValNodeFree (prot_list);        
}
Exemple #8
0
static FetchItemPtr FindInFetchIndex (CharPtr str)
{
  Int4 imin = 0;
  Int4 imax = sFetchIndexSize - 1;
  Int4 num = -1, i, j;
  CharPtr tmp;

  while (imax >= imin)
  {
    i = (imax + imin)/2;
    tmp = sFetchIndex[i]->id_txt;
    if ((j = StringCmp(tmp, str)) > 0)
      imax = i - 1;
    else if (j < 0)
      imin = i + 1;
    else
    {
      num = i;
      break;
    }
  }
  if (num == -1) {
    return NULL;
  } else {
    return sFetchIndex[num];
  }
}
Exemple #9
0
VOID ComboAdd(COMBO ptr, LPTSTR Item)
{
	INT i;
	Combo *c = (Combo*) ptr;

	if(StringIsEmpty(Item))
		return;

	for(i=0; i<c->HistoryLen; i++)
		if(StringCmp(c->History[i],Item)==0) {
			LPTSTR aux = c->History[c->HistoryLen-1];
			c->History[c->HistoryLen-1] = c->History[i];
			c->History[i] = aux;
			return;
	}


	if(c->HistoryLen<MAX_HISTORY) {
		c->History[c->HistoryLen] = StringDup(Item);
		(c->HistoryLen)++;
	} else {
		free(c->History[0]);
		for(i=0;i<c->HistoryLen-1;i++)
			c->History[i] = c->History[i+1];
		c->History[c->HistoryLen-1] = StringDup(Item);
	}

}
Exemple #10
0
static void ChangeName (
  PopuP p
)

{
  AlistDialogPtr  adp;
  IntBadgPtr      ibp;
  SscBadgPtr      sbp;
  SscTablesPtr    stp;
  CharPtr         str;

  adp = (AlistDialogPtr) GetObjectExtra (p);
  if (adp == NULL) return;
  sbp = (SscBadgPtr) adp->userdata;
  if (sbp == NULL) return;
  stp = sbp->tables;
  if (stp == NULL) return;
  ibp = GetBadgInfo (sbp, sbp->currItem);
  if (ibp == NULL) return;

  str = GetEnumPopupByName (sbp->name, stp->payers.alist);
  if (StringCmp (str, "-") == 0) {
    str [0] = ' ';
    SetEnumPopupByName (sbp->name, stp->payers.alist, str);
  }
  ibp->name = MemFree (ibp->name);
  ibp->name = str; /* allocated by GetEnumPopupByName */
  ibp->type = GetMemberType (str, stp);

  UpdateDocument (sbp->badglog, sbp->currItem, sbp->currItem);
  Update ();

  CheckExtendTable (sbp);
}
Exemple #11
0
static void
/*FCN*/OnGroupNew (
  ButtoN b
){
  Int2 i;
  Char newName[64];

  GetTitle ( groupDialog, &(newName[0]), 64 );
  if ( newName[0] == 0 ) return;
  newName[63] = 0;
  for ( i=1; i<=totalGroups; i++ ){
    if ( StringCmp ( (CharPtr)Nlm_GetMuskCParamEd(MSM_GROUPS,
                      i,MSM_STRING), &(newName[0]) ) == 0 ) return;
  }
  MemMove ( &(groupAr[1]), &(groupAr[0]), totalGroups*sizeof(Int2) );
  totalGroups++;
  nHideGroups++;
  groupAr[0] = totalGroups;
  Nlm_SetMuskCParamEd(MSM_GROUPS,MSM_NOSUBCLASS,MSM_NUM,(BigScalar)totalGroups);
  Nlm_SetMuskCParamEd(MSM_GROUPS,totalGroups,MSM_STRING,(BigScalar)&(newName[0]));
  curGroupInd = 0;
  FillGroupList(TRUE);
  SetGroupValue ( curGroupInd );
  FillFeatPopup(TRUE);
  LoadFeatureArray();
  FillFeatList(TRUE);
  if ( totalFeatures == 0 ){
    curFeatureInd = -1;
  } else {
    curFeatureInd = 0;
    SetFeatValue ( curFeatureInd );
  }
  UpdateDlgControls();
  SaveGroupArray();
}
/** Compares two SBlastMessage elements and returns TRUE if they are identical.
 * FALSE is returned if they are not or one or both is NULL.
 * @param message_1 first object to compare [in]
 * @param message_2 second object to compare [in]
 * @return TRUE if identical
 */
Boolean s_SBlastMessageCompare(SBlastMessage* message_1, SBlastMessage* message_2)
{
    if (message_1 == NULL || message_2 == NULL)
        return FALSE;

    if (message_1->sev != message_2->sev)
       return FALSE;

    if (message_1->message == NULL || message_2->message == NULL)
       return FALSE;

    if (StringCmp(message_1->message, message_2->message))
       return FALSE;

    if ((message_1->query_id == NULL && message_2->query_id) ||
        (message_1->query_id && message_2->query_id == NULL))
       return FALSE;

    if (message_1->query_id && message_2->query_id && 
        SeqIdComp(message_1->query_id, message_2->query_id) != SIC_YES)
       return FALSE;

    if (message_1->believe_query != message_2->believe_query)
       return FALSE;

    return TRUE;
}
Exemple #13
0
static void RecordThesis (ScanDataPtr sdp, CharPtr str)

{
  StringSetPtr  ssp;
  ValNodePtr    vnp;

  if (sdp == NULL || StringHasNoText (str)) return;

  for (vnp = sdp->lcList; vnp != NULL; vnp = vnp->next) {
    ssp = (StringSetPtr) vnp->data.ptrvalue;
    if (ssp == NULL) continue;
    if (StringCmp (ssp->text, str) == 0) {
      (ssp->count)++;
      return;
    }
  }

  ssp = MemNew (sizeof (StringSet));
  if (ssp == NULL) return;
  StringCpy (ssp->firstID, sdp->buf);
  StringNCpy_0 (ssp->text, str, sizeof (ssp->text));
  ssp->count = 1;

  ValNodeAddPointer (&(sdp->lcList), 0, (Pointer) ssp);
}
Exemple #14
0
static void PrintMisMatches(FILE *out, CharPtr id_txt, ValNodePtr val, ValNodePtr col, ValNodePtr field)
{
  CharPtr label = NULL;

  while (field != NULL && (val != NULL || col != NULL)) {
    if (val == NULL) {
      if (!StringHasNoText (col->data.ptrvalue)) {
        label = SummarizeFieldType (field);
        fprintf (out, "%s\t%s\t\t%s\n", id_txt, label, (char *) col->data.ptrvalue);
      }
    } else if (col == NULL) {
      if (!StringHasNoText (val->data.ptrvalue)) {
        label = SummarizeFieldType (field);
        fprintf (out, "%s\t%s\t%s\t\n", id_txt, label, (char *) val->data.ptrvalue);
      }
    } else if (!StringHasNoText (val->data.ptrvalue) && !StringHasNoText (col->data.ptrvalue)
               && StringCmp (val->data.ptrvalue, col->data.ptrvalue) != 0) {
      label = SummarizeFieldType (field);
      fprintf (out, "%s\t%s\t%s\t%s\n", id_txt, label, (char *) val->data.ptrvalue, (char *) col->data.ptrvalue);
    }
    label = MemFree (label);

    if (val != NULL) {
      val = val->next;
    }
    if (col != NULL) {
      col = col->next;
    }
    field = field->next;
  }
}
Exemple #15
0
static int FetchItemCompare (FetchItemPtr f1, FetchItemPtr f2)
{
  if (f1 == NULL || f2 == NULL) {
    return 0;
  } else {
    return StringCmp (f1->id_txt, f2->id_txt);
  }
}
Exemple #16
0
void 
Blast_SeqIdGetDefLine(SeqId* sip, char** buffer_ptr, Boolean ncbi_gi, 
                      Boolean accession_only, Boolean search_for_id)
{
   char* seqid_buffer = NULL;
   Int4 gi = 0;
   Boolean numeric_id_type = FALSE;

   *buffer_ptr = NULL;

   if (sip == NULL)
	return;

   /* Check for ad hoc ID's generated by formatdb if the user does not provide 
      any. */
   if (search_for_id && (sip->choice != SEQID_GENERAL ||
       StringCmp(((Dbtag*)sip->data.ptrvalue)->db, "BL_ORD_ID")))  
   {
      if ((!accession_only && !ncbi_gi) || sip->choice == SEQID_LOCAL) {
         seqid_buffer = (char*) malloc(BUFFER_LENGTH + 1);
         SeqIdWrite(sip, seqid_buffer, PRINTID_FASTA_LONG, BUFFER_LENGTH);
      } else if (accession_only) {
         seqid_buffer = (char*) malloc(BUFFER_LENGTH + 1);
         SeqIdWrite(SeqIdFindBestAccession(sip), seqid_buffer, 
                    PRINTID_TEXTID_ACC_VER, BUFFER_LENGTH);
      } else if (ncbi_gi) {
         numeric_id_type = 
            GetAccessionFromSeqId(SeqIdFindBest(sip, SEQID_GI), 
                                  &gi, &seqid_buffer);
      } else {
         numeric_id_type = 
	    GetAccessionFromSeqId(SeqIdFindBestAccession(sip), 
                                  &gi, &seqid_buffer);
      }
   }

   if (numeric_id_type && gi > 0) {
      seqid_buffer = (char*) malloc(16);
      sprintf(seqid_buffer, "%ld", (long) gi);
   }   
   if (!seqid_buffer) {
      /* If it's still NULL make a last ditch effort to get info. */
      char* title=NULL;
      Bioseq* bsp = BioseqLockById(sip);
      if (bsp) {
         if (BioseqGetTitle(bsp) != NULL)
            title = strdup(BioseqGetTitle(bsp));
         else
            title = strdup("No definition line found");
      }
      BioseqUnlock(bsp);
      
      if (title) /* Use first token as id. */
         seqid_buffer = StringTokMT(title, " \t\n\r", &title);  
   }
   *buffer_ptr = seqid_buffer;

}
Exemple #17
0
BOOL ComboHasChanged(HWND hDlg, COMBO ptr)
{
	Combo *c = (Combo*) ptr;
	TCHAR Buf[MAX_BUF_LEN];

	ComboGetDlgText(hDlg, ptr, Buf, MAX_BUF_LEN);
	return (StringCmp(Buf,ComboGetValue(ptr))!=0);

}
Exemple #18
0
static Int4 GetTraceID (SeqIdPtr sip)
{
  DbtagPtr dbtag;

  if (sip == NULL || sip->choice != SEQID_GENERAL) return 0;
  dbtag = (DbtagPtr) sip->data.ptrvalue;
  if (dbtag == NULL || StringCmp (dbtag->db, "ti") != 0 || dbtag->tag == NULL) {
    return 0;
  } 
  return dbtag->tag->id;
}
Exemple #19
0
INT_PTR CALLBACK OptsDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
	switch (msg) {
		case WM_INITDIALOG:
			CenterDialogInParent(hDlg);
			InitOptionsFont(hDlg);
			ComboInitDialog(hDlg,GHCi_Combo_Editor);
			ComboInitDialog(hDlg,GHCi_Combo_Startup);
			ComboInitDialog(hDlg,GHCi_Combo_Prompt);

			break;

		case WM_COMMAND: {
				INT Code = HIWORD(wParam);
				INT Ctrl = LOWORD(wParam);

				if ((Ctrl == IDC_ChkFontBold && Code == BN_CLICKED) ||
					(Ctrl == IDC_ChkFontItalic && Code == BN_CLICKED) ||
					(Ctrl == IDC_TxtFontSize && Code == EN_CHANGE) ||
					(Ctrl == IDC_LstFontFace && (Code == CBN_EDITCHANGE || Code == CBN_SELCHANGE))
					)
					UpdateFontPreview(hDlg);


			switch (LOWORD(wParam)) {
				case IDOK: {

					CHARFORMAT cf, prevCf;

					RegistryReadFont(&prevCf);
					CalculateFont(hDlg, &cf);

					if( (StringCmp(cf.szFaceName,prevCf.szFaceName)) 
						  || (cf.yHeight != prevCf.yHeight)  
						  || (cf.dwEffects != prevCf.dwEffects)) {

							RegistryWriteFont(&cf);
							RtfWindowUpdateFont();
					}

					UpdateOptions(hDlg) ;

					EndDialog(hDlg, TRUE);
					return (INT_PTR)TRUE;
				}
				case IDCANCEL:
					EndDialog(hDlg, TRUE);
					return (INT_PTR)TRUE;
			}
		}
		break;
	}
	return (INT_PTR)FALSE;
}
Exemple #20
0
/****************************************************************************
*  GBQualNameValid:
*  -- return index of the ParFlat_GBQual_names array if it is a valid
*     qualifier (ignore case), qual; otherwise return (-1) 
*                                                                   10-12-93
*	-- ignore case changed to case sensitive      10-08-95
*****************************************************************************/
NLM_EXTERN Int2 GBQualNameValid(CharPtr qual)
{
   Int2  i;

   for (i = 0; i < ParFlat_TOTAL_GBQUAL && qual != NULL; i++) {
       if (StringCmp(qual, ParFlat_GBQual_names[i].name) == 0)
          return (i);
   }

   return (-1);

} /* GBQualNameValid */
Exemple #21
0
/****************************************************************************
*  GBFeatKeyNameValid:
*  -- return "index" of the ParFlat_GBFeat array if it is a valid feature key (
*     ignore case), keystr; otherwise, return (-1), UnknownFeatKey
*                                                                  10-11-93
*	-- ignore case changed to case sensitive      10-08-95
****************************************************************************/
NLM_EXTERN Int2 GBFeatKeyNameValid(CharPtr PNTR keystr, Boolean error_msgs)
{
   Int2    j;

   if (StringCmp(*keystr, "-") == 0) 
   {
	if (error_msgs)
	{
            ErrPostStr(SEV_WARNING, ERR_FEATURE_FeatureKeyReplaced, 
           	"Featkey '-' is replaced by 'misc_feature'");
	}
   	*keystr = StringSave("misc_feature");
   }

   for (j = 0; j < ParFlat_TOTAL_GBFEAT; j++) 
   {
       if (StringCmp(ParFlat_GBFeat[j].key, *keystr) == 0)
          return (j);
   }

   return (-1);

} /* GBFeatKeyNameValid */
Exemple #22
0
/*****************************************************************************
*
*   PrintFormatListFind(name)
*   	Just checks in object loaded memory
*
*****************************************************************************/
NLM_EXTERN PrintFormatListPtr PrintFormatListFind (CharPtr name)
{
    Int2 i;

	if (name == NULL)
		return NULL;

    for (i = 0; i < PFLnum; i++)
    {
    	if (PFLlist[i] != NULL && PFLlist[i]->ptp != NULL) {
        	if (! StringCmp(PFLlist[i]->ptp->name, name))
          	  return PFLlist[i];
        }
    }
    return NULL;
}
Exemple #23
0
static INT GenericCmp(INT (*StringCmp)(LPCTSTR, LPCTSTR),
                      LPCTSTR Left, LPCTSTR Right)
{
    TCHAR *end;
    INT nLeft = _tcstol(Left, &end, 0);
    if (*end == _T('\0'))
    {
        INT nRight = _tcstol(Right, &end, 0);
        if (*end == _T('\0'))
        {
            /* both arguments are numeric */
            return (nLeft < nRight) ? -1 : (nLeft > nRight);
        }
    }
    return StringCmp(Left, Right);
}
Exemple #24
0
PMAD GetPMADFromName(PVNMA pvnmaA, CharPtr pcAName) {
	PVNMA pvnmaHere = NULL;
	PMAD pmad;

	pvnmaHere = pvnmaA;
	while(pvnmaHere) {
		pmad = (PMAD)(pvnmaHere->data.ptrvalue);
		if(!StringCmp(pmad->pcAName, pcAName)) {
			return pmad;
		}

		pvnmaHere = pvnmaHere->next;
	}

	return NULL;
}
Exemple #25
0
/*****************************************************************************
*
*   PrintTemplateFind(name)
*   	Just checks in object loaded memory
*
*****************************************************************************/
NLM_EXTERN PrintTemplatePtr PrintTemplateFind (CharPtr name)
{
    Int2 i, PTnum;
	PrintTemplatePtr PNTR PTlist;

	if (name == NULL)
		return NULL;

	PTlist = PrintTemplateInMem(&PTnum);
    for (i = 0; i < PTnum; i++)
    {
    	if (PTlist[i] != NULL) {
        	if (! StringCmp(PTlist[i]->name, name))
       	     return PTlist[i];
        }
    }
    return NULL;
}
Exemple #26
0
static int LIBCALLBACK SortProtByName (VoidPtr ptr1, VoidPtr ptr2)

{
  ValNodePtr   vnp1, vnp2;
  AlphaProtPtr app1, app2;
  
  if (ptr1 != NULL && ptr2 != NULL) {
    vnp1 = *((ValNodePtr PNTR) ptr1);
    vnp2 = *((ValNodePtr PNTR) ptr2);
    if (vnp1 != NULL && vnp2 != NULL) {
      app1 = (AlphaProtPtr) vnp1->data.ptrvalue;
      app2 = (AlphaProtPtr) vnp2->data.ptrvalue;
      if (app1 != NULL && app2 != NULL) {
        return StringCmp (app1->prot_name, app2->prot_name);
      }
    }
  }
  return 0;
}
Exemple #27
0
static Int4 GetTaxIdFromOrgRef (OrgRefPtr orp)
{
  Int4       tax_id = -1;
  ValNodePtr vnp;
  DbtagPtr   d;

  if (orp != NULL)
  {
    for (vnp = orp->db; vnp != NULL; vnp = vnp->next) 
    {
      d = (DbtagPtr) vnp->data.ptrvalue;
      if (StringCmp(d->db, "taxon") == 0) 
      {
        tax_id = d->tag->id;
        break;
      }
    }
  }
  return tax_id;
}
Exemple #28
0
static Boolean HasMismatch
(ValNodePtr values,
 ValNodePtr col)
{
  Boolean rval = FALSE;

  while (!rval && values != NULL && col != NULL) {
    if (StringHasNoText (values->data.ptrvalue)
        && StringHasNoText (col->data.ptrvalue)) {
      /* both empty, ignore */
    } else if (StringCmp (values->data.ptrvalue, col->data.ptrvalue)) {
      rval = TRUE;
    }
    values = values->next;
    col = col->next;
  }
  if (values != NULL || col != NULL) {
    rval = TRUE;
  }
  return rval;
}
Exemple #29
0
static void DoFastaComp (
  BioseqPtr bsp,
  Pointer userdata,
  Boolean ignoreExisting
)

{
  Char           buf [4096];
  CSpeedFlagPtr  cfp;
  Char           id [128];
  CharPtr        title;

  if (bsp == NULL) return;
  cfp = (CSpeedFlagPtr) userdata;
  if (cfp == NULL) return;

  id [0] = '\0';
  SeqIdWrite (bsp->id, id, PRINTID_FASTA_LONG, sizeof (id) - 1);
  buf [0] = '\0';
  CreateDefLineExEx (NULL, bsp, buf, sizeof (buf) - 1, 0,
                     NULL, NULL, ignoreExisting, FALSE);
  title = NewCreateDefLine (NULL, bsp, ignoreExisting, FALSE);
  if (StringHasNoText (title)) {
    title = StringSave ("?");
  }

  if (StringCmp (buf, title) != 0) {
    if (cfp->ofp != NULL) {
      fprintf (cfp->ofp, "<  %s %s\n", id, buf);
      fprintf (cfp->ofp, ">  %s %s\n", id, title);
    }
    printf ("<  %s %s\n", id, buf);
    printf (">  %s %s\n", id, title);
    fflush (stdout);
  }

  MemFree (title);
}
Exemple #30
0
//----- Check_D_CISdata() ----------------------------------------------
int Check_D_CISdata(BYTE *buf, BYTE *redundant)
{
    BYTE cis[]={0x01,0x03,0xD9,0x01,0xFF,0x18,0x02,0xDF,0x01,0x20};

    if (!IsSSFDCCompliance && !IsXDCompliance)
        return(SUCCESS);             // 目前為強制 SUCCESS [Arnold 02-08-23] SSFDC 測試, 不能強制 SUCCESS

    if (!StringCmp((char *)(redundant+0x0D),(char *)EccBuf,3))
        return(StringCmp((char *)buf,(char *)cis,10));

    if (!_Correct_D_SwECC(buf,redundant+0x0D,EccBuf))
        return(StringCmp((char *)buf,(char *)cis,10));

    buf+=0x100;
    if (!StringCmp((char *)(redundant+0x08),(char *)(EccBuf+0x03),3))
        return(StringCmp((char *)buf,(char *)cis,10));

    if (!_Correct_D_SwECC(buf,redundant+0x08,EccBuf+0x03))
        return(StringCmp((char *)buf,(char *)cis,10));

    return(ERROR);
}