Commit 2809803e authored by Olivier Bertrand's avatar Olivier Bertrand

1) Fix bug on strange sprintf

2) Fix bug on bad sprintf
3) Fix bug on cast from pointer to int

4) Begin implementing the "info" tables.
Already existing were the ODBC sata source table and the
WMI column info table.

A common way to handle them will permit to develop many
other such tables. Implemented:

The ODBC column info table.

Modified:
ha_connect.cc  (4)
odbconn.cpp    (4)
tabodbc.h      (4)
tabodbc.cpp    (4)
tabsys.h       (3)
rcmsg.c        (4)
tabfmt.cpp     (2)
tabtbl.cpp     (1)
resource.h     (4)
mycat.h        (4)
parents 38edf74a 7f08277b
...@@ -39,11 +39,27 @@ add_definitions( -DHUGE_SUPPORT -DZIP_SUPPORT ) ...@@ -39,11 +39,27 @@ add_definitions( -DHUGE_SUPPORT -DZIP_SUPPORT )
# #
IF(UNIX) IF(UNIX)
if(WITH_WARNINGS) if(WITH_WARNINGS)
add_definitions(-Wall -Wfatal-errors -Wextra) add_definitions(-Wall -Wfatal-errors -Wextra -Wmissing-declarations)
message(STATUS "CONNECT: GCC: All warnings enabled") message(STATUS "CONNECT: GCC: All warnings enabled")
else() else()
add_definitions(--no-warnings) add_definitions(-Wall -Wfatal-errors -Wmissing-declarations)
message(STATUS "CONNECT: GCC: All warnings disabled") add_definitions(-Wno-write-strings)
add_definitions(-Wno-unused-variable)
add_definitions(-Wno-unused-but-set-variable)
add_definitions(-Wno-unused-value)
add_definitions(-Wno-unused-function)
add_definitions(-Wno-parentheses)
add_definitions(-Wno-missing-declarations)
add_definitions(-Wno-int-to-pointer-cast)
add_definitions(-Wno-narrowing)
# This switch is for pure C only:
# add_definitions(-Wno-implicit-function-declaration)
# These switches are for C++ only
# add_definitions(-Wno-reorder)
# add_definitions(-Wno-delete-non-virtual-dtor)
message(STATUS "CONNECT: GCC: Some warnings disabled")
endif(WITH_WARNINGS) endif(WITH_WARNINGS)
add_definitions( -DUNIX -DLINUX -DUBUNTU ) add_definitions( -DUNIX -DLINUX -DUBUNTU )
......
/**************** Block H Declares Source Code File (.H) ***************/ /**************** Block H Declares Source Code File (.H) ***************/
/* Name: BLOCK.H Version 2.0 */ /* Name: BLOCK.H Version 2.0 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 1998 */ /* (C) Copyright to the author Olivier BERTRAND 1998 */
/* */ /* */
/* This file contains the BLOCK pure virtual class definition. */ /* This file contains the BLOCK pure virtual class definition. */
/*---------------------------------------------------------------------*/ /*---------------------------------------------------------------------*/
/* Note: one of the main purpose of this base class is to take care */ /* Note: one of the main purpose of this base class is to take care */
/* of the very specific way Plug handles memory allocation. */ /* of the very specific way Plug handles memory allocation. */
/* Instead of allocating small chunks of storage via new or malloc */ /* Instead of allocating small chunks of storage via new or malloc */
/* Plug works in its private memory pool in which it does the sub- */ /* Plug works in its private memory pool in which it does the sub- */
/* allocation using the function PlugSubAlloc. These are never freed */ /* allocation using the function PlugSubAlloc. These are never freed */
/* separately but when a transaction is terminated, the entire pool */ /* separately but when a transaction is terminated, the entire pool */
/* is set to empty, resulting in a very fast and efficient allocate */ /* is set to empty, resulting in a very fast and efficient allocate */
/* process, no garbage collection problem, and an automatic recovery */ /* process, no garbage collection problem, and an automatic recovery */
/* procedure (via LongJump) when the memory is exhausted. */ /* procedure (via LongJump) when the memory is exhausted. */
/* For this to work new must be given two parameters, first the */ /* For this to work new must be given two parameters, first the */
/* global pointer of the Plug application, and an optional pointer to */ /* global pointer of the Plug application, and an optional pointer to */
/* the memory pool to use, defaulting to NULL meaning using the Plug */ /* the memory pool to use, defaulting to NULL meaning using the Plug */
/* standard default memory pool, example: */ /* standard default memory pool, example: */
/* tabp = new(g) XTAB("EMPLOYEE"); */ /* tabp = new(g) XTAB("EMPLOYEE"); */
/* allocates a XTAB class object in the standard Plug memory pool. */ /* allocates a XTAB class object in the standard Plug memory pool. */
/***********************************************************************/ /***********************************************************************/
#if !defined(BLOCK_DEFINED) #if !defined(BLOCK_DEFINED)
#define BLOCK_DEFINED #define BLOCK_DEFINED
#if defined(WIN32) && !defined(NOEX) #if defined(WIN32) && !defined(NOEX)
#define DllExport __declspec( dllexport ) #define DllExport __declspec( dllexport )
#else // !WIN32 #else // !WIN32
#define DllExport #define DllExport
#endif // !WIN32 #endif // !WIN32
/***********************************************************************/ /***********************************************************************/
/* Definition of class BLOCK with its method function new. */ /* Definition of class BLOCK with its method function new. */
/***********************************************************************/ /***********************************************************************/
typedef class BLOCK *PBLOCK; typedef class BLOCK *PBLOCK;
class DllExport BLOCK { class DllExport BLOCK {
public: public:
void * operator new(size_t size, PGLOBAL g, void *p = NULL) { void * operator new(size_t size, PGLOBAL g, void *p = NULL) {
#ifdef DEBTRACE #ifdef DEBTRACE
if (debug != NULL) if (debug != NULL)
htrc("New BLOCK: size=%d g=%p p=%p\n", size, g, p); htrc("New BLOCK: size=%d g=%p p=%p\n", size, g, p);
#endif #endif
return (PlugSubAlloc(g, p, size)); return (PlugSubAlloc(g, p, size));
} // end of new } // end of new
virtual void Print(PGLOBAL, FILE *, uint) {} // Produce file desc virtual void Print(PGLOBAL, FILE *, uint) {} // Produce file desc
virtual void Print(PGLOBAL, char *, uint) {} // Produce string desc virtual void Print(PGLOBAL, char *, uint) {} // Produce string desc
#if !defined(__BORLANDC__) #if !defined(__BORLANDC__)
// Avoid warning C4291 by defining a matching dummy delete operator // Avoid warning C4291 by defining a matching dummy delete operator
void operator delete(void *, PGLOBAL, void *) {} void operator delete(void *, PGLOBAL, void *) {}
#endif #endif
}; // end of class BLOCK }; // end of class BLOCK
#endif // !BLOCK_DEFINED #endif // !BLOCK_DEFINED
This diff is collapsed.
/************** PlgDBSem H Declares Source Code File (.H) **************/ /************** PlgDBSem H Declares Source Code File (.H) **************/
/* Name: CHKLVL.H Version 1.1 */ /* Name: CHKLVL.H Version 1.1 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 2009 */ /* (C) Copyright to the author Olivier BERTRAND 2009 */
/* */ /* */
/* This file contains the definition of the checking level constants. */ /* This file contains the definition of the checking level constants. */
/***********************************************************************/ /***********************************************************************/
#if !defined(_CHKLVL_DEFINED_) #if !defined(_CHKLVL_DEFINED_)
#define _CHKLVL_DEFINED_ #define _CHKLVL_DEFINED_
/***********************************************************************/ /***********************************************************************/
/* Following definitions are used to indicate the level of checking. */ /* Following definitions are used to indicate the level of checking. */
/***********************************************************************/ /***********************************************************************/
enum CHKLVL {CHK_NO = 0x00, /* No checking */ enum CHKLVL {CHK_NO = 0x00, /* No checking */
CHK_TYPE = 0x01, /* Check types for Insert/Update */ CHK_TYPE = 0x01, /* Check types for Insert/Update */
CHK_UPDATE = 0x02, /* Two pass checking of Update */ CHK_UPDATE = 0x02, /* Two pass checking of Update */
CHK_DELETE = 0x04, /* Indexed checking of Delete */ CHK_DELETE = 0x04, /* Indexed checking of Delete */
CHK_JOIN = 0x08, /* Check types joining tables */ CHK_JOIN = 0x08, /* Check types joining tables */
CHK_OPT = 0x10, /* Automatic optimize on changes */ CHK_OPT = 0x10, /* Automatic optimize on changes */
CHK_MANY = 0x20, /* Check many-to-many joins */ CHK_MANY = 0x20, /* Check many-to-many joins */
CHK_ALL = 0x3F, /* All of the above */ CHK_ALL = 0x3F, /* All of the above */
CHK_STD = 0x1E, /* Standard level of checking */ CHK_STD = 0x1E, /* Standard level of checking */
CHK_MAXRES = 0x40, /* Prevent Maxres recalculation */ CHK_MAXRES = 0x40, /* Prevent Maxres recalculation */
CHK_ONLY = 0x100}; /* Just check, no action (NIY) */ CHK_ONLY = 0x100}; /* Just check, no action (NIY) */
/***********************************************************************/ /***********************************************************************/
/* Following definitions are used to indicate the execution mode. */ /* Following definitions are used to indicate the execution mode. */
/***********************************************************************/ /***********************************************************************/
enum XMOD {XMOD_EXECUTE = 0, /* DOS execution mode */ enum XMOD {XMOD_EXECUTE = 0, /* DOS execution mode */
XMOD_PREPARE = 1, /* Prepare mode */ XMOD_PREPARE = 1, /* Prepare mode */
XMOD_TEST = 2, /* Test mode */ XMOD_TEST = 2, /* Test mode */
XMOD_CONVERT = 3}; /* HQL conversion mode */ XMOD_CONVERT = 3}; /* HQL conversion mode */
/***********************************************************************/ /***********************************************************************/
/* Following definitions indicate the use of a temporay file. */ /* Following definitions indicate the use of a temporay file. */
/***********************************************************************/ /***********************************************************************/
enum USETEMP {TMP_AUTO = 0, /* Best choice */ enum USETEMP {TMP_AUTO = 0, /* Best choice */
TMP_NO = 1, /* Never */ TMP_NO = 1, /* Never */
TMP_YES = 2, /* Always */ TMP_YES = 2, /* Always */
TMP_FORCE = 3}; /* Forced for MAP tables */ TMP_FORCE = 3}; /* Forced for MAP tables */
#endif // _CHKLVL_DEFINED_ #endif // _CHKLVL_DEFINED_
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* Copyright (C) Olivier Bertrand 2004 - 2011 /* Copyright (C) Olivier Bertrand 2004 - 2011
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License. the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/**************** Cnt H Declares Source Code File (.H) *****************/ /**************** Cnt H Declares Source Code File (.H) *****************/
/* Name: CONNECT.H Version 2.4 */ /* Name: CONNECT.H Version 2.4 */
/* This file contains the some based classes declares. */ /* This file contains the some based classes declares. */
/***********************************************************************/ /***********************************************************************/
//#include "xtable.h" // Base class declares //#include "xtable.h" // Base class declares
#include "filamtxt.h" #include "filamtxt.h"
#include "tabdos.h" #include "tabdos.h"
//typedef struct _tabdesc *PTABD; // For friend setting //typedef struct _tabdesc *PTABD; // For friend setting
typedef struct _xinfo *PXF; typedef struct _xinfo *PXF;
typedef struct _create_xinfo *PCXF; typedef struct _create_xinfo *PCXF;
typedef class TDBDOX *PTDBDOX; typedef class TDBDOX *PTDBDOX;
/***********************************************************************/ /***********************************************************************/
/* Definition of classes XCOLCRT, XIXDEF, XKPDEF, DOXDEF, TDBDOX */ /* Definition of classes XCOLCRT, XIXDEF, XKPDEF, DOXDEF, TDBDOX */
/* These classes purpose is chiefly to access protected items! */ /* These classes purpose is chiefly to access protected items! */
/***********************************************************************/ /***********************************************************************/
class XCOLCRT: public COLCRT { class XCOLCRT: public COLCRT {
friend class ha_connect; friend class ha_connect;
friend bool CntCreateTable(PGLOBAL, char *, PCXF); friend bool CntCreateTable(PGLOBAL, char *, PCXF);
public: public:
XCOLCRT(PSZ name) : COLCRT(name) {Nulls= -1;} // Constructor XCOLCRT(PSZ name) : COLCRT(name) {Nulls= -1;} // Constructor
bool HasNulls(void) {return (Nulls != 0);} bool HasNulls(void) {return (Nulls != 0);}
private: private:
int Nulls; int Nulls;
}; // end of class XCOLCRT }; // end of class XCOLCRT
class DOXDEF: public DOSDEF { class DOXDEF: public DOSDEF {
//friend class TDBDOX; //friend class TDBDOX;
//friend int MakeIndex(PGLOBAL, PTDB, PIXDEF); //friend int MakeIndex(PGLOBAL, PTDB, PIXDEF);
friend int CntIndexInit(PGLOBAL, PTDB, int); friend int CntIndexInit(PGLOBAL, PTDB, int);
}; // end of class DOXDEF }; // end of class DOXDEF
/***********************************************************************/ /***********************************************************************/
/* This is the DOS/UNIX Access Method base class declaration. */ /* This is the DOS/UNIX Access Method base class declaration. */
/***********************************************************************/ /***********************************************************************/
class TDBDOX: public TDBDOS { class TDBDOX: public TDBDOS {
friend int MakeIndex(PGLOBAL, PTDB, PIXDEF); friend int MakeIndex(PGLOBAL, PTDB, PIXDEF);
friend int CntCloseTable(PGLOBAL, PTDB); friend int CntCloseTable(PGLOBAL, PTDB);
friend int CntIndexInit(PGLOBAL, PTDB, int); friend int CntIndexInit(PGLOBAL, PTDB, int);
friend RCODE CntIndexRead(PGLOBAL, PTDB, OPVAL, const void*, int); friend RCODE CntIndexRead(PGLOBAL, PTDB, OPVAL, const void*, int);
friend RCODE CntDeleteRow(PGLOBAL, PTDB, bool); friend RCODE CntDeleteRow(PGLOBAL, PTDB, bool);
friend int CntIndexRange(PGLOBAL, PTDB, const uchar**, uint*, friend int CntIndexRange(PGLOBAL, PTDB, const uchar**, uint*,
bool*, key_part_map*); bool*, key_part_map*);
friend class ha_connect; friend class ha_connect;
}; // end of class TDBDOX }; // end of class TDBDOX
class XKPDEF: public KPARTDEF { class XKPDEF: public KPARTDEF {
friend class TDBDOX; friend class TDBDOX;
friend class ha_connect; friend class ha_connect;
//friend int CntMakeIndex(PGLOBAL, const char *, PIXDEF); //friend int CntMakeIndex(PGLOBAL, const char *, PIXDEF);
friend int CntIndexInit(PGLOBAL, PTDB, int); friend int CntIndexInit(PGLOBAL, PTDB, int);
public: public:
XKPDEF(const char *name, int n) : KPARTDEF((PSZ)name, n) {HasNulls= false;} XKPDEF(const char *name, int n) : KPARTDEF((PSZ)name, n) {HasNulls= false;}
void SetNulls(bool b) {HasNulls= b;} void SetNulls(bool b) {HasNulls= b;}
protected: protected:
bool HasNulls; /* Can have null values */ bool HasNulls; /* Can have null values */
}; // end of class XKPDEF }; // end of class XKPDEF
RCODE CheckRecord(PGLOBAL g, PTDB tdbp, char *oldbuf, char *newbuf); RCODE CheckRecord(PGLOBAL g, PTDB tdbp, char *oldbuf, char *newbuf);
This diff is collapsed.
/*************** Csort H Declares Source Code File (.H) ****************/ /*************** Csort H Declares Source Code File (.H) ****************/
/* Name: CSORT.H Version 1.2 */ /* Name: CSORT.H Version 1.2 */
/* */ /* */
/* (C) Copyright to the author Olivier BERTRAND 2000-2012 */ /* (C) Copyright to the author Olivier BERTRAND 2000-2012 */
/* */ /* */
/* This file contains the CSORT class declares (not 64-bits ready) */ /* This file contains the CSORT class declares (not 64-bits ready) */
/* */ /* */
/* Note on use of this class: This class is meant to be used as a */ /* Note on use of this class: This class is meant to be used as a */
/* base class by the calling class. This is because the comparison */ /* base class by the calling class. This is because the comparison */
/* routine must belong to both CSORT and the calling class. */ /* routine must belong to both CSORT and the calling class. */
/* This avoids to pass explicitly to it the calling "this" pointer. */ /* This avoids to pass explicitly to it the calling "this" pointer. */
/***********************************************************************/ /***********************************************************************/
#if !defined(CSORT_DEFINED) #if !defined(CSORT_DEFINED)
#define CSORT_DEFINED #define CSORT_DEFINED
#include <math.h> /* Required for log function */ #include <math.h> /* Required for log function */
#undef DOMAIN // Was defined in math.h #undef DOMAIN // Was defined in math.h
/***********************************************************************/ /***********************************************************************/
/* Constant and external definitions. */ /* Constant and external definitions. */
/***********************************************************************/ /***********************************************************************/
#define THRESH 4 /* Threshold for insertion (was 4) */ #define THRESH 4 /* Threshold for insertion (was 4) */
#define MTHRESH 6 /* Threshold for median */ #define MTHRESH 6 /* Threshold for median */
#ifdef DEBTRACE #ifdef DEBTRACE
extern FILE *debug; /* Debug file */ extern FILE *debug; /* Debug file */
#endif #endif
typedef int* const CPINT; typedef int* const CPINT;
/***********************************************************************/ /***********************************************************************/
/* This is the CSORT base class declaration. */ /* This is the CSORT base class declaration. */
/***********************************************************************/ /***********************************************************************/
class DllExport CSORT { class DllExport CSORT {
public: public:
// Constructor // Constructor
CSORT(bool cns, int th = THRESH, int mth = MTHRESH); CSORT(bool cns, int th = THRESH, int mth = MTHRESH);
protected: protected:
// Implementation // Implementation
/*********************************************************************/ /*********************************************************************/
/* qsortx/qstx are NOT conservative but use less storage space. */ /* qsortx/qstx are NOT conservative but use less storage space. */
/* qsortc/qstc ARE conservative but use more storage space. */ /* qsortc/qstc ARE conservative but use more storage space. */
/*********************************************************************/ /*********************************************************************/
int Qsortx(void); /* Index quick/insert sort */ int Qsortx(void); /* Index quick/insert sort */
void Qstx(int *base, int *max); /* Preliminary quick sort */ void Qstx(int *base, int *max); /* Preliminary quick sort */
int Qsortc(void); /* Conservative q/ins sort */ int Qsortc(void); /* Conservative q/ins sort */
void Qstc(int *base, int *max); /* Preliminary quick sort */ void Qstc(int *base, int *max); /* Preliminary quick sort */
void Istc(int *base, int *hi, int *max); /* Insertion sort routine */ void Istc(int *base, int *hi, int *max); /* Insertion sort routine */
public: public:
// Methods // Methods
int Qsort(PGLOBAL g, int n); /* Sort calling routine */ int Qsort(PGLOBAL g, int n); /* Sort calling routine */
//virtual void Print(PGLOBAL g, FILE *f, uint n); //virtual void Print(PGLOBAL g, FILE *f, uint n);
//virtual void Print(PGLOBAL g, char *ps, uint z); //virtual void Print(PGLOBAL g, char *ps, uint z);
#ifdef DEBTRACE #ifdef DEBTRACE
int GetNcmp(void) {return num_comp;} int GetNcmp(void) {return num_comp;}
#endif #endif
protected: protected:
// Overridable // Overridable
virtual int Qcompare(int *, int *) = 0; /* Item compare routine */ virtual int Qcompare(int *, int *) = 0; /* Item compare routine */
#ifdef DEBTRACE #ifdef DEBTRACE
virtual void DebugSort(int ph, int n, int *base, int *mid, int *tmp); virtual void DebugSort(int ph, int n, int *base, int *mid, int *tmp);
#endif #endif
public: public:
// Utility // Utility
static void SetCmpNum(void) static void SetCmpNum(void)
{for (int i = 1; i < 1000; i++) Cpn[i] = Cmpnum(i); Limit = 1000;} {for (int i = 1; i < 1000; i++) Cpn[i] = Cmpnum(i); Limit = 1000;}
protected: protected:
static size_t Cmpnum(int n) static size_t Cmpnum(int n)
#if defined(AIX) #if defined(AIX)
{return (n < Limit) ? Cpn[n] {return (n < Limit) ? Cpn[n]
: (size_t)round(1.0 + (double)n * (log2((double)n) - 1.0));} : (size_t)round(1.0 + (double)n * (log2((double)n) - 1.0));}
#else // !AIX #else // !AIX
{return (n < Limit) ? Cpn[n] {return (n < Limit) ? Cpn[n]
: (size_t)(1.5 + (double)n * (log((double)n)/Lg2 - 1.0));} : (size_t)(1.5 + (double)n * (log((double)n)/Lg2 - 1.0));}
#endif // !AIX #endif // !AIX
// Members // Members
static int Limit; /* Size of precalculated array */ static int Limit; /* Size of precalculated array */
static size_t Cpn[1000]; /* Precalculated cmpnum values */ static size_t Cpn[1000]; /* Precalculated cmpnum values */
static double Lg2; /* Precalculated log(2) value */ static double Lg2; /* Precalculated log(2) value */
PGLOBAL G; PGLOBAL G;
PDBUSER Dup; /* Used for progress info */ PDBUSER Dup; /* Used for progress info */
bool Cons; /* true for conservative sort */ bool Cons; /* true for conservative sort */
int Thresh; /* Threshold for using qsort */ int Thresh; /* Threshold for using qsort */
int Mthresh; /* Threshold for median find */ int Mthresh; /* Threshold for median find */
int Nitem; /* Number of items to sort */ int Nitem; /* Number of items to sort */
MBLOCK Index; /* Index allocation block */ MBLOCK Index; /* Index allocation block */
MBLOCK Offset; /* Offset allocation block */ MBLOCK Offset; /* Offset allocation block */
CPINT &Pex; /* Reference to sort index */ CPINT &Pex; /* Reference to sort index */
CPINT &Pof; /* Reference to offset array */ CPINT &Pof; /* Reference to offset array */
int *Swix; /* Pointer on EQ/GT work area */ int *Swix; /* Pointer on EQ/GT work area */
int Savmax; /* Saved ProgMax value */ int Savmax; /* Saved ProgMax value */
int Savcur; /* Saved ProgCur value */ int Savcur; /* Saved ProgCur value */
LPCSTR Savstep; /* Saved progress step */ LPCSTR Savstep; /* Saved progress step */
#ifdef DEBTRACE #ifdef DEBTRACE
int num_comp; /* Number of quick sort calls */ int num_comp; /* Number of quick sort calls */
#endif #endif
}; // end of class CSORT }; // end of class CSORT
#endif // CSORT_DEFINED #endif // CSORT_DEFINED
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// MACUTIL.H Olivier Bertrand 2008-2012 // MACUTIL.H Olivier Bertrand 2008-2012
// Get Mac Addresses via GetAdaptersInfo // Get Mac Addresses via GetAdaptersInfo
#if defined(WIN32) #if defined(WIN32)
#include <iphlpapi.h> #include <iphlpapi.h>
#else // !WIN32 #else // !WIN32
#error This is WIN32 only #error This is WIN32 only
#endif // !WIN32 #endif // !WIN32
#include "block.h" #include "block.h"
typedef class MACINFO *MACIP; typedef class MACINFO *MACIP;
/***********************************************************************/ /***********************************************************************/
/* This is the class declaration for MACINFO. */ /* This is the class declaration for MACINFO. */
/***********************************************************************/ /***********************************************************************/
class DllExport MACINFO : public BLOCK { class DllExport MACINFO : public BLOCK {
public: public:
// Constructor // Constructor
MACINFO(bool adap, bool fix); MACINFO(bool adap, bool fix);
// Implementation // Implementation
int GetNadap(PGLOBAL g); int GetNadap(PGLOBAL g);
bool GetMacInfo(PGLOBAL g); bool GetMacInfo(PGLOBAL g);
bool GetFixedInfo(PGLOBAL g); bool GetFixedInfo(PGLOBAL g);
void MakeErrorMsg(PGLOBAL g, DWORD drc); void MakeErrorMsg(PGLOBAL g, DWORD drc);
bool NextMac(void); bool NextMac(void);
bool GetOneInfo(PGLOBAL g, int flag, void *v, int lv); bool GetOneInfo(PGLOBAL g, int flag, void *v, int lv);
// Members // Members
FIXED_INFO *Fip; // Points to fixed info structure FIXED_INFO *Fip; // Points to fixed info structure
PIP_ADAPTER_INFO Piaf; // Points on Adapter info array PIP_ADAPTER_INFO Piaf; // Points on Adapter info array
PIP_ADAPTER_INFO Curp; // Points on current Adapt info PIP_ADAPTER_INFO Curp; // Points on current Adapt info
ULONG Buflen; // Buffer length ULONG Buflen; // Buffer length
bool Fix; // true if FixedInfo is needed bool Fix; // true if FixedInfo is needed
bool Adap; // true if Piaf is needed bool Adap; // true if Piaf is needed
int N; // Number of adapters int N; // Number of adapters
}; // end of class MACINFO }; // end of class MACINFO
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment