2 * Definitions for menu routines with toolkit-independent APIs but
3 * toolkit-dependent implementations.
5 * $Id: merge.h,v 1.3 2004/06/21 16:45:06 ulfl Exp $
7 * Ethereal - Network traffic analyzer
8 * By Gerald Combs <gerald@ethereal.com>
9 * Copyright 1998 Gerald Combs
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 2
14 * of the License, or (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
31 #endif /* __cplusplus */
34 * Structures to manage our input files.
36 typedef struct merge_in_file_s {
46 * Structures to manage our output file.
48 typedef struct merge_out_file_s {
57 /** Verbosity levels. */
64 /** Current verbosity level, default is VERBOSE_NONE. */
65 extern int merge_verbose;
67 /** Open a number of input files to merge.
69 * @param in_file_count number of entries in in_file_names and in_files
70 * @param in_file_names filenames of the input files
71 * @param in_files input file array to be filled (>= sizeof(merge_in_file_t) * in_file_count)
72 * @param err wiretap error, if failed
73 * @return number of opened input files
76 merge_open_in_files(int in_file_count, char *in_file_names[], merge_in_file_t *in_files[], int *err);
78 /** Close the input files again.
80 * @param in_file_count number of entries in in_files
81 * @param in_files input file array to be closed
84 merge_close_in_files(int in_file_count, merge_in_file_t in_files[]);
86 /** Open the output file.
88 * @param out_file the prefilled output file array
89 * @param snapshot_len the snapshot length of the output file
90 * @param err wiretap error, if failed
91 * @return TRUE, if the output file could be opened
94 merge_open_outfile(merge_out_file_t *out_file, int snapshot_len, int *err);
96 /** Close the output file again.
98 * @param out_file the output file array
101 merge_close_outfile(merge_out_file_t *out_file);
103 /** Try to get the frame type from the input files.
105 * @param in_file_count number of entries in in_files
106 * @param in_files input file array
107 * @return the frame type
110 merge_select_frame_type(int in_file_count, merge_in_file_t in_files[]);
112 /** Try to get the snapshot length from the input files.
114 * @param in_file_count number of entries in in_files
115 * @param in_files input file array
116 * @return the snapshot length
119 merge_max_snapshot_length(int in_file_count, merge_in_file_t in_files[]);
121 /** Merge the packets from the input files into the output file sorted chronologically.
123 * @param in_file_count number of entries in in_files
124 * @param in_files input file array
125 * @param out_file the output file array
126 * @param err wiretap error, if failed
127 * @return TRUE if function succeeded
130 merge_files(int in_file_count, merge_in_file_t in_files[], merge_out_file_t *out_file, int *err);
132 /** Append the packets from the input files into the output file.
134 * @param in_file_count number of entries in in_files
135 * @param in_files input file array
136 * @param out_file the output file array
137 * @param err wiretap error, if failed
138 * @return TRUE if function succeeded
141 merge_append_files(int in_file_count, merge_in_file_t in_files[], merge_out_file_t *out_file, int *err);
145 * Convenience function: merge any number of input files into one.
147 * @param out_filename the output filename
148 * @param in_file_count number of input files
149 * @param in_filenames array of input filenames
150 * @param do_append TRUE to append, FALSE to merge chronologically
151 * @param err wiretap error, if failed
152 * @return TRUE if function succeeded
155 merge_n_files(char *out_filename, int in_file_count, char **in_filenames, gboolean do_append, int *err);
160 #endif /* __cplusplus */
162 #endif /* __MERGE_H__ */