29.04.2014 - Version 0.4.0_prealpha. PICodeParser, namespace PICodeInfo, new tool "pip_cmg" in dir "code_model_generator". New feature in PIIODevice - "createFromFullPath", all parameters of all I/O devices now works with PIObjects`s properties.

This commit is contained in:
peri4
2014-04-29 11:50:13 +04:00
parent 77abb0bbea
commit 2e5e75c4c4
98 changed files with 2545 additions and 768 deletions

View File

@@ -7,7 +7,7 @@
/*
PIP - Platform Independent Primitives
Global includes
Copyright (C) 2013 Ivan Pelipenko peri4ko@gmail.com
Copyright (C) 2014 Ivan Pelipenko peri4ko@gmail.com
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
@@ -27,7 +27,7 @@
#define PIINCLUDES_H
//! Version of PIP in hex - 0x##(Major)##(Minor)##(Revision)
#define PIP_VERSION 0x000308
#define PIP_VERSION 0x000400
//! Major value of PIP version
#define PIP_VERSION_MAJOR (PIP_VERSION & 0xFF0000) >> 16
@@ -39,7 +39,7 @@
#define PIP_VERSION_REVISION PIP_VERSION & 0xFF
//! Suffix of PIP version
#define PIP_VERSION_SUFFIX "_beta"
#define PIP_VERSION_SUFFIX "_prealpha"
#ifdef DOXYGEN
@@ -84,8 +84,13 @@
#endif
#if defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64) || defined(__WIN32__) || defined(__WIN64__)
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
# define WINDOWS
# define ARCH_BITS_32
#endif
#if defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
# define WINDOWS
# define ARCH_BITS_64
#endif
#if defined(__QNX__) || defined(__QNXNTO__)
# define QNX
@@ -112,6 +117,15 @@
# endif
# endif
#endif
#ifndef WINDOWS
# if defined(__LP64__) || defined(_LP64_) || defined(LP64)
# define ARCH_BITS_64
# else
# define ARCH_BITS_32
# endif
#endif
#ifdef __GNUC__
# define CC_GCC
# define CC_GCC_VERSION ((__GNUC__ << 8) | __GNUC_MINOR__)
@@ -128,8 +142,10 @@
# pragma GCC diagnostic ignored "-Wextra"
# pragma GCC diagnostic ignored "-Wliteral-suffix"
# endif
# define DEPRECATED __attribute__((deprecated))
#elif defined(_MSC_VER)
# define CC_VC
# pragma warning(disable: 4018)
# pragma warning(disable: 4061)
# pragma warning(disable: 4100)
# pragma warning(disable: 4239)
@@ -144,15 +160,15 @@
# pragma warning(disable: 4820)
# pragma warning(disable: 4986)
# pragma warning(disable: 4996)
# define DEPRECATED
# ifdef ARCH_BITS_32
typedef long ssize_t;
# else
typedef long long ssize_t;
# endif
#else
# define CC_OTHER
#endif
#ifdef PIP_DEBUG
# undef NDEBUG
#else
# ifndef NDEBUG
# define NDEBUG
# endif
# define DEPRECATED
#endif
#ifdef WINDOWS
@@ -164,7 +180,7 @@
#endif
#include "pip_export.h"
#if defined(DOXYGEN) || defined(CC_GCC)
#if defined(DOXYGEN) || defined(CC_GCC) || defined(PICODE)
# undef PIP_EXPORT
# define PIP_EXPORT
#endif
@@ -190,6 +206,7 @@
#include <ctime>
#include <csignal>
#include <cassert>
#include <cmath>
//#include <signal.h>
#include <typeinfo>
#include <algorithm>
@@ -236,7 +253,7 @@
# endif
#endif
#ifdef ANDROID
# include "ifaddrs_3rd.h"
//# include "ifaddrs_3rd.h"
# define tcdrain(fd) ioctl(fd, TCSBRK, 1)
inline int wctomb(char * c, wchar_t w) {*c = ((char * )&w)[0]; return 1;}
inline int mbtowc(wchar_t * w, const char * c, size_t) {*w = ((wchar_t * )&c)[0]; return 1;}
@@ -259,6 +276,13 @@
#ifdef FREE_BSD
extern char ** environ;
#endif
#if defined(DOXYGEN) || defined(PICODE)
# undef PIP_EXPORT
# define PIP_EXPORT
# undef DEPRECATED
# define DEPRECATED
#endif
#include "pimonitor.h"
extern PIMonitor piMonitor;
@@ -294,12 +318,9 @@ using std::map;
using std::multimap;
using std::string;
#ifndef QNX
using std::wstring;
//# ifndef WINDOWS
//static locale_t currentLocale_t = 0;
//# endif
using std::wstring;
#else
typedef std::basic_string<wchar_t> wstring;
typedef std::basic_string<wchar_t> wstring;
#endif
/*! \brief Templated function for swap two values
@@ -458,8 +479,8 @@ template<typename T> inline T piLetobe(const T & v) {T tv(v); piLetobe(&tv, size
template<> inline ushort piLetobe(const ushort & v) {return (v << 8) | (v >> 8);}
template<> inline uint piLetobe(const uint & v) {return (v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | ((v << 24) & 0xFF000000);}
__attribute__((deprecated)) inline ushort letobe_s(const ushort & v) {return (v << 8) | (v >> 8);}
__attribute__((deprecated)) inline uint letobe_i(const uint & v) {return (v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | ((v << 24) & 0xFF000000);}
DEPRECATED inline ushort letobe_s(const ushort & v) {return (v << 8) | (v >> 8);}
DEPRECATED inline uint letobe_i(const uint & v) {return (v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF0000) | ((v << 24) & 0xFF000000);}
#ifdef DOXYGEN
@@ -721,7 +742,7 @@ private:
#else
# define piCout if (piDebug) PICout()
# define piCoutObj if (piDebug && debug_) PICout() << "" << (PIString("[") + className() + " \"" + name() + "\"]")
# define piCoutObj if (piDebug && debug()) PICout() << "" << (PIString("[") + className() + " \"" + name() + "\"]")
#endif
class PIObject;
@@ -787,7 +808,7 @@ namespace PICoutManipulators {
BackMagenta /*! Magenta background */ = 0x800000,
BackCyan /*! Cyan background */ = 0x1000000,
BackWhite /*! White background */ = 0x2000000,
Default /*! Default format */ = 0x4000000,
Default /*! Default format */ = 0x4000000
};
};