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