diff --git a/src/include/ZMap/zmapFeature.h b/src/include/ZMap/zmapFeature.h index 5eafdde6c2dcec162cf81f6e5e29e4de15ac5e45..f1d258f63ce7e9147646a0eb5f7040ce780cd419 100755 --- a/src/include/ZMap/zmapFeature.h +++ b/src/include/ZMap/zmapFeature.h @@ -25,9 +25,9 @@ * Description: Data structures describing a sequence feature. * * HISTORY: - * Last edited: Oct 14 13:58 2008 (edgrif) + * Last edited: Nov 5 12:03 2008 (rds) * Created: Fri Jun 11 08:37:19 2004 (edgrif) - * CVS info: $Id: zmapFeature.h,v 1.146 2008-10-29 16:20:47 edgrif Exp $ + * CVS info: $Id: zmapFeature.h,v 1.147 2008-11-05 12:12:36 rds Exp $ *------------------------------------------------------------------- */ #ifndef ZMAP_FEATURE_H @@ -111,6 +111,11 @@ typedef enum {ZMAPSEQUENCE_NONE = 0, ZMAPSEQUENCE_DNA, ZMAPSEQUENCE_PEPTIDE} ZMa typedef enum {ZMAPFEATURELENGTH_TARGET, ZMAPFEATURELENGTH_QUERY, ZMAPFEATURELENGTH_SPLICED} ZMapFeatureLengthType ; +typedef enum + { + ZMAPFEATURE_DUMP_NO_FUNCTION, + ZMAPFEATURE_DUMP_UNKNOWN_FEATURE_TYPE + } ZMapFeatureDumpError; /* Holds dna or peptide. * Note that the sequence will be a valid string in that it will be null-terminated, @@ -542,24 +547,10 @@ typedef ZMapFeatureContextExecuteStatus (*ZMapGDataRecurseFunc)(GQuark key_id, gpointer user_data, char **error); -/* Callback function for calls to zMapFeatureDumpFeatures(), caller can use this function to - * format features in any way they want. */ -typedef gboolean (*ZMapFeatureDumpFeatureCallbackFunc)(GIOChannel *file, - gpointer user_data, - ZMapFeatureTypeStyle style, - char *parent_name, - char *feature_name, - char *style_name, - char *ontology, - int x1, int x2, - gboolean has_score, float score, - ZMapStrand strand, - ZMapPhase phase, - ZMapStyleMode feature_type, - gpointer feature_data, - GError **error_out) ; - - +typedef gboolean (*ZMapFeatureDumpFeatureFunc)(ZMapFeatureAny feature_any, + GString *dump_string_in_out, + GError **error, + gpointer user_data); /* FeatureAny funcs. */ @@ -794,12 +785,19 @@ gboolean zMapSetListEqualStyles(GList **feature_set_names, GList **styles) ; /* Probably should be merged at some time.... */ gboolean zMapFeatureDumpStdOutFeatures(ZMapFeatureContext feature_context, GError **error_out) ; -gboolean zMapFeatureContextDump(GIOChannel *file, - ZMapFeatureContext feature_context, GError **error_out) ; -gboolean zMapFeatureDumpFeatures(GIOChannel *file, ZMapFeatureAny dump_set, - ZMapFeatureDumpFeatureCallbackFunc dump_func, - gpointer user_data, - GError **error) ; +gboolean zMapFeatureContextDump(ZMapFeatureContext feature_context, GIOChannel *file, GError **error_out) ; + +gboolean zMapFeatureContextDumpToFile(ZMapFeatureAny feature_any, + ZMapFeatureDumpFeatureFunc dump_func, + gpointer dump_user_data, + GIOChannel *dump_file, + GError **dump_error_out); + +gboolean zMapFeatureListDumpToFile(GList *feature_list, + ZMapFeatureDumpFeatureFunc dump_func, + gpointer dump_user_data, + GIOChannel *dump_file, + GError **dump_error_out); gboolean zMapFeatureGetFeatureListExtent(GList *feature_list, int *start_out, int *end_out); diff --git a/src/include/ZMap/zmapGFF.h b/src/include/ZMap/zmapGFF.h index 4c126413352b4af5fdf0e21f86a4aea65b302aa7..bf324c34ceb36b246bacf7af0ed5e235fb807dbb 100755 --- a/src/include/ZMap/zmapGFF.h +++ b/src/include/ZMap/zmapGFF.h @@ -28,9 +28,9 @@ * of ZMapFeatureStruct's, one for each GFF source. * * HISTORY: - * Last edited: Oct 17 14:14 2008 (edgrif) + * Last edited: Nov 4 09:49 2008 (rds) * Created: Sat May 29 13:18:32 2004 (edgrif) - * CVS info: $Id: zmapGFF.h,v 1.13 2008-10-29 16:09:38 edgrif Exp $ + * CVS info: $Id: zmapGFF.h,v 1.14 2008-11-05 12:12:44 rds Exp $ *------------------------------------------------------------------- */ #ifndef ZMAP_GFF_H @@ -88,8 +88,6 @@ gboolean zMapGFFTerminated(ZMapGFFParser parser) ; void zMapGFFSetFreeOnDestroy(ZMapGFFParser parser, gboolean free_on_destroy) ; void zMapGFFDestroyParser(ZMapGFFParser parser) ; - -gboolean zMapGFFDump(GIOChannel *file, ZMapFeatureBlock feature_block, GError **error_out) ; - +gboolean zMapGFFDump(ZMapFeatureAny dump_set, GIOChannel *file, GError **error_out); #endif /* ZMAP_GFF_H */ diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am index 4c5f47946ee349124fd550a6a1d31598abe4dd20..d166e94ab6bee2196801a5afcf5267a5e1c856be 100755 --- a/src/lib/Makefile.am +++ b/src/lib/Makefile.am @@ -67,6 +67,7 @@ $(top_srcdir)/zmapFeature/zmapFeature.c \ $(top_srcdir)/zmapFeature/zmapFeatureContext.c \ $(top_srcdir)/zmapFeature/zmapFeatureContextUtils.c \ $(top_srcdir)/zmapFeature/zmapFeatureFormatInput.c \ +$(top_srcdir)/zmapFeature/zmapFeatureOutput.c \ $(top_srcdir)/zmapFeature/zmapFeatureTypes.c \ $(top_srcdir)/zmapFeature/zmapFeatureUtils.c \ $(top_srcdir)/zmapFeature/zmapFeatureXML.c \