Commit Graph

19 Commits

Author SHA1 Message Date
Guy Harris ee5ca25d31 Include files from the "epan" directory and subdirectories thereof with
"epan/..." pathnames, so as to avoid collisions with header files in any
of the directories in which we look (e.g., "proto.h", as some other
package has its own "proto.h" file which it installs in the top-level
include directory).

Don't add "-I" flags to search "epan", as that's no longer necessary
(and we want includes of "epan" headers to fail if the "epan/" is left
out, so that we don't re-introduce includes lacking "epan/").

svn path=/trunk/; revision=4586
2002-01-21 07:37:49 +00:00
Guy Harris 3ecfaeedb5 Don't process a color filter if there's no filter associated with it.
Don't put a color filter into the list of color filters if we can't
allocate the colors for the filter.

Clean up white space.

svn path=/trunk/; revision=4502
2002-01-08 21:35:17 +00:00
Gilbert Ramirez 791f5774d0 Provide for per-protocol-tree data in the proto_tree code.
Put a hash-table of "interesting" fields in the per-proto-tree data.
The dfilter code records which fields/protocols are "interesting" (by which
I mean, their value or existence is checked). Thus, the proto_tree routines
can create special arrays of field_info*'s that are ready for the dfilter
engine to use during a filter operation.

Also store the "proto_tree_is_visible" boolean, renamed "visible", in
the per-proto-tree data.

Move epan_dissect_t to its own header file to make #include dependencies
easier to handle.

Provide epan_dissect_fill_in_columns(), which accepts just the epan_dissect_t*
as an argument.

epan_dissect_new() needs to be followed by epan_dissect_run() for the
dissection to actually take place. Between those two calls,
epan_dissect_prime_dfilter() can be run 0, 1, or multiple times in order to
prime the empty proto_tree with the "intersesting" fields from the dfilter_t.

svn path=/trunk/; revision=4422
2001-12-18 19:09:08 +00:00
Guy Harris cfa1112e79 From John McDermott:
Adds an "Add Expression..." button to the color filter
	creation dialog.

	Improve the look of the "Add color to protocols" window.

	Clean up some ugly code.

Give John credit in the AUTHORS file for the coloring stuff.

svn path=/trunk/; revision=4301
2001-12-02 00:16:02 +00:00
Guy Harris 509f30374e Have a routine that takes a file name for a personal configuration file
and generates the path name; have it, if the file is to be opened for
reading on Win32, check whether it exists and, if not, check for it in
the old home directory-based configuration directory and, if so, return
that path instead, so that files saved with earlier versions of Ethereal
will be seen.

svn path=/trunk/; revision=4072
2001-10-24 07:18:39 +00:00
Guy Harris d453f6d992 On Windows, put Ethereal configuration files under the "Application
Data\Ethereal" directory under the user's profile, as that appears to be
the Windows 2000 standard.

svn path=/trunk/; revision=4071
2001-10-24 06:13:07 +00:00
Guy Harris cf5a1d86e7 Add a new routine to create the ".ethereal" directory for a user.
Use that routine rather than duplicating that code in the routines to
write out the preference file and filter files.

Use it in the code for the color filter dialog, so that the directory in
question is created if necessary.

As that routine returns an error indication, have the code that calls
that routine put up a message box if the attempt fails.

svn path=/trunk/; revision=4065
2001-10-23 05:01:02 +00:00
Guy Harris e4db9c4b64 Add a routine to get the directory in which personal configuration files
reside.  Use it, rather than concatenating the user's home directory and
".ethereal" in a number of files.

Fix up some additional places to use G_DIR_SEPARATOR_S as the pathname
separator.

svn path=/trunk/; revision=4061
2001-10-22 22:59:26 +00:00
Guy Harris a6da6905cf Use G_DIR_SEPARATOR_S rather than "/" as a pathname separator in format
strings used to generate pathnames.

svn path=/trunk/; revision=4057
2001-10-21 21:56:05 +00:00
Guy Harris e980dd9d3b Use G_DIR_SEPARATOR_S rather than "/" as a pathname separator in format
strings used to generate pathnames.

Move the definition of PF_DIR from <epan/epan.h> to <epan/filesystem.h>,
so that files requiring only the definition of PF_DIR don't have to
include <epan/epan.h>, and get rid of no-longer-necessary includes of
<epan/epan.h>.

Add a routine to get the directory for "system files" such as
"/etc/ethers" - it's "/etc" on UNIX, and the datafile directory on
Windows (as there's no "/etc" on Windows).  Use that to construct the
pathname of the ethers and ipxnet files.

svn path=/trunk/; revision=4056
2001-10-21 21:48:00 +00:00
Guy Harris 799672571b Signed vs. unsigned fixes from Joerg Mayer.
svn path=/trunk/; revision=3373
2001-04-24 00:28:21 +00:00
Guy Harris 65dc469326 "get_home_dir()", in "epan/filesystem.c", uses
"find_last_pathname_separator()" on Win32; move the other pathname
manipulation routines from "util.c" into "epan/filesystem.c".

Remove from "util.h" the declarations of routines not defined in
"util.c", and put them into "epan/filesystem.h" if they're not already
there.

Adjust #includes to make the above work.

svn path=/trunk/; revision=3241
2001-04-02 09:53:46 +00:00
Gilbert Ramirez 8f1fff2e6a Create a more modular type system for the FT_* types. Put them
into epan/ftypes.

Re-write display filter routines using Lemon parser instead of yacc.
Besides using a different tool, the new grammar is much simpler, while
the display filter engine itself is more powerful and more easily extended.

Add dftest executable, to test display filter "bytecode" generation.
Add option to "configure" to build dftest or randpkt, both of which are not
built by default.

Implement Ed Warnicke's ideas about dranges in the new display filter and
ftype code.

Remove type FT_TEXT_ONLY in favor of FT_NONE, and have protocols registered
as FT_PROTOCOL. Thus, FT_NONE is used only for simple labels in the proto tree,
while FT_PROTOCOL is used for protocols. This was necessary for being
able to make byte slices (ranges) out of protocols, like "frame[0:3]"

Win32 Makefile.nmake's will be added tonight.

svn path=/trunk/; revision=2967
2001-02-01 20:21:25 +00:00
Gilbert Ramirez 9d9850f209 More EPAN-related code movements. Get rid of usage of #include "globals.h"
and #include "util.h" from epan code. Move get_home_dir() into epan/filesystem.c
as it's used by plugins.c.

svn path=/trunk/; revision=2461
2000-09-28 03:16:29 +00:00
Laurent Deniel 6a480953a9 Miscellaneous code cleaning
- add <stdarg.h> or <varargs.h> in snprintf.h
  and remove those inclusions in the other #ifdef NEED_SNPRINTF_H codes

- remove the check of multiple inclusions in source (.c)  code
  (there is a bit loss of _cpp_ performance, but I prefer the gain of
   code reading and maintenance; and nowadays, disk caches and VM are
   correctly optimized ;-).

- protect all (well almost) header files against multiple inclusions

- add header (i.e. GPL license) in some include files

- reorganize a bit the way header files are included:

  First:
  #include <system_include_files>
  #include <external_package_include_files (e.g. gtk, glib etc.)>
  Then
  #include "ethereal_include_files"

  with the correct HAVE_XXX or NEED_XXX protections.

- add some HAVE_XXX checks before including some system header files

- add the same HAVE_XXX in wiretap as in ethereal

Please forgive me, if I break something (I've only compiled and regression
tested on Linux).

svn path=/trunk/; revision=2254
2000-08-11 13:37:21 +00:00
Guy Harris 024c2d72fe Use ESD_TYPE_CRIT for most errors (the model used by various GUIs seems
to use "warning" dialog boxes only to warn the user "if you do that, bad
things may happen" *and* to offer them the option either to drive on or
quit, so perhaps ESD_TYPE_CRIT should be used for all errors).

However, put "Ethereal: Error" rather than "Ethereal: Critical" in the
title bar, in the hopes that it'll make it clearer that Something Bad
Happened.

If the user specifies that captures should be saved to a user-specified
file rather than a temporary file, report errors trying to create that
file with "file_open_error_message()".

Make the "for_writing" argument to "file_open_error_message()" a
"gboolean", as it's either TRUE (if the file is being opened for
writing) or FALSE (if it's being opened for reading).

Report EISDIR as "XXX is a directory (folder), not a file.".

svn path=/trunk/; revision=2143
2000-07-20 05:10:02 +00:00
Guy Harris 258da28261 Remove some unnecessary includes from "gtk/color_dlg.c" and
"gtk/colors.c", and make "gtk/color_dlg.c" include "gtk/color_dlg.h" to
make sure compilation checks the declaration of the routines with their
definitions.

svn path=/trunk/; revision=1623
2000-02-12 08:42:28 +00:00
Guy Harris 55c8a368b8 Split the color manipulation stuff into "color_dlg.[ch]", containing the
dialog boxes for editing color filtes, and "colors.[ch]", containing the
toolkit-dependent code to manipulate colors.

svn path=/trunk/; revision=1622
2000-02-12 08:31:49 +00:00
Guy Harris c80a7fd1d5 The color stuff is almost completely toolkit-dependent (this isn't just
the color-selection and color-filter-editing GUI stuff; different
toolkits, and different windows systems, have their own notions of color
objects - they may have nothing in common other than the notion that
colors have red, green, and blue values); move it all to the "gtk"
subdirectory for now, and, as we discover stuff stuff that can be made
platform-independent, drag it up to the top-level directory.

svn path=/trunk/; revision=1621
2000-02-12 08:15:31 +00:00