Change "edited" to "modified" in one more place when referring to blocks.

Modifications aren't necessarily the result of a user editing something.
pespin/rlcmac
Guy Harris 1 year ago committed by Wireshark GitLab Utility
parent 53f31f100f
commit 831f6233ad
  1. 6
      cfile.h
  2. 12
      file.c
  3. 10
      file_packet_provider.c

@ -54,12 +54,12 @@ typedef enum {
* Packet provider for programs using a capture file.
*/
struct packet_provider_data {
wtap *wth; /* Wiretap session */
wtap *wth; /* Wiretap session */
const frame_data *ref;
frame_data *prev_dis;
frame_data *prev_cap;
frame_data_sequence *frames; /* Sequence of frames, if we're keeping that information */
GTree *frames_edited_blocks; /* BST with changed blocks for frames (key = frame_data) */
frame_data_sequence *frames; /* Sequence of frames, if we're keeping that information */
GTree *frames_modified_blocks; /* BST with modified blocks for frames (key = frame_data) */
};
typedef struct _capture_file {

@ -407,9 +407,9 @@ cf_close(capture_file *cf)
free_frame_data_sequence(cf->provider.frames);
cf->provider.frames = NULL;
}
if (cf->provider.frames_edited_blocks) {
g_tree_destroy(cf->provider.frames_edited_blocks);
cf->provider.frames_edited_blocks = NULL;
if (cf->provider.frames_modified_blocks) {
g_tree_destroy(cf->provider.frames_modified_blocks);
cf->provider.frames_modified_blocks = NULL;
}
cf_unselect_packet(cf); /* nothing to select */
cf->first_displayed = 0;
@ -4773,9 +4773,9 @@ cf_save_records(capture_file *cf, const char *fname, guint save_format,
fdata->has_modified_block = FALSE;
}
if (cf->provider.frames_edited_blocks) {
g_tree_destroy(cf->provider.frames_edited_blocks);
cf->provider.frames_edited_blocks = NULL;
if (cf->provider.frames_modified_blocks) {
g_tree_destroy(cf->provider.frames_modified_blocks);
cf->provider.frames_modified_blocks = NULL;
}
cf->packet_comment_count = 0;

@ -72,8 +72,8 @@ cap_file_provider_get_interface_description(struct packet_provider_data *prov, g
wtap_block_t
cap_file_provider_get_modified_block(struct packet_provider_data *prov, const frame_data *fd)
{
if (prov->frames_edited_blocks)
return (wtap_block_t)g_tree_lookup(prov->frames_edited_blocks, fd);
if (prov->frames_modified_blocks)
return (wtap_block_t)g_tree_lookup(prov->frames_modified_blocks, fd);
/* ws_warning? */
return NULL;
@ -82,11 +82,11 @@ cap_file_provider_get_modified_block(struct packet_provider_data *prov, const fr
void
cap_file_provider_set_modified_block(struct packet_provider_data *prov, frame_data *fd, wtap_block_t new_block)
{
if (!prov->frames_edited_blocks)
prov->frames_edited_blocks = g_tree_new_full(frame_cmp, NULL, NULL, (GDestroyNotify)wtap_block_unref);
if (!prov->frames_modified_blocks)
prov->frames_modified_blocks = g_tree_new_full(frame_cmp, NULL, NULL, (GDestroyNotify)wtap_block_unref);
/* insert new packet block */
g_tree_replace(prov->frames_edited_blocks, fd, (gpointer)new_block);
g_tree_replace(prov->frames_modified_blocks, fd, (gpointer)new_block);
fd->has_modified_block = TRUE;
}

Loading…
Cancel
Save