fix win32 build by using wtap_get_num_file_types() instead of direct variable access

svn path=/trunk/; revision=21689
This commit is contained in:
Ulf Lamping 2007-05-05 10:47:35 +00:00
parent 0bea95c152
commit 3c2089e582
4 changed files with 10 additions and 2 deletions

View File

@ -562,6 +562,11 @@ static const struct file_type_info dump_open_table[] = {
gint wtap_num_file_types = sizeof(dump_open_table) / sizeof(struct file_type_info);
int wtap_get_num_file_types(void)
{
return wtap_num_file_types;
}
/* Name that should be somewhat descriptive. */
const char *wtap_file_type_string(int filetype)
{

View File

@ -277,6 +277,8 @@ struct wtap_dumper {
extern size_t wtap_dump_file_write(wtap_dumper *wdh, const void *buf, unsigned bufsize);
extern int wtap_dump_file_ferror(wtap_dumper *wdh);
extern gint wtap_num_file_types;
/* Macros to byte-swap 32-bit and 16-bit quantities. */
#define BSWAP32(x) \
((((x)&0xFF000000)>>24) | \

View File

@ -22,6 +22,7 @@ wtap_file_type_short_string
wtap_file_type_string
wtap_get_bytes_dumped
wtap_get_num_encap_types
wtap_get_num_file_types
wtap_set_bytes_dumped
wtap_open_offline
wtap_pcap_encap_to_wtap_encap

View File

@ -246,8 +246,7 @@ extern "C" {
#define WTAP_FILE_MPEG 46
#define WTAP_FILE_K12TEXT 47
#define WTAP_NUM_FILE_TYPES wtap_num_file_types
extern gint wtap_num_file_types;
#define WTAP_NUM_FILE_TYPES wtap_get_num_file_types()
/* timestamp precision (currently only these values are supported) */
#define WTAP_FILE_TSPREC_SEC 0
@ -737,6 +736,7 @@ gboolean wtap_dump_close(wtap_dumper *, int *);
gint64 wtap_get_bytes_dumped(wtap_dumper *);
void wtap_set_bytes_dumped(wtap_dumper *wdh, gint64 bytes_dumped);
int wtap_get_num_encap_types(void);
int wtap_get_num_file_types(void);
void wtap_register_open_routine(wtap_open_routine_t,gboolean);
int wtap_register_encap_type(char* name, char* short_name);
void wtap_register_file_type(const struct file_type_info*);