g_array_append_val(in_file->idb_index_map, found_index);
}
-/*
- * Scan through the arguments and open the input files
+/** Open a number of input files to merge.
+ *
+ * @param in_file_count number of entries in in_file_names and in_files
+ * @param in_file_names filenames of the input files
+ * @param in_files input file array to be filled (>= sizeof(merge_in_file_t) * in_file_count)
+ * @param err wiretap error, if failed
+ * @param err_info wiretap error string, if failed
+ * @param err_fileno file on which open failed, if failed
+ * @return TRUE if all files could be opened, FALSE otherwise
*/
-gboolean
+static gboolean
merge_open_in_files(int in_file_count, const char *const *in_file_names,
merge_in_file_t **in_files, int *err, gchar **err_info,
int *err_fileno)
return TRUE;
}
-/*
- * Scan through and close each input file
+/** Close the input files again.
+ *
+ * @param in_file_count number of entries in in_files
+ * @param in_files input file array to be closed
*/
-void
+static void
merge_close_in_files(int count, merge_in_file_t in_files[])
{
int i;
}
}
-/*
- * Select an output frame type based on the input files
- * From Guy: If all files have the same frame type, then use that.
- * Otherwise select WTAP_ENCAP_PER_PACKET. If the selected
- * output file type doesn't support per packet frame types,
- * then the wtap_dump_open call will fail with a reasonable
- * error condition.
+/** Select an output frame type based on the input files
+ *
+ * If all files have the same frame type, then use that.
+ * Otherwise select WTAP_ENCAP_PER_PACKET. If the selected
+ * output file type doesn't support per packet frame types,
+ * then the wtap_dump_open call will fail with a reasonable
+ * error condition.
+ *
+ * @param in_file_count number of entries in in_files
+ * @param in_files input file array
+ * @return the frame type
*/
-int
+static int
merge_select_frame_type(int count, merge_in_file_t files[])
{
int i;
return selected_frame_type;
}
-/*
- * Scan through input files and find maximum snapshot length
- */
-int
-merge_max_snapshot_length(int count, merge_in_file_t in_files[])
-{
- int i;
- int max_snapshot = 0;
- int snapshot_length;
-
- for (i = 0; i < count; i++) {
- snapshot_length = wtap_snapshot_length(in_files[i].wth);
- if (snapshot_length == 0) {
- /* Snapshot length of input file not known. */
- snapshot_length = WTAP_MAX_PACKET_SIZE;
- }
- if (snapshot_length > max_snapshot)
- max_snapshot = snapshot_length;
- }
- return max_snapshot;
-}
-
/*
* returns TRUE if first argument is earlier than second
*/
return TRUE;
}
-/*
- * Read the next packet, in chronological order, from the set of files
- * to be merged.
+/** Read the next packet, in chronological order, from the set of files to
+ * be merged.
*
* On success, set *err to 0 and return a pointer to the merge_in_file_t
* for the file from which the packet was read.
*
* On an EOF (meaning all the files are at EOF), set *err to 0 and return
* NULL.
+ *
+ * @param in_file_count number of entries in in_files
+ * @param in_files input file array
+ * @param err wiretap error, if failed
+ * @param err_info wiretap error string, if failed
+ * @return pointer to merge_in_file_t for file from which that packet
+ * came, or NULL on error or EOF
*/
-merge_in_file_t *
+static merge_in_file_t *
merge_read_packet(int in_file_count, merge_in_file_t in_files[],
int *err, gchar **err_info)
{
return &in_files[ei];
}
-/*
- * Read the next packet, in file sequence order, from the set of files
+/** Read the next packet, in file sequence order, from the set of files
* to be merged.
*
* On success, set *err to 0 and return a pointer to the merge_in_file_t
*
* On an EOF (meaning all the files are at EOF), set *err to 0 and return
* NULL.
+ *
+ * @param in_file_count number of entries in in_files
+ * @param in_files input file array
+ * @param err wiretap error, if failed
+ * @param err_info wiretap error string, if failed
+ * @return pointer to merge_in_file_t for file from which that packet
+ * came, or NULL on error or EOF
*/
-merge_in_file_t *
+static merge_in_file_t *
merge_append_read_packet(int in_file_count, merge_in_file_t in_files[],
int *err, gchar **err_info)
{
GArray *idb_index_map; /* used for mapping the old phdr interface_id values to new during merge */
} merge_in_file_t;
-/** Open a number of input files to merge.
- *
- * @param in_file_count number of entries in in_file_names and in_files
- * @param in_file_names filenames of the input files
- * @param in_files input file array to be filled (>= sizeof(merge_in_file_t) * in_file_count)
- * @param err wiretap error, if failed
- * @param err_info wiretap error string, if failed
- * @param err_fileno file on which open failed, if failed
- * @return TRUE if all files could be opened, FALSE otherwise
- */
-WS_DLL_PUBLIC gboolean
-merge_open_in_files(int in_file_count, const char *const *in_file_names,
- merge_in_file_t **in_files, int *err, gchar **err_info,
- int *err_fileno);
-
-/** Close the input files again.
- *
- * @param in_file_count number of entries in in_files
- * @param in_files input file array to be closed
- */
-WS_DLL_PUBLIC void
-merge_close_in_files(int in_file_count, merge_in_file_t in_files[]);
-
-/** Try to get the frame type from the input files.
- *
- * @param in_file_count number of entries in in_files
- * @param in_files input file array
- * @return the frame type
- */
-WS_DLL_PUBLIC int
-merge_select_frame_type(int in_file_count, merge_in_file_t in_files[]);
-
-/** Try to get the snapshot length from the input files.
- *
- * @param in_file_count number of entries in in_files
- * @param in_files input file array
- * @return the snapshot length
- */
-WS_DLL_PUBLIC int
-merge_max_snapshot_length(int in_file_count, merge_in_file_t in_files[]);
-
-/** Read the next packet, in chronological order, from the set of files to
- * be merged.
- *
- * @param in_file_count number of entries in in_files
- * @param in_files input file array
- * @param err wiretap error, if failed
- * @param err_info wiretap error string, if failed
- * @return pointer to merge_in_file_t for file from which that packet
- * came, or NULL on error or EOF
- */
-WS_DLL_PUBLIC merge_in_file_t *
-merge_read_packet(int in_file_count, merge_in_file_t in_files[], int *err,
- gchar **err_info);
-
-
-/** Read the next packet, in file sequence order, from the set of files
- * to be merged.
- *
- * @param in_file_count number of entries in in_files
- * @param in_files input file array
- * @param err wiretap error, if failed
- * @param err_info wiretap error string, if failed
- * @return pointer to merge_in_file_t for file from which that packet
- * came, or NULL on error or EOF
- */
-WS_DLL_PUBLIC merge_in_file_t *
-merge_append_read_packet(int in_file_count, merge_in_file_t in_files[],
- int *err, gchar **err_info);
-
-
/** Return values from merge_files(). */
typedef enum {
MERGE_OK,