aboutsummaryrefslogtreecommitdiffstats
path: root/epan/filesystem.c
AgeCommit message (Collapse)AuthorFilesLines
2007-08-24Don't build in init_plugin_dir if HAVE_PLUGINS is not defined, whichRichard van der Hoff1-0/+6
means that we aren't reliant on PLUGIN_DIR having a sensible value. svn path=/trunk/; revision=22616
2007-06-03(Minor) Use _WIN32 (instead of WIN32) like the rest of Wireshark Bill Meier1-1/+1
svn path=/trunk/; revision=22030
2007-05-25No need to call init_plugin_dir() - it gets called, if necessary, byGuy Harris1-1/+1
get_plugin_dir(). Add checks for the success or failure of init_progfile_dir() in dftest. svn path=/trunk/; revision=21942
2007-05-25Have editcap and capinfos loading the wiretap plugins.Luis Ontanon1-1/+2
epan/filesystem.c have get_plugin_dir() calling init_plugin_dir() if necessary epan/epan.c and epan/report_err.c move the report_failure family into the new report_err.c file, have epan_init() calling the initializer epan/plugins.h and epan/proto.c do not have init_plugins() calling the proto_reg functions instead do it in init_proto() gtk/main.c and tshark.c init_plugin_dir() has become suprefluous capinfos.c and editcap.c load the wiretap plugins Makefiles do what's needed to build withe the above changes. svn path=/trunk/; revision=21935
2007-05-21Have init_progfile_dir() also check whetherGuy Harris1-31/+51
WIRESHARK_RUN_FROM_BUILD_DIRECTORY is set and, if so and we weren't run with special privileges, set the running_in_build_directory_flag. Have it do the same if it finds ".libs" in the pathname of the program and we weren't run with special privileges, as that means it was probably run from the libtool wrapper script and presumably thus isn't an installed binary. This means that get_credential_info() has to be called before init_progfile_dir(). Clean up some indentation. svn path=/trunk/; revision=21866
2007-03-26Fix a bunch more warnings. Add -Werror when using --with-warnings-as-errorsStephen Fisher1-1/+1
under gcc to tools/lemon, plugins/mate and epan/ svn path=/trunk/; revision=21204
2007-03-14Include <ctype.h> to define "isspace()".Guy Harris1-3/+4
Clean up indentation. svn path=/trunk/; revision=21028
2007-03-14as requested by "John T. Haller" for PortableApps.com:Ulf Lamping1-21/+80
add new WS command line option -P to be able to change some of the path settings this is experimental, please report bugs svn path=/trunk/; revision=21022
2007-03-02Add a description for errno EINVAL (Invalid Argument) toStephen Fisher1-0/+4
file_open_error_message(). In this context, the error means that an invalid filename was specified. svn path=/trunk/; revision=20958
2007-01-15Update to get_persdatafile_dir() to choose a default directory on the U3 ↵Graeme Lunt1-5/+25
device that Wireshark is being run from. The U3 Deployment Guide recommends a sub-directory of U3_DEVICE_DOCUMENT_PATH, so the u3util creates a "My Captures" sub-directory to use as the personal data file directory. svn path=/trunk/; revision=20441
2007-01-15fix a warningUlf Lamping1-1/+1
svn path=/trunk/; revision=20436
2007-01-15SHGetFolderPath is not available on MSVC 6 without a Platform SDK, use ↵Ulf Lamping1-0/+8
SHGetSpecialFolderPath instead svn path=/trunk/; revision=20435
2007-01-14on my way to fix #301:Ulf Lamping1-0/+31
add a function get_persdatafile_dir() that will return the users personal default data dir Win32:"My Documents" UNIX:"" (for the current dir) svn path=/trunk/; revision=20431
2007-01-12Win32: MSVC > 6 doesn't work well with Unicode filenames!Ulf Lamping1-10/+1
fix this, by providing required functions in the new file file_util.c - it's mostly copied from GLib (g_open alike - that take UTF8 as filename format but don't use msvcrt.dll V6 for this as the glib files do) "link" to these functions in file_util.h: #define eth_open eth_stdio_open revert changes (from SVN 20282) throughout the code related to these file functions which were introduced with the first tries of MSVC 2005 ... Hopefully I've done everything right with the new file_util.c ... svn path=/trunk/; revision=20402
2007-01-03from Laurent Rabret:Ulf Lamping1-1/+1
I posted a patch about 1.5 years ago for the formerly Ethereal to successfully compiled with Visual > 6. I have always successfully used this patched Ethereal/Wireshark compiled with VS 2003 and have just checked when compiled with Visual C++ 2005 Express svn path=/trunk/; revision=20282
2007-01-02Add a WIRESHARK_RUN_FROM_BUILD_DIRECTORY environment variable on UN*X;Guy Harris1-5/+134
if set, and if the program isn't running with additional privileges, it'll treat the directory in which the program is found as the data directory. If, on Windows, the version-number subdirectory of {data directory}\plugins doesn't exist (which is assumed to mean that the program is being run from the build directory), or if, on UN*X, WIRESHARK_RUN_FROM_BUILD_DIRECTORY is set, the plugin directory is the "plugins" subdirectory of the data directory, and all subdirectories of that directory are scanned for plugins, as the "plugins" subdirectory of the build directory contains subdirectories for the plugins; this means that if we're running from the build directory, we'll find the plugins we built in the build tree. When generating the wireshark-filter man page, run tshark with WIRESHARK_RUN_FROM_BUILD_DIRECTORY set, so it uses the plugins from the build to generate the list of filters. svn path=/trunk/; revision=20261
2006-09-22Add missing files from last commit. Fix an #include.Gerald Combs1-2/+2
svn path=/trunk/; revision=19293
2006-09-02Clean up indentation, etc.Guy Harris1-26/+26
svn path=/trunk/; revision=19116
2006-08-26U3 packaging, utility and Wireshark modifications that allows Wireshark to ↵Graeme Lunt1-41/+73
be run from a U3 USB device. For more details see packaging/u3/win32/README.txt svn path=/trunk/; revision=19046
2006-05-31Tethereal/tethereal -> TShark/tshark.Gerald Combs1-1/+1
svn path=/trunk/; revision=18268
2006-05-31libethereal -> libwireshark. idl2eth -> idl2wrs. There are a _lot_ ofGerald Combs1-4/+4
changes here. It compiles OK on OS X, but hasn't been tested anywhere else. svn path=/trunk/; revision=18260
2006-05-28Ethereal->WiresharkAnders Broman1-14/+14
svn path=/trunk/; revision=18234
2006-05-22ethereal->wiresharkRonnie Sahlberg1-1/+1
svn path=/trunk/; revision=18207
2006-05-21name changeRonnie Sahlberg1-3/+3
svn path=/trunk/; revision=18197
2006-05-18As suggested by Jim Prince, pass the right argument to "getcwd()" - theGuy Harris1-1/+1
buffer argument is a mallocated buffer, so sizeof doesn't return its size, it returns the size of the pointer to the buffer. Fixes bug 907. svn path=/trunk/; revision=18186
2006-05-01It's g_strdup_printf(), not g_sprintf_alloc().Guy Harris1-3/+4
Declare "error", and properly terminate a string. svn path=/trunk/; revision=18054
2006-05-01Handle the case where we *can't* determine the pathname in which to findGuy Harris1-44/+101
programs, by reporting it with a dialog box that at least attempts to indicate what the problem is, and by giving up early on running dumpcap. svn path=/trunk/; revision=18051
2006-03-08Include tchar.h only if we're running Windows. Fixup whitespace.Gerald Combs1-9/+7
svn path=/trunk/; revision=17537
2006-03-08Use Unicode for all native Win32 calls. Unicode Windows applicationsGerald Combs1-2/+10
use UTF-16 internally and GTK+ 2.x uses UTF-8, which means we have to do a lots of conversions. Add utf_8to16() and utf_16to8 convenience functions to strutil.c. svn path=/trunk/; revision=17534
2006-02-14Fix the loop that checks $PATH for the binary to actually step from oneGuy Harris1-34/+31
element of the path to the next element. svn path=/trunk/; revision=17298
2006-02-12Add a routine to attempt to get the absolute pathname of the executableGuy Harris1-58/+224
file, strip off the last component to get the pathname of the directory containing the executable file, and save it for future use. On Windows, you can get that from the OS, but, on UN*X, you have to look at argv[0] and derive the absolute path from that (argv[0] is not guaranteed to be an absolute path, or even a path at all). (In addition, if you're running from the build directory, you might have to strip off a ".libs/" added to argv[0] as an artifact of the libtoolizing script.) Use that in the About dialog, and use it to construct the path of dumpcap. Don't put quotes into the path of dumpcap; you don't have to quote strings with spaces in them when handing them to execvp and, in fact, you *mustn't* quote them, as the quotes will be treated as part of the pathname. svn path=/trunk/; revision=17267
2006-02-08Fix up some comments.Guy Harris1-6/+8
svn path=/trunk/; revision=17214
2006-02-08Clean up the comments for files_identical(), and fix up the UNIXGuy Harris1-27/+26
implementation to check whether the stat calls succeed and to check not only that the files have the same inumber but that they also are on the same file system. svn path=/trunk/; revision=17213
2006-02-08Make file_exists() work on macosx (and other unices)Luis Ontanon1-1/+9
svn path=/trunk/; revision=17211
2006-01-12fix #648: Ulf Lamping1-4/+49
Win32 only: reading a pathname from an environment var requires us to read it in as unicode somehow and convert it to utf8. Using _wgetenv should work under all circumstances on NT, using getenv and g_locale_to_utf8 on Windows OT is the best we can do in this case. svn path=/trunk/; revision=17024
2005-11-07Use <wiretap/file_util.h> to include "file_util.h"; otherwise, theGuy Harris1-1/+5
include fails as we don't do -Iwiretap. If we have it, include <sys/stat.h> in epan/filesystem.c - we need it for stat() and the macros and structures it uses. svn path=/trunk/; revision=16410
2005-11-06replace *a lot* of file related calls by their GLib counterparts. This is ↵Ulf Lamping1-21/+14
necessary for the switch to GTK 2.6 (at least on WIN32). to do this, I've added file_util.h to wiretap (would file_compat.h be a better name?), and provide compat_macros like eth_open() instead of open(). While at it, move other file related things there, like #include <io.h>, definition of O_BINARY and alike, so it's all in one place. deleted related things from config.h.win32 As of these massive changes, I'm almost certain that this will break the Unix build. I'll keep an eye on the buildbot so hopefully everything is working again soon. svn path=/trunk/; revision=16403
2005-08-08various code cleanup:Ulf Lamping1-30/+11
-use g_snprintf instead of sprintf and snprintf -use g_strdup_printf where appropriate -remove #include "snprintf.h" (as only g_snprintf should be used) -replace some more alloc/realloc/calloc/free with their glib pendants svn path=/trunk/; revision=15264
2005-07-23More 'char*' -> 'const char*' changes to fix warnings.Jörg Mayer1-5/+5
svn path=/trunk/; revision=15015
2005-04-12another try to fix the unix buildUlf Lamping1-2/+2
svn path=/trunk/; revision=14063
2005-04-12bugfix for unix builds, remove leftover things from function moveUlf Lamping1-3/+0
svn path=/trunk/; revision=14062
2005-04-12add functions file_exists and file_identical to filesystem.c (coming from ↵Ulf Lamping1-0/+81
file.c) svn path=/trunk/; revision=14057
2004-12-31"gtk_entry_get_text()" returns a "const char *" - assign the result toGuy Harris1-6/+6
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-4/+4
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-09-11Use _WIN32 rather than WIN32 to determine if we're compiling on Win32;Guy Harris1-13/+13
according to Gisle Vanem, WIN32 isn't a built-in in MSVC, but _WIN32 is. svn path=/trunk/; revision=11972
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-01-24As with "cf_open_error_message()"/"file_open_error_message()", so withGuy Harris1-2/+46
"cf_write_error_message()"/"file_write_error_message()". Use "file_open_error_message()" instead of "cf_open_error_message()" in some places we missed in the previous checkin. Catch ENOSPC and EDQUOT in "file_open_error_message()". Use "file_open_error_message()" rather than "file_write_error_message()" to report errors when creating the file to which we're saving the "Follow TCP Stream" data. svn path=/trunk/; revision=9823
2004-01-24Add a new "file_open_error_message()" routine in "epan/filesystem.c", toGuy Harris1-1/+40
translate UNIX errno values to a somewhat friendly message format string. Rename "file_open_error_message()" in "file.c" to "cf_open_error_message()", make "cf_open_error_message()" use the new "file_open_error_message()" for UNIX errno values, have "do_capture()" in "capture.c" use "file_open_error_message()" to report errors from "open()", and make "cf_open_error_message()" static as nothing outside "file.c" uses it. Do similar stuff in "tethereal.c". svn path=/trunk/; revision=9821
2003-11-03Use "g_get_tmp_dir()" to get the pathname of the temporary fileGuy Harris1-15/+6
directory. svn path=/trunk/; revision=8872
2003-11-03Make get_tempfile_path() work like get_datafile_path(), which removesGerald Combs1-6/+8
a dependency on PATH_MAX (which apparently isn't defined under Windows). svn path=/trunk/; revision=8862