Exemplo n.º 1
0
/* Function: Plan7SetName()
 * 
 * Purpose:  Change the name of a Plan7 HMM. Convenience function.
 *      
 * Note:     Trailing whitespace and \n's are chopped.     
 */
void
Plan7SetName(struct plan7_s *hmm, char *name)
{
  if (hmm->name != NULL) free(hmm->name);
  hmm->name = Strdup(name);
  StringChop(hmm->name);
}
Exemplo n.º 2
0
/* Function: Plan7SetCtime()
 * Date:     SRE, Wed Oct 29 11:53:19 1997 [TWA 721 over the Atlantic]
 * 
 * Purpose:  Set the ctime field in a new HMM to the current time.
 */
void
Plan7SetCtime(struct plan7_s *hmm)
{
  time_t date = time(NULL);
  if (hmm->ctime != NULL) free(hmm->ctime);
  hmm->ctime = Strdup(ctime(&date));
  StringChop(hmm->ctime);
}
Exemplo n.º 3
0
/* Function: Plan7SetDescription()
 * 
 * Purpose:  Change the description line of a Plan7 HMM. Convenience function.
 * 
 * Note:     Trailing whitespace and \n's are chopped.
 */
void
Plan7SetDescription(struct plan7_s *hmm, char *desc)
{
  if (hmm->desc != NULL) free(hmm->desc);
  hmm->desc = Strdup(desc);
  StringChop(hmm->desc); 
  hmm->flags |= PLAN7_DESC;
}
Exemplo n.º 4
0
/* Function: Plan7SetAccession()
 * 
 * Purpose:  Change the accession number of a Plan7 HMM. Convenience function.
 *      
 * Note:     Trailing whitespace and \n's are chopped.     
 */
void
Plan7SetAccession(struct plan7_s *hmm, char *acc)
{
  if (hmm->acc != NULL) free(hmm->acc);
  hmm->acc = Strdup(acc);
  StringChop(hmm->acc);
  hmm->flags |= PLAN7_ACC;
}
Exemplo n.º 5
0
extern	Bool
CheckAuthID(
	URL		*zone,
	char	*id,
	char	*user,
	char	*other)
{
	Bool	fOK;
	char	fname[SIZE_LONGNAME+1];
	char	buff[SIZE_BUFF];
	FILE	*fp;
	char	*p;

	if		(  !stricmp(zone->protocol,"file")  ) {
		sprintf(fname,"%s/%s",zone->file,id);
		if		(  ( fp = fopen(fname,"r") )  !=  NULL  ) {
			if		(  fgets(buff, SIZE_BUFF, fp)  !=  NULL  ) {
				StringChop(buff);
				if		(  ( p = strchr(buff,':') )  !=  NULL  ) {
					*p = 0;
					if		(  user  !=  NULL  ) {
						strcpy(user,buff);
					}
					if		(  other  !=  NULL  ) {
						strcpy(other,p+1);
					}
				} else {
					if		(  user  !=  NULL  ) {
						strcpy(user,buff);
					}
					if		(  other  !=  NULL  ) {
						*other = 0;
					}
				}
				fOK = TRUE;
			} else {
				fOK = FALSE;
			}
			fclose(fp);
		} else {
			fOK = FALSE;
		}
	} else {
		fOK = FALSE;
	}
	if		(  !fOK  ) {
		if		(  user  !=  NULL  ) {
			*user = 0;
		}
		if		(  other  !=  NULL  ) {
			*other = 0;
		}
	}
	return	(fOK);
}	
Exemplo n.º 6
0
static void PutLog(char *str) {
  char buff[SIZE_LOG];

  sprintf(buff, "%s", StringChop(str));
#ifdef USE_MSGD
  Send(fpLog, buff, strlen(buff));
  Send(fpLog, "\n", 1);
  Flush(fpLog);
#else
  fprintf(fpLog, "%s\n", buff);
  fflush(fpLog);
#endif
}