aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
AgeCommit message (Collapse)AuthorFilesLines
2005-02-07Move the code to set the title on a window when a capture is in progressGuy Harris1-15/+24
to the "start live capture" callback, and call that from "do_capture()". When opening a capture file, don't pop up the "What do you want to do?" pane when closing any existing file you have open, as we're just going to put the regular view up right after that. svn path=/trunk/; revision=13332
2005-02-07Declare "cf_callback_t" before using it in a further declaration.Guy Harris1-4/+2
Mark the "func" argument to "cf_callback_remove()" as unused. Get rid of the "iface" argument to "cf_start_tail()", as it's no longer used. svn path=/trunk/; revision=13331
2005-02-07Instead of calling each single thing when doing/finish a file operation, ↵Ulf Lamping1-154/+49
file.c shouldn't call all the GUI related functions itself, instead throwing some kind of Events to it's caller(s). I've implemented a very simple callback mechanism which provides exactly this. I've tried GHook from GLib before, but this doesn't seem to be the right thing, as it's too inflexible for the purpose here. So I've implemented a callback function in main.c which receives all "events" and spreads them to menu, statusbar and itself. I would see this implementation as a prototype which may need improvements. Please comment the changes. svn path=/trunk/; revision=13330
2005-02-06Don't have "set_menus_for_captured_packets()" callGuy Harris1-0/+13
"main_set_for_capture_file()"; it should only deal with menus, not anything else - and it gets called while the menus are being set up, which is before the main window has been completely created, so "main_widgets_show_or_hide()", which is called by "main_set_for_capture_file()", gets errors trying to show or hide widgets the pointers to which are null. svn path=/trunk/; revision=13328
2005-02-06another two steps towards privilege seperation:Ulf Lamping1-15/+2
move another two capture related fields (iface and cfilter) from cfile to capture_opts also move the handling of capture related command line options from main.c to capture.c, that way a future privilege seperated capture program can use the same code to parse it's command line than Ethereal. It might be even possible to share this parser code even with Tethereal, didn't took a closer look at this. svn path=/trunk/; revision=13320
2005-02-05use the interfaces descriptive name to be shown in the statusbar as it's, ↵Ulf Lamping1-1/+2
well, more descriptive svn path=/trunk/; revision=13307
2005-02-05minor enhancements to Guy's last updateUlf Lamping1-12/+13
svn path=/trunk/; revision=13304
2005-02-05Put "cf_status_t" back.Guy Harris1-34/+34
svn path=/trunk/; revision=13303
2005-02-05make some string parameters const, as they are not changed insideUlf Lamping1-6/+6
svn path=/trunk/; revision=13298
2005-02-04Instead of having a single enumerated type for status return values fromGuy Harris1-25/+25
cf_ functions, have separate ones for different classes of routines, and use gboolean when the return value is just "success" or "failure" - that way you don't get compiler warnings if a case statement isn't handling a particular status value if the routine in question won't return it. svn path=/trunk/; revision=13293
2005-02-04Properly define "cf_start_tail()".Guy Harris1-1/+1
svn path=/trunk/; revision=13292
2005-02-04huge cleanup of capture file API (functions in file.c/file.h).Ulf Lamping1-110/+112
This includes: all functions in file.h now have a cf_ prefix, will have doxygen tags, will have the capture_file *cf as the first parameter and I tried to generalize the return values for non trivial functions. Hopefully, I didn't introduced any new bugs, as I had to change a lot of files... svn path=/trunk/; revision=13289
2005-02-04remove #include "globals.h" and access to global cfile, use access functions ↵Ulf Lamping1-0/+4
and capture_opts instead svn path=/trunk/; revision=13284
2005-02-04remove #include "globals.h" and access to global cfile, use access functions ↵Ulf Lamping1-0/+14
and capture_opts instead svn path=/trunk/; revision=13283
2005-02-04(some) redesign of capture data structures.Ulf Lamping1-0/+26
don't use global cfile at all but only an untpyed handle to call the cf_... functions in file.c move the save_file member from capture_file to capture_opts, as it's only used while capturing and while preparing it svn path=/trunk/; revision=13276
2004-12-31"gtk_entry_get_text()" returns a "const char *" - assign the result toGuy Harris1-26/+28
one. "get_basename()" doesn't modify its argument, and its callers don't modify the substring pointed to by the result, so make it take a "const char *" as an argument and return a "const char *". "find_last_pathname_separator()" doesn't modify its argument, so make it a "const char *" - but some of its callers pass a non-"const" "char *" and modify the result, so don't make its return value a "const char *". And, as none of its callers are outside "filesystem.c", make it static. In "about_folders_page_new()", have separate variables for pathnames returned as "const char *" (which are cached by the routine that returns them, so you can't modify them - and can't free them, so get rid of the commented-out "g_free()" calls for them) and pathnames returned as "char *" (which are allocated anew for each call, and can be modified, but have to be freed). Clean up white space. svn path=/trunk/; revision=12881
2004-12-29Make the tone of the error messages a bit less formal, by usingGuy Harris1-11/+11
contractions. (Safari does, at least when you're trying to open a file to which you don't have read access.) svn path=/trunk/; revision=12852
2004-10-29The common merge code merely needs to offer the abstraction of routinesGuy Harris1-32/+109
that return the next packet from a set of {chronologically sorted, sequential-by-file} packets; it doesn't need to have a loop over all those packets, or any code to write packets. Supply those abstractions, change the code that merges packets to do its own writing, and have the Ethereal version manage a progress bar and have the mergecap version print packet numbers in verbose mode, as the common merge code used to do. svn path=/trunk/; revision=12427
2004-10-28Make "merge_files()" and "merge_append_files()" return a tri-stateGuy Harris1-10/+73
indication - success, read failure, write failure - and have their callers handle read failures by looking for the file that got the read failure and reporting the failure in question. Free up the err_info string returned by "wtap_read()" after using it. svn path=/trunk/; revision=12423
2004-10-28Remove all the verbose-mode code from merge.c, and put most of it inGuy Harris1-3/+2
mergecap.c (get rid of the verbose printing of information for each packet). Have "merge_append_files()" return FALSE only on a write error, as "merge_files()" does. Sort the routines in "merge.c" in the order from "merge.h". svn path=/trunk/; revision=12422
2004-10-27Get rid of merge_n_files() - it's only called in one place now, andGuy Harris1-24/+36
absorbing its logic into "cf_merge_files()" simplifies things a bit. svn path=/trunk/; revision=12421
2004-10-27Change some of the merge.c APIs to return more information on failure,Guy Harris1-0/+35
and use that information to provide better error messages. Have "merge_open_outfile()" do all the work of filling in the merge_out_file_t structure, with the values to use passed as arguments. Get rid of some structure members that used to be used solely to pass information to "merge_open_outfile()". Add a "cf_merge_files()" routine to do the merging and reporting of errors. svn path=/trunk/; revision=12420
2004-09-29Move the column preferences stuff to epan (the rest of the preferencesGuy Harris1-1/+1
stuff is already there). Update Gerald's e-mail address in column.h. svn path=/trunk/; revision=12131
2004-09-29Move the tap infrastructure to the epan directory.Guy Harris1-1/+1
svn path=/trunk/; revision=12128
2004-09-27Move prefs.c and prefs.h into the epan subdirectory.Guy Harris1-1/+1
svn path=/trunk/; revision=12115
2004-09-11Use _WIN32 rather than WIN32 to determine if we're compiling on Win32;Guy Harris1-1/+1
according to Gisle Vanem, WIN32 isn't a built-in in MSVC, but _WIN32 is. svn path=/trunk/; revision=11972
2004-09-04The packet range stuff knows about capture_file structures, so it'sGuy Harris1-1/+1
really more of an Ethereal/Tethereal component than a libethereal component (nothing else in libethereal knows about capture files); move it back out of libethereal. (The range stuff doesn't; we leave it in libethereal.) svn path=/trunk/; revision=11898
2004-09-04Rename "range.c" and "range.h" to "packet-range.c" and "packet-range.h";Guy Harris1-1/+1
they should ultimately be split into files with routines that handle ranges, which are just subsets of [0,2^32), and packet ranges, which are subsets of the packet list, possibly specified by a range. Move them into epan, so they can be used by, for example, utilities that handle ranges, such editcap. svn path=/trunk/; revision=11890
2004-09-02Move the guts of gtk/file_dlg.c:goto_framenum_cb() toGerald Combs1-0/+21
file.c:goto_framenum(), where all of the other goto_ routines live. svn path=/trunk/; revision=11887
2004-08-25Move the file-reloading code from gtk/file_dlg.c to file.c.Gerald Combs1-0/+49
svn path=/trunk/; revision=11823
2004-08-19As suggested by Guy: Have mark_frame() do nothing if the frame hasGerald Combs1-6/+10
already been marked and have unmark_frame() do likewise. Don't mess with the marked frame count in mark_all_frames(). Be a little more paranoid about the marked frame count in other places. svn path=/trunk/; revision=11775
2004-08-18If you mark all frames, then unmark all frames "marked_count" overflows.Gerald Combs1-2/+4
Keep this from happening. svn path=/trunk/; revision=11771
2004-08-15From Greg Morris: Add a configuration option to control search wrapping.Gerald Combs1-10/+33
svn path=/trunk/; revision=11744
2004-07-27Move the code to open the printer/print file from "print_packets()" toGuy Harris1-48/+21
"print_ok_cb()", and have "print_packets()" just work on a "print_stream_t" handed to it, so that different platforms can open the printer/print file in different ways (opening the file is probably not going to be platform-dependent, but opening the printer will be). svn path=/trunk/; revision=11544
2004-07-25Make some generic print routines that take, as an argument, a pointer toGuy Harris1-30/+78
a structure containing a pointer to print operations for that object and a pointer to the private subclass-dependent data for that object, with subclasses for text and PostScript, and use those rather than the old scheme where a print format was passed as an argument - or where (as in the case of printing summary information in Tethereal) we just printed as text even if "-T ps" was selected. Check whether those routines succeed or get an I/O error writing output. Clean up indentation. svn path=/trunk/; revision=11514
2004-07-24Move the color-filter related stuff out of "color.h" intoGuy Harris1-0/+1
"color_filters.h", as that's the appropriate place for it - "color.h" should just deal with "color_t". svn path=/trunk/; revision=11503
2004-07-18Move dissectors to epan/dissectors directory.Gilbert Ramirez1-1/+1
Also move ncp222.py, x11-fields, process-x11-fields.pl, make-reg-dotc, and make-reg-dotc.py. Adjust #include lines in files that include packet-*.h files. svn path=/trunk/; revision=11410
2004-07-18Set the svn:eol-style property on all text files to "native", so thatGuy Harris1-1/+1
they have LF at the end of the line on UN*X and CR/LF on Windows; hopefully this means that if a CR/LF version is checked in on Windows, the CRs will be stripped so that they show up only when checked out on Windows, not on UN*X. svn path=/trunk/; revision=11400
2004-07-08If we're producing PostScript, don't put the column headers out if we'reGuy Harris1-13/+15
not putting the column data out. Don't fill in the column information if we're not going to use it. svn path=/trunk/; revision=11343
2004-07-08Make the "human-readable text vs. PSML vs. PDML" choice separate fromGuy Harris1-3/+146
the "text vs. PostScript" choice. The "text vs. PostScript" choice should probably ultimately be done with a generic set of print methods, to handle various platform-native print mechanisms more cleanly (and perhaps the dialog box code for "export as {PDML,PSML}" should be separate from the "export as text"/"print" dialog). svn path=/trunk/; revision=11342
2004-07-08A read can return WTAP_ERR_UNSUPPORTED_ENCAP if the encapsulation typeGuy Harris1-3/+10
is per-packet and the packet has an encapsulation type we don't know about, so handle it on reads as well as errors - show an error message noting that we had a packet with a network type we don't know about, and show the extra info returned for that error giving details. It shouldn't return WTAP_ERR_UNSUPPORTED, however, so just give the "wtap_strerror()" error for that case. svn path=/trunk/; revision=11340
2004-06-30On at least some platforms, a #define of O_BINARY is needed even ifGuy Harris1-1/+6
<fcntl.h> is included, as <fcntl.h> doesn't define it. svn path=/trunk/; revision=11276
2004-06-29define of O_BINARY not needed, if fcntl.h is includedUlf Lamping1-5/+1
other #include related cleanups svn path=/trunk/; revision=11272
2004-05-27added a small commentUlf Lamping1-1/+2
svn path=/trunk/; revision=11023
2004-05-09From Lars Roland: add support for building a libethereal.dll with MSVC:Guy Harris1-1/+5
add a config.nmake option to control whether to build libethereal.dll or not; remove "./wiretap" from PATH to prevent problems due to wrongly-loaded files; build dissector.lib with MSVC; move "print.c" and "ps.c" to the dissector helpers, as "print.c" imports variables from packet-frame.c and packet-data.c, which are in libethereal; move "g711.c" out of the dissector helpers, as they're used only by Ethereal in a tap, not in Tethereal or in any dissector; add a .def file for libethereal; arrange to declare global variables exported from libethereal with "__declspec(dllimport)" when building programs that import those variables; update the NSIS installer. Make the "configure" script define ETH_VAR_IMPORT as "extern". svn path=/trunk/; revision=10834
2004-05-02bugfix: reset the tap listeners, when the capture file is closedUlf Lamping1-1/+3
svn path=/trunk/; revision=10769
2004-05-01The display filter engine can return an error message that is not safeOlivier Biot1-4/+9
when using GTK2 code for rendering the error. In order to correctly render the error message, it must be XML escaped. TODO: track down the remaining places where this XML escaping is required, and fix it there too (not sure if they exist though). svn path=/trunk/; revision=10764
2004-05-01add PROTO_ITEM_SET_HIDDEN() and PROTO_ITEM_SET_GENERATED(),Ulf Lamping1-2/+2
this sets flags for later rendering of the field data svn path=/trunk/; revision=10752
2004-04-25put all required data into the print_args,Ulf Lamping1-3/+8
instead of confusing seperation of data svn path=/trunk/; revision=10692
2004-04-24some code cleanup of the printing systemUlf Lamping1-10/+1
svn path=/trunk/; revision=10682