示例#1
0
void
adsout_write( fields *f, FILE *fp, param *p, unsigned long refnum )
{
	int type;
	fields_clearused( f );
	type = get_type( f );

	output_people(  fp, f, "AUTHOR", "AUTHOR:ASIS", "AUTHOR:CORP", "%A", LEVEL_MAIN );
	output_people(  fp, f, "EDITOR", "EDITOR:ASIS", "EDITOR:CORP", "%E", LEVEL_ANY );
	output_easy(    fp, f, "TITLE",       "%T", LEVEL_ANY );

	if ( type==TYPE_ARTICLE || type==TYPE_MAGARTICLE )
		output_title( fp, f, "TITLE", "SUBTITLE", "%J", LEVEL_HOST );

	output_date(    fp, f,               "%D", LEVEL_ANY );
	output_easy(    fp, f, "VOLUME",     "%V", LEVEL_ANY );
	output_easy(    fp, f, "ISSUE",      "%N", LEVEL_ANY );
	output_easy(    fp, f, "NUMBER",     "%N", LEVEL_ANY );
	output_easy(    fp, f, "LANGUAGE",   "%M", LEVEL_ANY );
	output_easyall( fp, f, "NOTES",      "%X", LEVEL_ANY );
	output_easy(    fp, f, "ABSTRACT",   "%B", LEVEL_ANY );
	output_keys(    fp, f, "KEYWORD",    "%K", LEVEL_ANY );
	output_easyall( fp, f, "URL",        "%U", LEVEL_ANY ); 
	output_easyall( fp, f, "FILEATTACH", "%U", LEVEL_ANY ); 
	output_easyall( fp, f, "FIGATTACH",  "%U", LEVEL_ANY ); 
	output_pages( fp, f );
	output_easyall( fp, f, "DOI",        "%Y", LEVEL_ANY );
        fprintf( fp, "%%W PHY\n%%G AUTHOR\n" );
	output_Rtag( fp, f, "%R", type );
	fprintf( fp, "\n" );
	fflush( fp );
}
示例#2
0
void output_write_verdict(output_t *out, int verdict, int criticity)
{
  long long now = output_date();

  if ( out == NULL )
    return;

  /* Update current test case */
  if ( out->cur_case != NULL ) {
    out->cur_case->end = now;
    out->cur_case->info.verdict = verdict;
    out->cur_case->info.elapsed = now - out->cur_case->begin;
    if ( criticity < 0 )
      criticity = out->cur_case->default_criticity;
    out->cur_case->info.criticity = criticity;
  }

  /* Update total elapsed time */
  output_stat_elapsed(&(out->stat), (now - out->tree.begin));

  /* Update verdict statistics */
  output_compute_stat(out);

  /* Write Test Output file */
  output_xml_verdict(OUTPUT_XML(out->file), verdict, criticity);
}
示例#3
0
static void
output_citeparts( fields *info, FILE *outptr, int level, int max, int type )
{
	convert origin[] = {
		{ "ADDRESS",	"b:City",	LEVEL_ANY },
		{ "PUBLISHER",	"b:Publisher",	LEVEL_ANY },
		{ "EDITION",	"b:Edition",	LEVEL_ANY }
	};
	int norigin = sizeof( origin ) / sizeof ( convert );
	
	convert parts[] = {
		{ "VOLUME",          "b:Volume",  LEVEL_ANY },
		{ "SECTION",         "b:Section", LEVEL_ANY },
		{ "ISSUE",           "b:Issue",   LEVEL_ANY },
		{ "NUMBER",          "b:Issue",   LEVEL_ANY },
		{ "PUBLICLAWNUMBER", "b:Volume",  LEVEL_ANY },
		{ "SESSION",         "b:Issue",   LEVEL_ANY },
	};
	int nparts=sizeof(parts)/sizeof(convert);
	
	output_bibkey( info, outptr );
	output_type( info, outptr, type );
	output_list( info, outptr, origin, norigin );
	output_date( info, outptr, level );
	output_includedin( info, outptr, type );
	output_list( info, outptr, parts, nparts );
	output_pages( info, outptr, level );
	output_names( info, outptr, level, type );
	output_title( info, outptr, 0 );
	output_comments( info, outptr, level );
}
示例#4
0
int output_write_open(output_t *out)
{
  if ( out == NULL )
    return -1;

  /* Clear Test Output file management */
  output_write_clear(out);

  /* Init global timer */
  out->tree.begin = output_date();

  /* Open Test Output file */
  return output_xml_open(OUTPUT_XML(out->file), &(out->tree));
}
示例#5
0
static void
risout_write( fields *f, FILE *fp, param *p, unsigned long refnum )
{
	int type;
	type = get_type( f, p );
	output_type( fp, type, p );

	output_allpeople( fp, f, type );

	output_date( fp, f );

	output_alltitles( fp, f, type );

	output_pages( fp, f );
	output_easy( fp, f, "VOLUME",             "VL", LEVEL_ANY );
	output_easy( fp, f, "ISSUE",              "IS", LEVEL_ANY );
	output_easy( fp, f, "NUMBER",             "IS", LEVEL_ANY );
	output_easy( fp, f, "EDITION",            "ET", LEVEL_ANY );
	output_easy( fp, f, "NUMVOLUMES",         "NV", LEVEL_ANY );
	output_easy( fp, f, "AUTHORADDRESS",      "AD", LEVEL_ANY );
	output_easy( fp, f, "PUBLISHER",          "PB", LEVEL_ANY );
	output_easy( fp, f, "DEGREEGRANTOR",      "PB", LEVEL_ANY );
	output_easy( fp, f, "DEGREEGRANTOR:ASIS", "PB", LEVEL_ANY );
	output_easy( fp, f, "DEGREEGRANTOR:CORP", "PB", LEVEL_ANY );
	output_easy( fp, f, "ADDRESS",            "CY", LEVEL_ANY );
	output_keywords( fp, f );
	output_easy( fp, f, "ABSTRACT",           "AB", LEVEL_ANY );
	output_easy( fp, f, "CALLNUMBER",         "CN", LEVEL_ANY );
	output_easy( fp, f, "ISSN",               "SN", LEVEL_ANY );
	output_easy( fp, f, "ISBN",               "SN", LEVEL_ANY );
	output_easyall( fp, f, "URL",             "UR", LEVEL_ANY );
	output_easyall( fp, f, "DOI",             "DO", LEVEL_ANY );
	output_file(    fp, f, "FILEATTACH",      "L1", LEVEL_ANY );
	output_file(    fp, f, "FIGATTACH",       "L4", LEVEL_ANY );
	output_easy( fp, f, "CAPTION",            "CA", LEVEL_ANY );
	output_pmid( fp, f );
	output_pmc( fp, f );
	output_arxiv( fp, f );
	output_jstor( fp, f );
	output_easy( fp, f, "LANGUAGE",           "LA", LEVEL_ANY );
	output_easy( fp, f, "NOTES",              "N1", LEVEL_ANY );
	output_easy( fp, f, "REFNUM",             "ID", LEVEL_ANY );
	output_thesishint( fp, type );
	fprintf( fp, "ER  - \n" );
	fflush( fp );
}
示例#6
0
static void
output_citeparts( fields *info, FILE *outptr, int level, int max, int type )
{
	convert origin[] = {
		{ "ADDRESS",	"b:City",	"", LEVEL_ANY },
		{ "PUBLISHER",	"b:Publisher",	"", LEVEL_ANY },
		{ "EDITION",	"b:Edition",	"", LEVEL_ANY }
	};
	int norigin = sizeof( origin ) / sizeof ( convert );
	
	convert parts[] = {
		{ "VOLUME",          "b:Volume",  "", LEVEL_ANY },
		{ "SECTION",         "b:Section", "", LEVEL_ANY },
		{ "ISSUE",           "b:Issue",   "", LEVEL_ANY },
		{ "NUMBER",          "b:Issue",   "", LEVEL_ANY },
		{ "PUBLICLAWNUMBER", "b:Volume",  "", LEVEL_ANY },
		{ "SESSION",         "b:Issue",   "", LEVEL_ANY },
		{ "URL",             "b:Url",     "", LEVEL_ANY },
		{ "JSTOR",           "b:Url",     "http://www.jstor.org/stable/", LEVEL_ANY },
		{ "ARXIV",           "b:Url",     "http://arxiv.org/abs/",        LEVEL_ANY },
		{ "PMID",            "b:Url",     "http://www.ncbi.nlm.nih.gov/pubmed/", LEVEL_ANY },
		{ "PMC",             "b:Url",     "http://www.ncbi.nlm.nih.gov/pmc/articles/", LEVEL_ANY },
		{ "DOI",             "b:Url",     "http://dx.doi.org/", LEVEL_ANY },
	};
	int nparts=sizeof(parts)/sizeof(convert);
	
	output_bibkey( info, outptr );
	output_type( info, outptr, type );
	output_list( info, outptr, origin, norigin );
	output_date( info, outptr, level );
	output_includedin( info, outptr, type );
	output_list( info, outptr, parts, nparts );
	output_pages( info, outptr, level );
	output_names( info, outptr, level, type );
	output_maintitle( info, outptr, 0 );
	output_comments( info, outptr, level );
}
示例#7
0
void output_write_case(output_t *out, tree_object_t *object)
{
  char *name = object->parent_item->name;
  char *comment = object->parent_item->comment;
  tree_object_t *parent_seq;
  output_sequence_t *oseq;
  output_case_t *ocase;
  validate_t *v;
  int checked;

  if ( out == NULL )
    return;
  if ( object->type != TYPE_CASE )
    return;

  /* Check node is healthy */
  if ( object->parent_seq == NULL ) {
    fprintf(stderr, "*PANIC* Orphan Test Case detected\n");
    return;
  }

  /* Create parent sequence if not already done */
  parent_seq = object->parent_seq;
  oseq = output_sequence_find(out->sequences, parent_seq->parent_item->name);
  if ( oseq == NULL ) {
    oseq = output_sequence_alloc(parent_seq->parent_item->name,
                                 parent_seq->parent_item->comment,
                                 tree_object_has_seq(parent_seq) ? 0:1);
    out->sequences = g_list_append(out->sequences, oseq);
  }

  /* Build string with test case number and name */
  if ( name == NULL )
    name = "";
  if ( comment == NULL )
    comment = "";

  /* Perform validation check */
  v = validate_object_data(object);
  checked = validate_check(v, object);

  /* Retrieve / Alloc Test Case entry */
  ocase = output_case_find(oseq->cases, name);
  if ( ocase == NULL ) {
    ocase = output_case_alloc(name, comment);
    out->cases = g_list_append(out->cases, ocase);
    oseq->cases = g_list_append(oseq->cases, ocase);
    ocase->seq = oseq;
  }

  /* Init Test Case info */
  ocase->default_criticity = object->d.Case->criticity;
  ocase->info.verdict = VERDICT_UNEXECUTED;
  ocase->info.criticity = CRITICITY_NONE;
  ocase->info.validated = checked && (v->level == validate_max);

  /* Set Test Case as current */
  out->cur_case = ocase;

  /* Clear test case timer */
  ocase->begin = output_date();

  /* Write Test Case to Test Output file */
  ocase->offset = output_xml_case(OUTPUT_XML(out->file), object);
  if ( checked )
    output_xml_validated(OUTPUT_XML(out->file), v);
}
示例#8
0
void
bibtexout_write( fields *info, FILE *fp, param *p, unsigned long refnum )
{
    int type;
    fields_clearused( info );
    type = bibtexout_type( info, "", refnum, p );
    output_type( fp, type, p->format_opts );
    if ( !( p->format_opts & BIBOUT_DROPKEY ) )
        output_citekey( fp, info, refnum, p->format_opts );
    output_people( fp, info, refnum, "AUTHOR", "AUTHOR:CORP", "AUTHOR:ASIS", "author", 0,
                   p->format_opts );
    output_people( fp, info, refnum, "EDITOR", "EDITOR:CORP", "EDITOR:ASIS", "editor", -1,
                   p->format_opts );
    output_people( fp, info, refnum, "TRANSLATOR", "TRANSLATOR:CORP", "TRANSLATOR:ASIS", "translator", -1, p->format_opts );

    /* item=main level title */
    if ( type==TYPE_INBOOK )
        output_title( fp, info, refnum, "chapter", 0, p->format_opts );
    else
        output_title( fp, info, refnum, "title", 0, p->format_opts );

    /* item=host level title */
    if ( type==TYPE_ARTICLE )
        output_title( fp, info, refnum, "journal", 1, p->format_opts );
    else if ( type==TYPE_INBOOK ) {
        output_title( fp, info, refnum, "title", 1, p->format_opts );
        output_title( fp, info, refnum, "series", 2, p->format_opts );
    }
    else if ( type==TYPE_INPROCEEDINGS || type==TYPE_INCOLLECTION ) {
        output_title( fp, info, refnum, "booktitle", 1, p->format_opts );
        output_title( fp, info, refnum, "series", 2, p->format_opts );
    }
    else if ( type==TYPE_PHDTHESIS || type==TYPE_MASTERSTHESIS ) {
        output_title( fp, info, refnum, "series", 1, p->format_opts );
    }
    else if ( type==TYPE_BOOK || type==TYPE_COLLECTION || type==TYPE_PROCEEDINGS )
        output_title( fp, info, refnum, "series", 1, p->format_opts );

    output_date( fp, info, refnum, p->format_opts );
    output_simple( fp, info, "EDITION", "edition", p->format_opts );
    output_simple( fp, info, "PUBLISHER", "publisher", p->format_opts );
    output_simple( fp, info, "ADDRESS", "address", p->format_opts );
    output_simple( fp, info, "VOLUME", "volume", p->format_opts );
    output_issue_number( fp, info, p->format_opts );
    /*	output_simple( fp, info, "ISSUE", "issue", p->format_opts );
    	output_simple( fp, info, "NUMBER", "number", p->format_opts );s*/
    output_pages( fp, info, refnum, p->format_opts );
    output_simpleall( fp, info, "KEYWORD", "keywords", p->format_opts );
    output_simple( fp, info, "CONTENTS", "contents", p->format_opts );
    output_simple( fp, info, "ABSTRACT", "abstract", p->format_opts );
    output_simple( fp, info, "LOCATION", "location", p->format_opts );
    output_simple( fp, info, "DEGREEGRANTOR", "school", p->format_opts );
    output_simple( fp, info, "DEGREEGRANTOR:ASIS", "school", p->format_opts );
    output_simple( fp, info, "DEGREEGRANTOR:CORP", "school", p->format_opts );
    output_simpleall( fp, info, "NOTES", "note", p->format_opts );
    output_simpleall( fp, info, "ANNOTE", "annote", p->format_opts );
    output_simple( fp, info, "ISBN", "isbn", p->format_opts );
    output_simple( fp, info, "ISSN", "issn", p->format_opts );
    output_simple( fp, info, "DOI", "doi", p->format_opts );
    output_simpleall( fp, info, "URL", "url", p->format_opts );
    output_fileattach( fp, info, p->format_opts );
    output_arxiv( fp, info, p->format_opts );
    output_pmid( fp, info, p->format_opts );
    output_jstor( fp, info, p->format_opts );
    output_simple( fp, info, "LANGUAGE", "language", p->format_opts );
    if ( p->format_opts & BIBOUT_FINALCOMMA ) fprintf( fp, "," );
    fprintf( fp, "\n}\n\n" );
    fflush( fp );
}
示例#9
0
void
isiout_write( fields *f, FILE *fp, param *p, unsigned long refnum )
{
        int type = get_type( f );

	if ( p->format_opts & BIBL_FORMAT_VERBOSE )
		output_verbose( f, refnum );

        output_type( fp, type );
	output_people( fp, f, "AUTHOR", "AU", 0 );
	output_easyall( fp, f, "AUTHOR:CORP", "AU", 0 );
	output_easyall( fp, f, "AUTHOR:ASIS", "AU", 0 );
/*      output_people( fp, f, "AUTHOR", "A2", 1 );
        output_people( fp, f, "AUTHOR:CORP", "A2", 1 );
        output_people( fp, f, "AUTHOR:ASIS", "A2", 1 );
        output_people( fp, f, "AUTHOR", "A3", 2 );
        output_people( fp, f, "AUTHOR:CORP", "A3", 2 );
        output_people( fp, f, "AUTHOR:ASIS", "A3", 2 );
        output_people( fp, f, "EDITOR", "ED", -1 );
	output_people( fp, f, "EDITOR:CORP", "ED", -1 );
        output_people( fp, f, "EDITOR:ASIS", "ED", -1 );*/
/*        output_date( fp, f, refnum );*/

        output_title( fp, f, "TI", 0 );
        if ( type==TYPE_ARTICLE ) {
		output_title( fp, f, "SO", 1 );
		output_abbrtitle( fp, f, "JI", 1 );
		output_title( fp, f, "SE", 2 );
	} else if ( type==TYPE_INBOOK ) {
		output_title( fp, f, "BT", 1 );
		output_title( fp, f, "SE", 2 );
	} else { /* type==BOOK */
		output_title( fp, f, "SE", 1 );
	}

	output_date( fp, f );
/*	output_easy( fp, f, "PARTMONTH", "PD", -1 );
	output_easy( fp, f, "PARTYEAR", "PY", -1 );*/

	output_easy( fp, f, "PAGESTART", "BP", -1 );
	output_easy( fp, f, "PAGEEND",   "EP", -1 );
        output_easy( fp, f, "ARTICLENUMBER", "AR", -1 );
        /* output article number as pages */
	output_easy( fp, f, "TOTALPAGES","PG", -1 );

        output_easy( fp, f, "VOLUME",    "VL", -1 );
        output_easy( fp, f, "ISSUE",     "IS", -1 );
        output_easy( fp, f, "NUMBER",    "IS", -1 );
	output_easy( fp, f, "DOI",       "DI", -1 );
	output_easy( fp, f, "ISIREFNUM", "UT", -1 );
	output_easy( fp, f, "LANGUAGE",  "LA", -1 );
	output_easy( fp, f, "ISIDELIVERNUM", "GA", -1 );
	output_keywords( fp, f );
	output_easy( fp, f, "ABSTRACT",  "AB", -1 );
	output_easy( fp, f, "TIMESCITED", "TC", -1 );
	output_easy( fp, f, "NUMBERREFS", "NR", -1 );
	output_easy( fp, f, "CITEDREFS",  "CR", -1 );
	output_easy( fp, f, "ADDRESS",    "PI", -1 );

/*        output_easy( fp, f, "PUBLISHER", "PB", -1 );
        output_easy( fp, f, "DEGREEGRANTOR", "PB", -1 );
        output_easy( fp, f, "ADDRESS", "CY", -1 );
        output_easy( fp, f, "ABSTRACT", "AB", -1 );
        output_easy( fp, f, "ISSN", "SN", -1 );
        output_easy( fp, f, "ISBN", "SN", -1 );
        output_easyall( fp, f, "URL", "UR", -1 );
        output_easyall( fp, f, "FILEATTACH", "UR", -1 );
        output_pubmed( fp, f, refnum );
        output_easyall( fp, f, "NOTES", "N1", -1 );
        output_easyall( fp, f, "REFNUM", "ID", -1 );*/
        fprintf( fp, "ER\n\n" );
        fflush( fp );
}