Merge branch 'gles20' of github.com:cocos2d/cocos2d-x into gles20

This commit is contained in:
Ed Bartley 2012-11-02 20:45:46 -04:00
commit 079ab91ca5
341 changed files with 13410 additions and 4313 deletions

24
AUTHORS
View File

@ -12,6 +12,9 @@ Developers:
Rolando Abarca
Javascript Binding and testjs
sburavtsov
fix for correct unscheduling and instance destruction of extensions/network/HttpClient.cpp
wenbin wang
add korean language support
fix getDeviceModel bug in android CocosDenshion
@ -28,6 +31,7 @@ Developers:
edbartley
update MSVS and MAC projects to use project-relative path
CCControl* should not respond to touches if the control is not visible
Weeds
use fontconfig to enhance font rendering on linux
@ -51,14 +55,20 @@ Developers:
Nicolas Gramlich (nicolasgramlich, Zynga)
fixed CCDirector to use CCLabelBMFont instead of CCLabelTTF
added CCBReader (CCBI format)
added CCBReader (CCBI format)
Rohan Kuruvilla (rohankuruvilla, Zynga)
Improvements to JS Bindings.
Jianfeng Zhou (NetGragon Inc)
contributes CCListView and CCTextureWatcher.
dducharme
author of blackberry port
ImperialPenguin
Added TTF support for blackberry port.
HuaXu Cai (Kongzhong Corporation)
author of linux port
@ -74,7 +84,7 @@ Developers:
Eli Yukelzon (reflog)
add a helper method to draw filled polygons
improvements to CCUserDefaults
improvements to CCUserDefaults
ZhuoShi Shun
contribute the lua binding of CocosDenshion
@ -126,6 +136,12 @@ Developers:
Dongyang Cai(John-cdy)
add automatically test tools
Sergey Vikhirev(BorMor)
Remove retina specific methods and logic.
johnangel
OpenGL framebuffer access violation fix.
Retired Core Developers:
WenSheng Yang
Author of windows port, CCTextField,

View File

@ -1,3 +1,42 @@
cocos2d-2.0-x-2.0.4 @Nov.2 2012
[all platforms]
Bug #1473: fix a bug that CCScale9Sprite does not support rotated spriteframe in atlas
Bug #1494: fix a bug that missing removing auto-release object from AutoReleasePool if it invokes 'autorelease' method more than one time
Bug #1495: fix a bug that CCScrollView display area and touch area are wrong if its parent's postion isn't at CCPointZero in world
Bug #1508: fix a bug that potential observer array modification while it's traversed in CCNotificationCenter
Bug #1510: fix a bug that application will freeze when 'numberOfCellsInTableView' returns zero
Bug #1516: fix a bug that the font size of labels for displaying FPS,SPF,DrawCount is incorrect in different design resolutions
Bug #1536: CCControl* should not respond to touches if the control is not visible
Bug #1538: fix a logic error in CCControlHuePicker::checkSliderPosition()
Bug #1543: fix a bug that CCLayerGradient background of CocosBuilderTest can't be shown
Feature #1515: add a zoom function for debugging large resolution (e.g.new ipad) app on desktop
Refactor #1312: upgrade libcurl to 7.26.0
Refactor #1486: apply multi-resolution mechanic on iOS, especially for iphone5
Refactor #1520: add comments to describe the usage of multiresolution in HelloCpp
Refactor #1521: use relative coordinates in TestCpp
Document #1532: write a document describes how to debug games for ipad3 on low-resolution PC
Document #1493: add doxygen comments in CCNotificationCenter.h
[android]
Bug #1466: reload shader for test case "ShaderTest" after it comes from background
Bug #1500: fix a bug that CCRenderTexture cannot render properly on some Qualcomm Adreno GPUs
Bug #1507: fix a bug that can not play effect for the first time without pre-load effect
[iOS]
Bug #1527: fix a bug that MoonWarriors can not run on iOS simulator sometimes
Refactor #1491: remove dependency of FontLabel lib
[javascript binding]
Bug #1526: fix a bug that javascript binding related samples will crash on iOS devices
Feature #1469: add MoonWarriors as a sample game
Refactor #1487: use shared javascript test cases with cocos2d-html5 and cocos2d-iphone
Refactor #1517: upgrade SpiderMonkey to FF 17.0 beta3
[lua binding]
Bug #1506: fix a compilation error of TestLua if the path of cocos2d-x contains spaces
[win32]
Bug #1496: fix an error of comparing font's face name in CCImage of win32 port
Bug #1511: fix openGL framebuffer access violation
Bug #1540: fix win32 CCLuaLog memory leaks and invalid console UTF8 output
Feature #1513: add Multi-Touch support for win7/8 tablet or ultrabook
Refactor #1512: change writable directory to "C:\Documents and Settings\username\Local Settings\Application Data\your app name" if the app be built in release mode
cocos2d-2.0-x-2.0.3 @Sep.26 2012
[all platforms]
Bug #1452: change CCRGBAProtocol to public in order for actions like CCTintTo to have an affect on the CCScale9Sprite

View File

@ -131,7 +131,7 @@ bool CCDirector::init(void)
// purge ?
m_bPurgeDirecotorInNextLoop = false;
m_obWinSizeInPixels = m_obWinSizeInPoints = CCSizeZero;
m_obWinSizeInPoints = CCSizeZero;
m_pobOpenGLView = NULL;
@ -301,8 +301,7 @@ void CCDirector::setOpenGLView(CCEGLView *pobOpenGLView)
m_pobOpenGLView = pobOpenGLView;
// set size
m_obWinSizeInPoints = m_pobOpenGLView->getSize();
m_obWinSizeInPixels = CCSizeMake(m_obWinSizeInPoints.width * m_fContentScaleFactor, m_obWinSizeInPoints.height * m_fContentScaleFactor);
m_obWinSizeInPoints = m_pobOpenGLView->getDesignResolutionSize();
createStatsLabel();
@ -454,7 +453,7 @@ CCSize CCDirector::getWinSize(void)
CCSize CCDirector::getWinSizeInPixels()
{
return m_obWinSizeInPixels;
return CCSizeMake(m_obWinSizeInPoints.width * m_fContentScaleFactor, m_obWinSizeInPoints.height * m_fContentScaleFactor);
}
CCSize CCDirector::getVisibleSize()
@ -481,20 +480,6 @@ CCPoint CCDirector::getVisibleOrigin()
}
}
void CCDirector::reshapeProjection(const CCSize& newWindowSize)
{
CC_UNUSED_PARAM(newWindowSize);
if (m_pobOpenGLView)
{
m_obWinSizeInPoints = m_pobOpenGLView->getSize();
m_obWinSizeInPixels = CCSizeMake(m_obWinSizeInPoints.width * m_fContentScaleFactor,
m_obWinSizeInPoints.height * m_fContentScaleFactor);
setProjection(m_eProjection);
}
}
// scene management
void CCDirector::runWithScene(CCScene *pScene)
@ -775,7 +760,16 @@ void CCDirector::createStatsLabel()
m_pDrawsLabel = new CCLabelAtlas();
m_pDrawsLabel->initWithString("000", "fps_images.png", 12, 32, '.');
*/
int fontSize = (int)(m_obWinSizeInPoints.height / 320.0f * 24);
int fontSize = 0;
if (m_obWinSizeInPoints.width > m_obWinSizeInPoints.height)
{
fontSize = (int)(m_obWinSizeInPoints.height / 320.0f * 24);
}
else
{
fontSize = (int)(m_obWinSizeInPoints.width / 320.0f * 24);
}
m_pFPSLabel = CCLabelTTF::create("00.0", "Arial", fontSize);
m_pFPSLabel->retain();
m_pSPFLabel = CCLabelTTF::create("0.000", "Arial", fontSize);
@ -809,6 +803,7 @@ void CCDirector::setContentScaleFactor(float scaleFactor)
if (scaleFactor != m_fContentScaleFactor)
{
m_fContentScaleFactor = scaleFactor;
createStatsLabel();
}
}

View File

@ -180,9 +180,6 @@ public:
*/
CCPoint getVisibleOrigin();
/** changes the projection size */
void reshapeProjection(const CCSize& newWindowSize);
/** converts a UIKit coordinate to an OpenGL coordinate
Useful to convert (multi) touches coordinates to the current layout (portrait or landscape)
*/
@ -389,9 +386,6 @@ protected:
/* window size in points */
CCSize m_obWinSizeInPoints;
/* window size in pixels */
CCSize m_obWinSizeInPixels;
/* content scale factor */
float m_fContentScaleFactor;

View File

@ -738,6 +738,11 @@ CCEaseElastic* CCEaseElastic::actionWithAction(CCActionInterval *pAction, float
return CCEaseElastic::create(pAction, fPeriod);
}
CCEaseElastic* CCEaseElastic::create(CCActionInterval *pAction)
{
return CCEaseElastic::create(pAction, 0.3f);
}
CCEaseElastic* CCEaseElastic::create(CCActionInterval *pAction, float fPeriod/* = 0.3f*/)
{
CCEaseElastic *pRet = new CCEaseElastic();
@ -803,6 +808,11 @@ CCEaseElasticIn* CCEaseElasticIn::actionWithAction(CCActionInterval *pAction, fl
return CCEaseElasticIn::create(pAction, fPeriod);
}
CCEaseElasticIn* CCEaseElasticIn::create(CCActionInterval *pAction)
{
return CCEaseElasticIn::create(pAction, 0.3f);
}
CCEaseElasticIn* CCEaseElasticIn::create(CCActionInterval *pAction, float fPeriod/* = 0.3f*/)
{
CCEaseElasticIn *pRet = new CCEaseElasticIn();
@ -873,6 +883,11 @@ CCEaseElasticOut* CCEaseElasticOut::actionWithAction(CCActionInterval *pAction,
return CCEaseElasticOut::create(pAction, fPeriod);
}
CCEaseElasticOut* CCEaseElasticOut::create(CCActionInterval *pAction)
{
return CCEaseElasticOut::create(pAction, 0.3f);
}
CCEaseElasticOut* CCEaseElasticOut::create(CCActionInterval *pAction, float fPeriod/* = 0.3f*/)
{
CCEaseElasticOut *pRet = new CCEaseElasticOut();
@ -942,6 +957,11 @@ CCEaseElasticInOut* CCEaseElasticInOut::actionWithAction(CCActionInterval *pActi
return CCEaseElasticInOut::create(pAction, fPeriod);
}
CCEaseElasticInOut* CCEaseElasticInOut::create(CCActionInterval *pAction)
{
return CCEaseElasticInOut::create(pAction, 0.3f);
}
CCEaseElasticInOut* CCEaseElasticInOut::create(CCActionInterval *pAction, float fPeriod/* = 0.3f*/)
{
CCEaseElasticInOut *pRet = new CCEaseElasticInOut();

View File

@ -311,9 +311,7 @@ public:
CC_DEPRECATED_ATTRIBUTE static CCEaseElastic* actionWithAction(CCActionInterval *pAction, float fPeriod = 0.3f);
/** Creates the action with the inner action and the period in radians (default is 0.3) */
static CCEaseElastic* create(CCActionInterval *pAction, float fPeriod);
static CCEaseElastic* create(CCActionInterval *pAction) {
return CCEaseElastic::create(pAction, 0.3f);
}
static CCEaseElastic* create(CCActionInterval *pAction);
protected:
float m_fPeriod;
};
@ -338,9 +336,7 @@ public:
CC_DEPRECATED_ATTRIBUTE static CCEaseElasticIn* actionWithAction(CCActionInterval *pAction, float fPeriod = 0.3f);
/** Creates the action with the inner action and the period in radians (default is 0.3) */
static CCEaseElasticIn* create(CCActionInterval *pAction, float fPeriod);
static CCEaseElasticIn* create(CCActionInterval *pAction) {
return CCEaseElasticIn::create(pAction, 0.3f);
}
static CCEaseElasticIn* create(CCActionInterval *pAction);
};
/**
@ -364,9 +360,7 @@ public:
/** Creates the action with the inner action and the period in radians (default is 0.3) */
static CCEaseElasticOut* create(CCActionInterval *pAction, float fPeriod);
static CCEaseElasticOut* create(CCActionInterval *pAction) {
return CCEaseElasticOut::create(pAction, 0.3f);
}
static CCEaseElasticOut* create(CCActionInterval *pAction);
};
/**
@ -390,9 +384,7 @@ public:
/** Creates the action with the inner action and the period in radians (default is 0.3) */
static CCEaseElasticInOut* create(CCActionInterval *pAction, float fPeriod);
static CCEaseElasticInOut* create(CCActionInterval *pAction) {
return CCEaseElasticInOut::create(pAction, 0.3f);
}
static CCEaseElasticInOut* create(CCActionInterval *pAction);
};
/**

View File

@ -456,8 +456,13 @@ void CCNode::cleanup()
{
// actions
this->stopAllActions();
this->unscheduleAllSelectors();
this->unscheduleAllSelectors();
if ( m_eScriptType != kScriptTypeNone)
{
CCScriptEngineManager::sharedManager()->getScriptEngine()->executeNodeEvent(this, kCCNodeOnCleanup);
}
// timers
arrayMakeObjectsPerformSelector(m_pChildren, cleanup, CCNode*);
}
@ -838,6 +843,8 @@ void CCNode::onExit()
}
arrayMakeObjectsPerformSelector(m_pChildren, onExit, CCNode*);
}
void CCNode::registerScriptHandler(int nHandler)
@ -1117,5 +1124,12 @@ CCPoint CCNode::convertTouchToNodeSpaceAR(CCTouch *touch)
return this->convertToNodeSpaceAR(point);
}
// MARMALADE ADDED
void CCNode::updateTransform()
{
// Recursively iterate over children
arrayMakeObjectsPerformSelector(m_pChildren, updateTransform, CCNode*);
}
NS_CC_END

View File

@ -62,7 +62,8 @@ enum {
kCCNodeOnEnter,
kCCNodeOnExit,
kCCNodeOnEnterTransitionDidFinish,
kCCNodeOnExitTransitionDidStart
kCCNodeOnExitTransitionDidStart,
kCCNodeOnCleanup
};
/** @brief CCNode is the main element. Anything that gets drawn or contains things that get drawn is a CCNode.
@ -440,6 +441,9 @@ public:
virtual void visit(void);
// transformations
// MARMALADE ADDED THIS... SO IT IS NO LONGER SPECIFIC TO CCSprite
/** updates the quad according the the rotation, position, scale values. */
virtual void updateTransform(void);
/** performs OpenGL view-matrix transformation based on position, scale, rotation and other attributes. */
void transform(void);

View File

@ -30,7 +30,7 @@ NS_CC_BEGIN
const char* cocos2dVersion()
{
return "cocos2d-2.0-x-2.0.3";
return "cocos2d-2.0-x-2.0.4";
}
NS_CC_END

View File

@ -736,6 +736,21 @@ CCLabelBMFont * CCLabelBMFont::create()
return NULL;
}
CCLabelBMFont * CCLabelBMFont::create(const char *str, const char *fntFile, float width, CCTextAlignment alignment)
{
return CCLabelBMFont::create(str, fntFile, width, alignment, CCPointZero);
}
CCLabelBMFont * CCLabelBMFont::create(const char *str, const char *fntFile, float width)
{
return CCLabelBMFont::create(str, fntFile, width, kCCTextAlignmentLeft, CCPointZero);
}
CCLabelBMFont * CCLabelBMFont::create(const char *str, const char *fntFile)
{
return CCLabelBMFont::create(str, fntFile, kCCLabelAutomaticWidth, kCCTextAlignmentLeft, CCPointZero);
}
CCLabelBMFont *CCLabelBMFont::labelWithString(const char *str, const char *fntFile, float width/* = kCCLabelAutomaticWidth*/, CCTextAlignment alignment/* = kCCTextAlignmentLeft*/, CCPoint imageOffset/* = CCPointZero*/)
{
return CCLabelBMFont::create(str, fntFile, width, alignment, imageOffset);

View File

@ -209,17 +209,11 @@ public:
/** creates a bitmap font atlas with an initial string and the FNT file */
static CCLabelBMFont * create(const char *str, const char *fntFile, float width, CCTextAlignment alignment, CCPoint imageOffset);
static CCLabelBMFont * create(const char *str, const char *fntFile, float width, CCTextAlignment alignment) {
return CCLabelBMFont::create(str, fntFile, width, alignment, CCPointZero);
}
static CCLabelBMFont * create(const char *str, const char *fntFile, float width, CCTextAlignment alignment);
static CCLabelBMFont * create(const char *str, const char *fntFile, float width) {
return CCLabelBMFont::create(str, fntFile, width, kCCTextAlignmentLeft, CCPointZero);
}
static CCLabelBMFont * create(const char *str, const char *fntFile, float width);
static CCLabelBMFont * create(const char *str, const char *fntFile) {
return CCLabelBMFont::create(str, fntFile, kCCLabelAutomaticWidth, kCCTextAlignmentLeft, CCPointZero);
}
static CCLabelBMFont * create(const char *str, const char *fntFile);
/** Creates an label.
@deprecated: This interface will be deprecated sooner or later.

View File

@ -50,6 +50,8 @@ CCLayer::CCLayer()
{
setAnchorPoint(ccp(0.5f, 0.5f));
m_bIgnoreAnchorPointForPosition = true;
m_bTouchMode = kCCTouchesAllAtOnce;
m_bTouchPriority = 0;
}
CCLayer::~CCLayer()
@ -61,7 +63,7 @@ bool CCLayer::init()
{
bool bRet = false;
do
{
{
CCDirector * pDirector;
CC_BREAK_IF(!(pDirector = CCDirector::sharedDirector()));
this->setContentSize(pDirector->getWinSize());
@ -99,24 +101,30 @@ void CCLayer::registerWithTouchDispatcher()
{
CCTouchDispatcher* pDispatcher = CCDirector::sharedDirector()->getTouchDispatcher();
// Using LuaBindings
if (m_pScriptHandlerEntry)
{
if (m_pScriptHandlerEntry->isMultiTouches())
{
pDispatcher->addStandardDelegate(this, 0);
LUALOG("[LUA] Add multi-touches event handler: %d", m_pScriptHandlerEntry->getHandler());
}
else
{
pDispatcher->addTargetedDelegate(this,
m_pScriptHandlerEntry->getPriority(),
m_pScriptHandlerEntry->getSwallowsTouches());
LUALOG("[LUA] Add touch event handler: %d", m_pScriptHandlerEntry->getHandler());
}
return;
if (m_pScriptHandlerEntry->isMultiTouches())
{
pDispatcher->addStandardDelegate(this, 0);
LUALOG("[LUA] Add multi-touches event handler: %d", m_pScriptHandlerEntry->getHandler());
}
else
{
pDispatcher->addTargetedDelegate(this,
m_pScriptHandlerEntry->getPriority(),
m_pScriptHandlerEntry->getSwallowsTouches());
LUALOG("[LUA] Add touch event handler: %d", m_pScriptHandlerEntry->getHandler());
}
}
else
{
if( m_bTouchMode == kCCTouchesAllAtOnce ) {
pDispatcher->addStandardDelegate(this, 0);
} else {
pDispatcher->addTargetedDelegate(this, m_bTouchPriority, true);
}
}
pDispatcher->addStandardDelegate(this, 0);
}
void CCLayer::registerScriptTouchHandler(int nHandler, bool bIsMultiTouches, int nPriority, bool bSwallowsTouches)
@ -167,6 +175,40 @@ void CCLayer::setTouchEnabled(bool enabled)
}
}
void CCLayer::setTouchMode(ccTouchesMode mode) {
if(m_bTouchMode != mode) {
m_bTouchMode = mode;
if( m_bIsTouchEnabled) {
setTouchEnabled(false);
setTouchEnabled(true);
}
}
}
void CCLayer::setTouchPriority(int priority) {
if(m_bTouchPriority != priority) {
m_bTouchPriority = priority;
if( m_bIsTouchEnabled) {
setTouchEnabled(false);
setTouchEnabled(true);
}
}
}
int CCLayer::getTouchPriority() {
return m_bTouchPriority;
}
int CCLayer::getTouchMode() {
return m_bTouchMode;
}
/// isAccelerometerEnabled getter
bool CCLayer::isAccelerometerEnabled()
{
@ -194,6 +236,30 @@ void CCLayer::setAccelerometerEnabled(bool enabled)
}
}
void CCLayer::setAccelerometerInterval(double interval) {
if (m_bIsAccelerometerEnabled)
{
if (m_bIsRunning)
{
CCDirector* pDirector = CCDirector::sharedDirector();
// pDirector->getAccelerometer()->setAccelerometerInterval(interval);
}
}
}
void CCLayer::didAccelerate(CCAcceleration* pAccelerationValue) {
CC_UNUSED_PARAM(pAccelerationValue);
//
// if ( m_eScriptType != kScriptTypeNone)
// {
// CCScriptEngineManager::sharedManager()->getScriptEngine()->executeAccelerometerEvent(this, pAccelerationValue);
// }
}
/// isKeypadEnabled getter
bool CCLayer::isKeypadEnabled()
{
@ -434,6 +500,25 @@ void CCLayerColor::setBlendFunc(ccBlendFunc var)
m_tBlendFunc = var;
}
CCLayerColor* CCLayerColor::node()
{
return CCLayerColor::create();
}
CCLayerColor* CCLayerColor::create()
{
CCLayerColor* pRet = new CCLayerColor();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
CCLayerColor * CCLayerColor::layerWithColor(const ccColor4B& color, GLfloat width, GLfloat height)
{
return CCLayerColor::create(color,width,height);
@ -601,6 +686,30 @@ CCLayerGradient* CCLayerGradient::create(const ccColor4B& start, const ccColor4B
return NULL;
}
CCLayerGradient* CCLayerGradient::node()
{
return CCLayerGradient::create();
}
CCLayerGradient* CCLayerGradient::create()
{
CCLayerGradient* pRet = new CCLayerGradient();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
bool CCLayerGradient::init()
{
return initWithColor(ccc4(0, 0, 0, 255), ccc4(0, 0, 0, 255));
}
bool CCLayerGradient::initWithColor(const ccColor4B& start, const ccColor4B& end)
{
return initWithColor(start, end, ccp(0, -1));
@ -798,6 +907,26 @@ CCLayerMultiplex * CCLayerMultiplex::createWithLayer(CCLayer* layer)
return CCLayerMultiplex::create(layer, NULL);
}
CCLayerMultiplex* CCLayerMultiplex::node()
{
return CCLayerMultiplex::create();
}
CCLayerMultiplex* CCLayerMultiplex::create()
{
CCLayerMultiplex* pRet = new CCLayerMultiplex();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
void CCLayerMultiplex::addLayer(CCLayer* layer)
{
CCAssert(m_pLayers, "");

View File

@ -36,6 +36,12 @@ THE SOFTWARE.
NS_CC_BEGIN
typedef enum {
kCCTouchesAllAtOnce,
kCCTouchesOneByOne,
} ccTouchesMode;
/**
* @addtogroup layer
* @{
@ -80,7 +86,7 @@ public:
virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent);
virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent);
virtual void didAccelerate(CCAcceleration* pAccelerationValue) {CC_UNUSED_PARAM(pAccelerationValue);}
virtual void didAccelerate(CCAcceleration* pAccelerationValue);
/** If isTouchEnabled, this method is called onEnter. Override it to change the
way CCLayer receives touch events.
@ -106,12 +112,21 @@ public:
*/
bool isTouchEnabled();
void setTouchEnabled(bool value);
void setTouchMode(ccTouchesMode mode);
void setTouchPriority(int priority);
int getTouchPriority();
int getTouchMode();
/** whether or not it will receive Accelerometer events
You can enable / disable accelerometer events with this property.
@since v0.8.1
*/
bool isAccelerometerEnabled();
void setAccelerometerEnabled(bool value);
void setAccelerometerInterval(double interval);
/** whether or not it will receive keypad events
You can enable / disable accelerometer events with this property.
it's new in cocos2d-x
@ -128,6 +143,10 @@ protected:
private:
// Script touch events handler
CCTouchScriptHandlerEntry* m_pScriptHandlerEntry;
int m_bTouchPriority;
ccTouchesMode m_bTouchMode;
int excuteScriptTouchHandler(int nEventType, CCTouch *pTouch);
int excuteScriptTouchHandler(int nEventType, CCSet *pTouches);
};
@ -163,6 +182,11 @@ public:
*/
CC_DEPRECATED_ATTRIBUTE static CCLayerColor * layerWithColor(const ccColor4B& color);
//@deprecated: This interface will be deprecated sooner or later.
static CCLayerColor* node();
static CCLayerColor* create();
/** creates a CCLayer with color, width and height in Points */
static CCLayerColor * create(const ccColor4B& color, GLfloat width, GLfloat height);
/** creates a CCLayer with color. Width and height are the window size. */
@ -192,9 +216,8 @@ public:
virtual void setOpacityModifyRGB(bool bValue) {CC_UNUSED_PARAM(bValue);}
virtual bool isOpacityModifyRGB(void) { return false;}
//@deprecated: This interface will be deprecated sooner or later.
CREATE_FUNC(CCLayerColor)
NODE_FUNC(CCLayerColor)
protected:
virtual void updateColor();
};
@ -243,6 +266,7 @@ public:
/** Creates a full-screen CCLayer with a gradient between start and end in the direction of v. */
static CCLayerGradient* create(const ccColor4B& start, const ccColor4B& end, const CCPoint& v);
virtual bool init();
/** Initializes the CCLayer with a gradient between start and end. */
virtual bool initWithColor(const ccColor4B& start, const ccColor4B& end);
@ -264,9 +288,11 @@ public:
virtual void setCompressedInterpolation(bool bCompressedInterpolation);
virtual bool isCompressedInterpolation();
// @deprecated: This interface will be deprecated sooner or later.
NODE_FUNC(CCLayerGradient)
CREATE_FUNC(CCLayerGradient)
//@deprecated: This interface will be deprecated sooner or later.
static CCLayerGradient* node();
static CCLayerGradient* create();
protected:
virtual void updateColor();
};
@ -321,9 +347,9 @@ public:
void switchToAndReleaseMe(unsigned int n);
//@deprecated: This interface will be deprecated sooner or later.
NODE_FUNC(CCLayerMultiplex)
CREATE_FUNC(CCLayerMultiplex)
static CCLayerMultiplex* node();
static CCLayerMultiplex* create();
};

View File

@ -234,6 +234,32 @@ CCTransitionRotoZoom::CCTransitionRotoZoom()
{
}
CCTransitionRotoZoom* CCTransitionRotoZoom::create(float t, CCScene* scene)
{
CCTransitionRotoZoom* pScene = new CCTransitionRotoZoom();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionRotoZoom* CCTransitionRotoZoom::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionRotoZoom* pScene = new CCTransitionRotoZoom();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionRotoZoom::~CCTransitionRotoZoom()
{
}
@ -282,6 +308,32 @@ CCTransitionJumpZoom::~CCTransitionJumpZoom()
{
}
CCTransitionJumpZoom* CCTransitionJumpZoom::create(float t, CCScene* scene)
{
CCTransitionJumpZoom* pScene = new CCTransitionJumpZoom();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionJumpZoom* CCTransitionJumpZoom::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionJumpZoom* pScene = new CCTransitionJumpZoom();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
void CCTransitionJumpZoom::onEnter()
{
CCTransitionScene::onEnter();
@ -325,6 +377,32 @@ CCTransitionMoveInL::~CCTransitionMoveInL()
{
}
CCTransitionMoveInL* CCTransitionMoveInL::create(float t, CCScene* scene)
{
CCTransitionMoveInL* pScene = new CCTransitionMoveInL();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionMoveInL* CCTransitionMoveInL::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionMoveInL* pScene = new CCTransitionMoveInL();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
void CCTransitionMoveInL::onEnter()
{
CCTransitionScene::onEnter();
@ -370,6 +448,32 @@ CCTransitionMoveInR::~CCTransitionMoveInR()
{
}
CCTransitionMoveInR* CCTransitionMoveInR::create(float t, CCScene* scene)
{
CCTransitionMoveInR* pScene = new CCTransitionMoveInR();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionMoveInR* CCTransitionMoveInR::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionMoveInR* pScene = new CCTransitionMoveInR();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
void CCTransitionMoveInR::initScenes()
{
CCSize s = CCDirector::sharedDirector()->getWinSize();
@ -386,6 +490,32 @@ CCTransitionMoveInT::~CCTransitionMoveInT()
{
}
CCTransitionMoveInT* CCTransitionMoveInT::create(float t, CCScene* scene)
{
CCTransitionMoveInT* pScene = new CCTransitionMoveInT();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionMoveInT* CCTransitionMoveInT::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionMoveInT* pScene = new CCTransitionMoveInT();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
void CCTransitionMoveInT::initScenes()
{
CCSize s = CCDirector::sharedDirector()->getWinSize();
@ -402,6 +532,32 @@ CCTransitionMoveInB::~CCTransitionMoveInB()
{
}
CCTransitionMoveInB* CCTransitionMoveInB::create(float t, CCScene* scene)
{
CCTransitionMoveInB* pScene = new CCTransitionMoveInB();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionMoveInB* CCTransitionMoveInB::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionMoveInB* pScene = new CCTransitionMoveInB();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
void CCTransitionMoveInB::initScenes()
{
CCSize s = CCDirector::sharedDirector()->getWinSize();
@ -425,6 +581,32 @@ CCTransitionSlideInL::~CCTransitionSlideInL()
{
}
CCTransitionSlideInL* CCTransitionSlideInL::create(float t, CCScene* scene)
{
CCTransitionSlideInL* pScene = new CCTransitionSlideInL();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionSlideInL* CCTransitionSlideInL::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionSlideInL* pScene = new CCTransitionSlideInL();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
void CCTransitionSlideInL::onEnter()
{
CCTransitionScene::onEnter();
@ -478,6 +660,32 @@ CCTransitionSlideInR::~CCTransitionSlideInR()
{
}
CCTransitionSlideInR* CCTransitionSlideInR::create(float t, CCScene* scene)
{
CCTransitionSlideInR* pScene = new CCTransitionSlideInR();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionSlideInR* CCTransitionSlideInR::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionSlideInR* pScene = new CCTransitionSlideInR();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
void CCTransitionSlideInR::sceneOrder()
{
m_bIsInSceneOnTop = true;
@ -507,6 +715,32 @@ CCTransitionSlideInT::~CCTransitionSlideInT()
{
}
CCTransitionSlideInT* CCTransitionSlideInT::create(float t, CCScene* scene)
{
CCTransitionSlideInT* pScene = new CCTransitionSlideInT();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionSlideInT* CCTransitionSlideInT::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionSlideInT* pScene = new CCTransitionSlideInT();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
void CCTransitionSlideInT::sceneOrder()
{
m_bIsInSceneOnTop = false;
@ -535,6 +769,32 @@ CCTransitionSlideInB::~CCTransitionSlideInB()
{
}
CCTransitionSlideInB* CCTransitionSlideInB::create(float t, CCScene* scene)
{
CCTransitionSlideInB* pScene = new CCTransitionSlideInB();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionSlideInB* CCTransitionSlideInB::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionSlideInB* pScene = new CCTransitionSlideInB();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
void CCTransitionSlideInB::sceneOrder()
{
m_bIsInSceneOnTop = true;
@ -563,6 +823,32 @@ CCTransitionShrinkGrow::~CCTransitionShrinkGrow()
{
}
CCTransitionShrinkGrow* CCTransitionShrinkGrow::create(float t, CCScene* scene)
{
CCTransitionShrinkGrow* pScene = new CCTransitionShrinkGrow();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionShrinkGrow* CCTransitionShrinkGrow::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionShrinkGrow* pScene = new CCTransitionShrinkGrow();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
void CCTransitionShrinkGrow::onEnter()
{
CCTransitionScene::onEnter();
@ -663,6 +949,11 @@ CCTransitionFlipX* CCTransitionFlipX::create(float t, CCScene* s, tOrientation o
return pScene;
}
CCTransitionFlipX* CCTransitionFlipX::create(float t, CCScene* s)
{
return CCTransitionFlipX::create(t, s, kOrientationRightOver);
}
//
// FlipY Transition
//
@ -733,6 +1024,11 @@ CCTransitionFlipY* CCTransitionFlipY::create(float t, CCScene* s, tOrientation o
return pScene;
}
CCTransitionFlipY* CCTransitionFlipY::create(float t, CCScene* s)
{
return CCTransitionFlipY::create(t, s, kOrientationUpOver);
}
//
// FlipAngular Transition
//
@ -803,6 +1099,11 @@ CCTransitionFlipAngular* CCTransitionFlipAngular::create(float t, CCScene* s, tO
return pScene;
}
CCTransitionFlipAngular* CCTransitionFlipAngular::create(float t, CCScene* s)
{
return CCTransitionFlipAngular::create(t, s, kOrientationRightOver);
}
//
// ZoomFlipX Transition
//
@ -881,6 +1182,11 @@ CCTransitionZoomFlipX* CCTransitionZoomFlipX::create(float t, CCScene* s, tOrien
return pScene;
}
CCTransitionZoomFlipX* CCTransitionZoomFlipX::create(float t, CCScene* s)
{
return CCTransitionZoomFlipX::create(t, s, kOrientationRightOver);
}
//
// ZoomFlipY Transition
//
@ -960,6 +1266,11 @@ CCTransitionZoomFlipY* CCTransitionZoomFlipY::create(float t, CCScene* s, tOrien
return pScene;
}
CCTransitionZoomFlipY* CCTransitionZoomFlipY::create(float t, CCScene* s)
{
return CCTransitionZoomFlipY::create(t, s, kOrientationUpOver);
}
//
// ZoomFlipAngular Transition
//
@ -1041,6 +1352,11 @@ CCTransitionZoomFlipAngular* CCTransitionZoomFlipAngular::create(float t, CCScen
return pScene;
}
CCTransitionZoomFlipAngular* CCTransitionZoomFlipAngular::create(float t, CCScene* s)
{
return CCTransitionZoomFlipAngular::create(t, s, kOrientationRightOver);
}
//
// Fade Transition
//
@ -1064,6 +1380,11 @@ CCTransitionFade * CCTransitionFade::create(float duration, CCScene *scene, cons
return pTransition;
}
CCTransitionFade* CCTransitionFade::create(float duration,CCScene* scene)
{
return CCTransitionFade::create(duration, scene, ccBLACK);
}
bool CCTransitionFade::initWithDuration(float duration, CCScene *scene, const ccColor3B& color)
{
if (CCTransitionScene::initWithDuration(duration, scene))
@ -1119,6 +1440,31 @@ CCTransitionCrossFade::~CCTransitionCrossFade()
{
}
CCTransitionCrossFade* CCTransitionCrossFade::create(float t, CCScene* scene)
{
CCTransitionCrossFade* pScene = new CCTransitionCrossFade();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionCrossFade* CCTransitionCrossFade::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionCrossFade* pScene = new CCTransitionCrossFade();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
void CCTransitionCrossFade:: draw()
{
@ -1216,6 +1562,31 @@ CCTransitionTurnOffTiles::~CCTransitionTurnOffTiles()
{
}
CCTransitionTurnOffTiles* CCTransitionTurnOffTiles::create(float t, CCScene* scene)
{
CCTransitionTurnOffTiles* pScene = new CCTransitionTurnOffTiles();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionTurnOffTiles* CCTransitionTurnOffTiles::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionTurnOffTiles* pScene = new CCTransitionTurnOffTiles();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
// override addScenes, and change the order
void CCTransitionTurnOffTiles::sceneOrder()
@ -1261,6 +1632,31 @@ CCTransitionSplitCols::~CCTransitionSplitCols()
{
}
CCTransitionSplitCols* CCTransitionSplitCols::create(float t, CCScene* scene)
{
CCTransitionSplitCols* pScene = new CCTransitionSplitCols();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionSplitCols* CCTransitionSplitCols::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionSplitCols* pScene = new CCTransitionSplitCols();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
void CCTransitionSplitCols::onEnter()
{
@ -1311,6 +1707,31 @@ CCTransitionSplitRows::~CCTransitionSplitRows()
{
}
CCTransitionSplitRows* CCTransitionSplitRows::create(float t, CCScene* scene)
{
CCTransitionSplitRows* pScene = new CCTransitionSplitRows();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionSplitRows* CCTransitionSplitRows::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionSplitRows* pScene = new CCTransitionSplitRows();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCActionInterval* CCTransitionSplitRows::action()
{
@ -1327,6 +1748,31 @@ CCTransitionFadeTR::~CCTransitionFadeTR()
{
}
CCTransitionFadeTR* CCTransitionFadeTR::create(float t, CCScene* scene)
{
CCTransitionFadeTR* pScene = new CCTransitionFadeTR();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionFadeTR* CCTransitionFadeTR::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionFadeTR* pScene = new CCTransitionFadeTR();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
void CCTransitionFadeTR::sceneOrder()
{
@ -1379,6 +1825,32 @@ CCTransitionFadeBL::~CCTransitionFadeBL()
{
}
CCTransitionFadeBL* CCTransitionFadeBL::create(float t, CCScene* scene)
{
CCTransitionFadeBL* pScene = new CCTransitionFadeBL();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionFadeBL* CCTransitionFadeBL::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionFadeBL* pScene = new CCTransitionFadeBL();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCActionInterval* CCTransitionFadeBL::actionWithSize(const ccGridSize& size)
{
return CCFadeOutBLTiles::create(size, m_fDuration);
@ -1394,6 +1866,32 @@ CCTransitionFadeUp::~CCTransitionFadeUp()
{
}
CCTransitionFadeUp* CCTransitionFadeUp::create(float t, CCScene* scene)
{
CCTransitionFadeUp* pScene = new CCTransitionFadeUp();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionFadeUp* CCTransitionFadeUp::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionFadeUp* pScene = new CCTransitionFadeUp();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCActionInterval* CCTransitionFadeUp::actionWithSize(const ccGridSize& size)
{
return CCFadeOutUpTiles::create(size, m_fDuration);
@ -1409,6 +1907,32 @@ CCTransitionFadeDown::~CCTransitionFadeDown()
{
}
CCTransitionFadeDown* CCTransitionFadeDown::create(float t, CCScene* scene)
{
CCTransitionFadeDown* pScene = new CCTransitionFadeDown();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionFadeDown* CCTransitionFadeDown::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionFadeDown* pScene = new CCTransitionFadeDown();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCActionInterval* CCTransitionFadeDown::actionWithSize(const ccGridSize& size)
{
return CCFadeOutDownTiles::create(size, m_fDuration);

View File

@ -41,32 +41,6 @@ NS_CC_BEGIN
//c/c++ don't support object creation of using class name
//so, all classes need creation method.
#define OLD_TRANSITION_CREATE_FUNC(_Type) \
CC_DEPRECATED_ATTRIBUTE static _Type* transitionWithDuration(float t, CCScene* scene) \
{ \
_Type* pScene = new _Type(); \
if(pScene && pScene->initWithDuration(t, scene)) \
{ \
pScene->autorelease(); \
return pScene; \
} \
CC_SAFE_DELETE(pScene); \
return NULL; \
}
#define TRANSITION_CREATE_FUNC(_Type) \
static _Type* create(float t, CCScene* scene) \
{ \
_Type* pScene = new _Type(); \
if(pScene && pScene->initWithDuration(t, scene)) \
{ \
pScene->autorelease(); \
return pScene; \
} \
CC_SAFE_DELETE(pScene); \
return NULL; \
}
class CCActionInterval;
class CCNode;
@ -174,8 +148,8 @@ public:
virtual ~CCTransitionRotoZoom();
virtual void onEnter();
TRANSITION_CREATE_FUNC(CCTransitionRotoZoom);
OLD_TRANSITION_CREATE_FUNC(CCTransitionRotoZoom);
CC_DEPRECATED_ATTRIBUTE static CCTransitionRotoZoom* transitionWithDuration(float t, CCScene* scene);
static CCTransitionRotoZoom* create(float t, CCScene* scene);
};
/** @brief CCTransitionJumpZoom:
@ -188,8 +162,8 @@ public:
virtual ~CCTransitionJumpZoom();
virtual void onEnter();
TRANSITION_CREATE_FUNC(CCTransitionJumpZoom);
OLD_TRANSITION_CREATE_FUNC(CCTransitionJumpZoom);
CC_DEPRECATED_ATTRIBUTE static CCTransitionJumpZoom* transitionWithDuration(float t, CCScene* scene);
static CCTransitionJumpZoom* create(float t, CCScene* scene);
};
/** @brief CCTransitionMoveInL:
@ -209,8 +183,8 @@ public:
virtual void onEnter();
TRANSITION_CREATE_FUNC(CCTransitionMoveInL);
OLD_TRANSITION_CREATE_FUNC(CCTransitionMoveInL);
CC_DEPRECATED_ATTRIBUTE static CCTransitionMoveInL* transitionWithDuration(float t, CCScene* scene);
static CCTransitionMoveInL* create(float t, CCScene* scene);
};
/** @brief CCTransitionMoveInR:
@ -223,8 +197,8 @@ public:
virtual ~CCTransitionMoveInR();
virtual void initScenes();
TRANSITION_CREATE_FUNC(CCTransitionMoveInR);
OLD_TRANSITION_CREATE_FUNC(CCTransitionMoveInR);
CC_DEPRECATED_ATTRIBUTE static CCTransitionMoveInR* transitionWithDuration(float t, CCScene* scene);
static CCTransitionMoveInR* create(float t, CCScene* scene);
};
/** @brief CCTransitionMoveInT:
@ -237,8 +211,8 @@ public:
virtual ~CCTransitionMoveInT();
virtual void initScenes();
TRANSITION_CREATE_FUNC(CCTransitionMoveInT);
OLD_TRANSITION_CREATE_FUNC(CCTransitionMoveInT);
CC_DEPRECATED_ATTRIBUTE static CCTransitionMoveInT* transitionWithDuration(float t, CCScene* scene);
static CCTransitionMoveInT* create(float t, CCScene* scene);
};
/** @brief CCTransitionMoveInB:
@ -251,8 +225,8 @@ public:
virtual ~CCTransitionMoveInB();
virtual void initScenes();
TRANSITION_CREATE_FUNC(CCTransitionMoveInB);
OLD_TRANSITION_CREATE_FUNC(CCTransitionMoveInB);
CC_DEPRECATED_ATTRIBUTE static CCTransitionMoveInB* transitionWithDuration(float t, CCScene* scene);
static CCTransitionMoveInB* create(float t, CCScene* scene);
};
/** @brief CCTransitionSlideInL:
@ -273,8 +247,8 @@ public:
virtual CCActionInterval* easeActionWithAction(CCActionInterval * action);
TRANSITION_CREATE_FUNC(CCTransitionSlideInL);
OLD_TRANSITION_CREATE_FUNC(CCTransitionSlideInL);
CC_DEPRECATED_ATTRIBUTE static CCTransitionSlideInL* transitionWithDuration(float t, CCScene* scene);
static CCTransitionSlideInL* create(float t, CCScene* scene);
protected:
virtual void sceneOrder();
};
@ -293,8 +267,8 @@ public:
/** returns the action that will be performed by the incoming and outgoing scene */
virtual CCActionInterval* action(void);
TRANSITION_CREATE_FUNC(CCTransitionSlideInR);
OLD_TRANSITION_CREATE_FUNC(CCTransitionSlideInR);
CC_DEPRECATED_ATTRIBUTE static CCTransitionSlideInR* transitionWithDuration(float t, CCScene* scene);
static CCTransitionSlideInR* create(float t, CCScene* scene);
protected:
virtual void sceneOrder();
};
@ -313,8 +287,8 @@ public:
/** returns the action that will be performed by the incoming and outgoing scene */
virtual CCActionInterval* action(void);
TRANSITION_CREATE_FUNC(CCTransitionSlideInB);
OLD_TRANSITION_CREATE_FUNC(CCTransitionSlideInB);
CC_DEPRECATED_ATTRIBUTE static CCTransitionSlideInB* transitionWithDuration(float t, CCScene* scene);
static CCTransitionSlideInB* create(float t, CCScene* scene);
protected:
virtual void sceneOrder();
};
@ -333,8 +307,8 @@ public:
/** returns the action that will be performed by the incoming and outgoing scene */
virtual CCActionInterval* action(void);
TRANSITION_CREATE_FUNC(CCTransitionSlideInT);
OLD_TRANSITION_CREATE_FUNC(CCTransitionSlideInT);
CC_DEPRECATED_ATTRIBUTE static CCTransitionSlideInT* transitionWithDuration(float t, CCScene* scene);
static CCTransitionSlideInT* create(float t, CCScene* scene);
protected:
virtual void sceneOrder();
};
@ -351,8 +325,8 @@ public:
virtual void onEnter();
virtual CCActionInterval* easeActionWithAction(CCActionInterval * action);
TRANSITION_CREATE_FUNC(CCTransitionShrinkGrow);
OLD_TRANSITION_CREATE_FUNC(CCTransitionShrinkGrow);
CC_DEPRECATED_ATTRIBUTE static CCTransitionShrinkGrow* transitionWithDuration(float t, CCScene* scene);
static CCTransitionShrinkGrow* create(float t, CCScene* scene);
};
/** @brief CCTransitionFlipX:
@ -370,9 +344,7 @@ public:
// @deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCTransitionFlipX* transitionWithDuration(float t, CCScene* s, tOrientation o = kOrientationRightOver);
static CCTransitionFlipX* create(float t, CCScene* s, tOrientation o);
static CCTransitionFlipX* create(float t, CCScene* s) {
return CCTransitionFlipX::create(t, s, kOrientationRightOver);
}
static CCTransitionFlipX* create(float t, CCScene* s);
};
/** @brief CCTransitionFlipY:
@ -390,9 +362,7 @@ public:
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCTransitionFlipY* transitionWithDuration(float t, CCScene* s, tOrientation o = kOrientationUpOver);
static CCTransitionFlipY* create(float t, CCScene* s, tOrientation o);
static CCTransitionFlipY* create(float t, CCScene* s) {
return CCTransitionFlipY::create(t, s, kOrientationUpOver);
}
static CCTransitionFlipY* create(float t, CCScene* s);
};
/** @brief CCTransitionFlipAngular:
@ -410,9 +380,7 @@ public:
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCTransitionFlipAngular* transitionWithDuration(float t, CCScene* s, tOrientation o = kOrientationRightOver);
static CCTransitionFlipAngular* create(float t, CCScene* s, tOrientation o);
static CCTransitionFlipAngular* create(float t, CCScene* s) {
return CCTransitionFlipAngular::create(t, s, kOrientationRightOver);
}
static CCTransitionFlipAngular* create(float t, CCScene* s);
};
/** @brief CCTransitionZoomFlipX:
@ -430,9 +398,7 @@ public:
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCTransitionZoomFlipX* transitionWithDuration(float t, CCScene* s, tOrientation o = kOrientationRightOver);
static CCTransitionZoomFlipX* create(float t, CCScene* s, tOrientation o);
static CCTransitionZoomFlipX* create(float t, CCScene* s) {
return CCTransitionZoomFlipX::create(t, s, kOrientationRightOver);
}
static CCTransitionZoomFlipX* create(float t, CCScene* s);
};
/** @brief CCTransitionZoomFlipY:
@ -450,9 +416,7 @@ public:
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCTransitionZoomFlipY* transitionWithDuration(float t, CCScene* s, tOrientation o = kOrientationUpOver);
static CCTransitionZoomFlipY* create(float t, CCScene* s, tOrientation o);
static CCTransitionZoomFlipY* create(float t, CCScene* s) {
return CCTransitionZoomFlipY::create(t, s, kOrientationUpOver);
}
static CCTransitionZoomFlipY* create(float t, CCScene* s);
};
/** @brief CCTransitionZoomFlipAngular:
@ -470,9 +434,7 @@ public:
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCTransitionZoomFlipAngular* transitionWithDuration(float t, CCScene* s, tOrientation o = kOrientationRightOver);
static CCTransitionZoomFlipAngular* create(float t, CCScene* s, tOrientation o);
static CCTransitionZoomFlipAngular* create(float t, CCScene* s) {
return CCTransitionZoomFlipAngular::create(t, s, kOrientationRightOver);
}
static CCTransitionZoomFlipAngular* create(float t, CCScene* s);
};
/** @brief CCTransitionFade:
@ -498,9 +460,7 @@ public:
* Example: FadeTransition::create(2, scene, ccc3(255,0,0); // red color
*/
static CCTransitionFade* create(float duration,CCScene* scene, const ccColor3B& color);
static CCTransitionFade* create(float duration,CCScene* scene) {
return CCTransitionFade::create(duration, scene, ccBLACK);
}
static CCTransitionFade* create(float duration,CCScene* scene);
/** initializes the transition with a duration and with an RGB color */
virtual bool initWithDuration(float t, CCScene*scene ,const ccColor3B& color);
@ -526,8 +486,8 @@ public :
virtual void onExit();
public:
TRANSITION_CREATE_FUNC(CCTransitionCrossFade);
OLD_TRANSITION_CREATE_FUNC(CCTransitionCrossFade);
CC_DEPRECATED_ATTRIBUTE static CCTransitionCrossFade* transitionWithDuration(float t, CCScene* scene);
static CCTransitionCrossFade* create(float t, CCScene* scene);
};
/** @brief CCTransitionTurnOffTiles:
@ -543,8 +503,8 @@ public :
virtual CCActionInterval * easeActionWithAction(CCActionInterval * action);
public:
TRANSITION_CREATE_FUNC(CCTransitionTurnOffTiles);
OLD_TRANSITION_CREATE_FUNC(CCTransitionTurnOffTiles);
CC_DEPRECATED_ATTRIBUTE static CCTransitionTurnOffTiles* transitionWithDuration(float t, CCScene* scene);
static CCTransitionTurnOffTiles* create(float t, CCScene* scene);
protected:
virtual void sceneOrder();
};
@ -563,8 +523,8 @@ public:
virtual CCActionInterval * easeActionWithAction(CCActionInterval * action);
public:
TRANSITION_CREATE_FUNC(CCTransitionSplitCols);
OLD_TRANSITION_CREATE_FUNC(CCTransitionSplitCols);
CC_DEPRECATED_ATTRIBUTE static CCTransitionSplitCols* transitionWithDuration(float t, CCScene* scene);
static CCTransitionSplitCols* create(float t, CCScene* scene);
};
/** @brief CCTransitionSplitRows:
@ -579,8 +539,8 @@ public:
virtual CCActionInterval* action(void);
public:
TRANSITION_CREATE_FUNC(CCTransitionSplitRows)
OLD_TRANSITION_CREATE_FUNC(CCTransitionSplitRows)
CC_DEPRECATED_ATTRIBUTE static CCTransitionSplitRows* transitionWithDuration(float t, CCScene* scene);
static CCTransitionSplitRows* create(float t, CCScene* scene);
};
/** @brief CCTransitionFadeTR:
@ -596,11 +556,10 @@ public:
virtual CCActionInterval* easeActionWithAction(CCActionInterval * action);
public:
TRANSITION_CREATE_FUNC(CCTransitionFadeTR)
OLD_TRANSITION_CREATE_FUNC(CCTransitionFadeTR)
CC_DEPRECATED_ATTRIBUTE static CCTransitionFadeTR* transitionWithDuration(float t, CCScene* scene);
static CCTransitionFadeTR* create(float t, CCScene* scene);
protected:
virtual void sceneOrder();
};
/** @brief CCTransitionFadeBL:
@ -614,8 +573,8 @@ public:
virtual CCActionInterval* actionWithSize(const ccGridSize& size);
public:
TRANSITION_CREATE_FUNC(CCTransitionFadeBL)
OLD_TRANSITION_CREATE_FUNC(CCTransitionFadeBL)
CC_DEPRECATED_ATTRIBUTE static CCTransitionFadeBL* transitionWithDuration(float t, CCScene* scene);
static CCTransitionFadeBL* create(float t, CCScene* scene);
};
/** @brief CCTransitionFadeUp:
@ -629,8 +588,8 @@ public:
virtual CCActionInterval* actionWithSize(const ccGridSize& size);
public:
TRANSITION_CREATE_FUNC(CCTransitionFadeUp)
OLD_TRANSITION_CREATE_FUNC(CCTransitionFadeUp)
CC_DEPRECATED_ATTRIBUTE static CCTransitionFadeUp* transitionWithDuration(float t, CCScene* scene);
static CCTransitionFadeUp* create(float t, CCScene* scene);
};
/** @brief CCTransitionFadeDown:
@ -644,8 +603,8 @@ public:
virtual CCActionInterval* actionWithSize(const ccGridSize& size);
public:
TRANSITION_CREATE_FUNC(CCTransitionFadeDown)
OLD_TRANSITION_CREATE_FUNC(CCTransitionFadeDown)
CC_DEPRECATED_ATTRIBUTE static CCTransitionFadeDown* transitionWithDuration(float t, CCScene* scene);
static CCTransitionFadeDown* create(float t, CCScene* scene);
};
// end of transition group

View File

@ -48,6 +48,32 @@ CCTransitionProgress::CCTransitionProgress()
}
CCTransitionProgress* CCTransitionProgress::create(float t, CCScene* scene)
{
CCTransitionProgress* pScene = new CCTransitionProgress();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionProgress* CCTransitionProgress::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionProgress* pScene = new CCTransitionProgress();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
// CCTransitionProgress
void CCTransitionProgress::onEnter()
{
@ -140,7 +166,58 @@ CCProgressTimer* CCTransitionProgressRadialCCW::progressTimerNodeWithRenderTextu
return pNode;
}
CCTransitionProgressRadialCCW* CCTransitionProgressRadialCCW::create(float t, CCScene* scene)
{
CCTransitionProgressRadialCCW* pScene = new CCTransitionProgressRadialCCW();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionProgressRadialCCW* CCTransitionProgressRadialCCW::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionProgressRadialCCW* pScene = new CCTransitionProgressRadialCCW();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
// CCTransitionProgressRadialCW
CCTransitionProgressRadialCW* CCTransitionProgressRadialCW::create(float t, CCScene* scene)
{
CCTransitionProgressRadialCW* pScene = new CCTransitionProgressRadialCW();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionProgressRadialCW* CCTransitionProgressRadialCW::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionProgressRadialCW* pScene = new CCTransitionProgressRadialCW();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCProgressTimer* CCTransitionProgressRadialCW::progressTimerNodeWithRenderTexture(CCRenderTexture* texture)
{
@ -162,6 +239,31 @@ CCProgressTimer* CCTransitionProgressRadialCW::progressTimerNodeWithRenderTextur
}
// CCTransitionProgressHorizontal
CCTransitionProgressHorizontal* CCTransitionProgressHorizontal::create(float t, CCScene* scene)
{
CCTransitionProgressHorizontal* pScene = new CCTransitionProgressHorizontal();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionProgressHorizontal* CCTransitionProgressHorizontal::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionProgressHorizontal* pScene = new CCTransitionProgressHorizontal();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCProgressTimer* CCTransitionProgressHorizontal::progressTimerNodeWithRenderTexture(CCRenderTexture* texture)
{
@ -184,6 +286,31 @@ CCProgressTimer* CCTransitionProgressHorizontal::progressTimerNodeWithRenderText
}
// CCTransitionProgressVertical
CCTransitionProgressVertical* CCTransitionProgressVertical::create(float t, CCScene* scene)
{
CCTransitionProgressVertical* pScene = new CCTransitionProgressVertical();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionProgressVertical* CCTransitionProgressVertical::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionProgressVertical* pScene = new CCTransitionProgressVertical();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCProgressTimer* CCTransitionProgressVertical::progressTimerNodeWithRenderTexture(CCRenderTexture* texture)
{
@ -207,6 +334,31 @@ CCProgressTimer* CCTransitionProgressVertical::progressTimerNodeWithRenderTextur
// CCTransitionProgressInOut
CCTransitionProgressInOut* CCTransitionProgressInOut::create(float t, CCScene* scene)
{
CCTransitionProgressInOut* pScene = new CCTransitionProgressInOut();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionProgressInOut* CCTransitionProgressInOut::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionProgressInOut* pScene = new CCTransitionProgressInOut();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
void CCTransitionProgressInOut::sceneOrder()
{
@ -242,6 +394,31 @@ CCProgressTimer* CCTransitionProgressInOut::progressTimerNodeWithRenderTexture(C
// CCTransitionProgressOutIn
CCTransitionProgressOutIn* CCTransitionProgressOutIn::create(float t, CCScene* scene)
{
CCTransitionProgressOutIn* pScene = new CCTransitionProgressOutIn();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCTransitionProgressOutIn* CCTransitionProgressOutIn::transitionWithDuration(float t, CCScene* scene)
{
CCTransitionProgressOutIn* pScene = new CCTransitionProgressOutIn();
if(pScene && pScene->initWithDuration(t, scene))
{
pScene->autorelease();
return pScene;
}
CC_SAFE_DELETE(pScene);
return NULL;
}
CCProgressTimer* CCTransitionProgressOutIn::progressTimerNodeWithRenderTexture(CCRenderTexture* texture)
{

View File

@ -42,8 +42,8 @@ class CCRenderTexture;
class CC_DLL CCTransitionProgress : public CCTransitionScene
{
public:
OLD_TRANSITION_CREATE_FUNC(CCTransitionProgress)
TRANSITION_CREATE_FUNC(CCTransitionProgress)
CC_DEPRECATED_ATTRIBUTE static CCTransitionProgress* transitionWithDuration(float t, CCScene* scene);
static CCTransitionProgress* create(float t, CCScene* scene);
CCTransitionProgress();
virtual void onEnter();
@ -64,8 +64,8 @@ protected:
class CC_DLL CCTransitionProgressRadialCCW : public CCTransitionProgress
{
public:
OLD_TRANSITION_CREATE_FUNC(CCTransitionProgressRadialCCW)
TRANSITION_CREATE_FUNC(CCTransitionProgressRadialCCW)
CC_DEPRECATED_ATTRIBUTE static CCTransitionProgressRadialCCW* transitionWithDuration(float t, CCScene* scene);
static CCTransitionProgressRadialCCW* create(float t, CCScene* scene);
protected:
virtual CCProgressTimer* progressTimerNodeWithRenderTexture(CCRenderTexture* texture);
@ -78,8 +78,8 @@ protected:
class CC_DLL CCTransitionProgressRadialCW : public CCTransitionProgress
{
public:
OLD_TRANSITION_CREATE_FUNC(CCTransitionProgressRadialCW)
TRANSITION_CREATE_FUNC(CCTransitionProgressRadialCW)
CC_DEPRECATED_ATTRIBUTE static CCTransitionProgressRadialCW* transitionWithDuration(float t, CCScene* scene);
static CCTransitionProgressRadialCW* create(float t, CCScene* scene);
protected:
virtual CCProgressTimer* progressTimerNodeWithRenderTexture(CCRenderTexture* texture);
@ -91,8 +91,8 @@ protected:
class CC_DLL CCTransitionProgressHorizontal : public CCTransitionProgress
{
public:
OLD_TRANSITION_CREATE_FUNC(CCTransitionProgressHorizontal)
TRANSITION_CREATE_FUNC(CCTransitionProgressHorizontal)
CC_DEPRECATED_ATTRIBUTE static CCTransitionProgressHorizontal* transitionWithDuration(float t, CCScene* scene);
static CCTransitionProgressHorizontal* create(float t, CCScene* scene);
protected:
virtual CCProgressTimer* progressTimerNodeWithRenderTexture(CCRenderTexture* texture);
@ -101,8 +101,8 @@ protected:
class CC_DLL CCTransitionProgressVertical : public CCTransitionProgress
{
public:
OLD_TRANSITION_CREATE_FUNC(CCTransitionProgressVertical)
TRANSITION_CREATE_FUNC(CCTransitionProgressVertical)
CC_DEPRECATED_ATTRIBUTE static CCTransitionProgressVertical* transitionWithDuration(float t, CCScene* scene);
static CCTransitionProgressVertical* create(float t, CCScene* scene);
protected:
virtual CCProgressTimer* progressTimerNodeWithRenderTexture(CCRenderTexture* texture);
@ -111,8 +111,8 @@ protected:
class CC_DLL CCTransitionProgressInOut : public CCTransitionProgress
{
public:
OLD_TRANSITION_CREATE_FUNC(CCTransitionProgressInOut)
TRANSITION_CREATE_FUNC(CCTransitionProgressInOut)
CC_DEPRECATED_ATTRIBUTE static CCTransitionProgressInOut* transitionWithDuration(float t, CCScene* scene);
static CCTransitionProgressInOut* create(float t, CCScene* scene);
protected:
virtual CCProgressTimer* progressTimerNodeWithRenderTexture(CCRenderTexture* texture);
virtual void sceneOrder();
@ -122,8 +122,8 @@ protected:
class CC_DLL CCTransitionProgressOutIn : public CCTransitionProgress
{
public:
OLD_TRANSITION_CREATE_FUNC(CCTransitionProgressOutIn)
TRANSITION_CREATE_FUNC(CCTransitionProgressOutIn)
CC_DEPRECATED_ATTRIBUTE static CCTransitionProgressOutIn* transitionWithDuration(float t, CCScene* scene);
static CCTransitionProgressOutIn* create(float t, CCScene* scene);
protected:
virtual CCProgressTimer* progressTimerNodeWithRenderTexture(CCRenderTexture* texture);

View File

@ -32,6 +32,26 @@ NS_CC_BEGIN
//
// ParticleFire
//
CCParticleFire* CCParticleFire::node()
{
return CCParticleFire::create();
}
CCParticleFire* CCParticleFire::create()
{
CCParticleFire* pRet = new CCParticleFire();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
bool CCParticleFire::initWithTotalParticles(unsigned int numberOfParticles)
{
if( CCParticleSystemQuad::initWithTotalParticles(numberOfParticles) )
@ -102,6 +122,25 @@ bool CCParticleFire::initWithTotalParticles(unsigned int numberOfParticles)
//
// ParticleFireworks
//
CCParticleFireworks* CCParticleFireworks::node()
{
return CCParticleFireworks::create();
}
CCParticleFireworks* CCParticleFireworks::create()
{
CCParticleFireworks* pRet = new CCParticleFireworks();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
bool CCParticleFireworks::initWithTotalParticles(unsigned int numberOfParticles)
{
if( CCParticleSystemQuad::initWithTotalParticles(numberOfParticles) )
@ -170,6 +209,26 @@ bool CCParticleFireworks::initWithTotalParticles(unsigned int numberOfParticles)
//
// ParticleSun
//
CCParticleSun* CCParticleSun::node()
{
return CCParticleSun::create();
}
CCParticleSun* CCParticleSun::create()
{
CCParticleSun* pRet = new CCParticleSun();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
bool CCParticleSun::initWithTotalParticles(unsigned int numberOfParticles)
{
if( CCParticleSystemQuad::initWithTotalParticles(numberOfParticles) )
@ -242,6 +301,26 @@ bool CCParticleSun::initWithTotalParticles(unsigned int numberOfParticles)
//
// ParticleGalaxy
//
CCParticleGalaxy* CCParticleGalaxy::node()
{
return CCParticleGalaxy::create();
}
CCParticleGalaxy* CCParticleGalaxy::create()
{
CCParticleGalaxy* pRet = new CCParticleGalaxy();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
bool CCParticleGalaxy::initWithTotalParticles(unsigned int numberOfParticles)
{
if( CCParticleSystemQuad::initWithTotalParticles(numberOfParticles) )
@ -316,6 +395,26 @@ bool CCParticleGalaxy::initWithTotalParticles(unsigned int numberOfParticles)
//
// ParticleFlower
//
CCParticleFlower* CCParticleFlower::node()
{
return CCParticleFlower::create();
}
CCParticleFlower* CCParticleFlower::create()
{
CCParticleFlower* pRet = new CCParticleFlower();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
bool CCParticleFlower::initWithTotalParticles(unsigned int numberOfParticles)
{
if( CCParticleSystemQuad::initWithTotalParticles(numberOfParticles) )
@ -389,6 +488,26 @@ bool CCParticleFlower::initWithTotalParticles(unsigned int numberOfParticles)
//
// ParticleMeteor
//
CCParticleMeteor * CCParticleMeteor::node()
{
return create();
}
CCParticleMeteor * CCParticleMeteor::create()
{
CCParticleMeteor *pRet = new CCParticleMeteor();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
bool CCParticleMeteor::initWithTotalParticles(unsigned int numberOfParticles)
{
if( CCParticleSystemQuad::initWithTotalParticles(numberOfParticles) )
@ -463,6 +582,26 @@ bool CCParticleMeteor::initWithTotalParticles(unsigned int numberOfParticles)
//
// ParticleSpiral
//
CCParticleSpiral* CCParticleSpiral::node()
{
return CCParticleSpiral::create();
}
CCParticleSpiral* CCParticleSpiral::create()
{
CCParticleSpiral* pRet = new CCParticleSpiral();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
bool CCParticleSpiral::initWithTotalParticles(unsigned int numberOfParticles)
{
if( CCParticleSystemQuad::initWithTotalParticles(numberOfParticles) )
@ -537,6 +676,26 @@ bool CCParticleSpiral::initWithTotalParticles(unsigned int numberOfParticles)
//
// ParticleExplosion
//
CCParticleExplosion* CCParticleExplosion::node()
{
return CCParticleExplosion::create();
}
CCParticleExplosion* CCParticleExplosion::create()
{
CCParticleExplosion* pRet = new CCParticleExplosion();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
bool CCParticleExplosion::initWithTotalParticles(unsigned int numberOfParticles)
{
if( CCParticleSystemQuad::initWithTotalParticles(numberOfParticles) )
@ -610,6 +769,26 @@ bool CCParticleExplosion::initWithTotalParticles(unsigned int numberOfParticles)
//
// ParticleSmoke
//
CCParticleSmoke* CCParticleSmoke::node()
{
return CCParticleSmoke::create();
}
CCParticleSmoke* CCParticleSmoke::create()
{
CCParticleSmoke* pRet = new CCParticleSmoke();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
bool CCParticleSmoke::initWithTotalParticles(unsigned int numberOfParticles)
{
if( CCParticleSystemQuad::initWithTotalParticles(numberOfParticles) )
@ -676,9 +855,30 @@ bool CCParticleSmoke::initWithTotalParticles(unsigned int numberOfParticles)
}
return false;
}
//
// CCParticleSnow
//
CCParticleSnow* CCParticleSnow::node()
{
return CCParticleSnow::create();
}
CCParticleSnow* CCParticleSnow::create()
{
CCParticleSnow* pRet = new CCParticleSnow();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
bool CCParticleSnow::initWithTotalParticles(unsigned int numberOfParticles)
{
if( CCParticleSystemQuad::initWithTotalParticles(numberOfParticles) )
@ -752,6 +952,25 @@ bool CCParticleSnow::initWithTotalParticles(unsigned int numberOfParticles)
//
// CCParticleRain
//
CCParticleRain* CCParticleRain::node()
{
return CCParticleRain::create();
}
CCParticleRain* CCParticleRain::create()
{
CCParticleRain* pRet = new CCParticleRain();
if (pRet && pRet->init())
{
pRet->autorelease();
}
else
{
CC_SAFE_DELETE(pRet);
}
return pRet;
}
bool CCParticleRain::initWithTotalParticles(unsigned int numberOfParticles)
{
if( CCParticleSystemQuad::initWithTotalParticles(numberOfParticles) )

View File

@ -43,22 +43,10 @@ public:
virtual ~CCParticleFire(){}
bool init(){ return initWithTotalParticles(250); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleFire * node()
{
return create();
}
static CCParticleFire * create()
{
CCParticleFire *pRet = new CCParticleFire();
if (pRet->init())
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCParticleFire* node();
static CCParticleFire* create();
};
//! @brief A fireworks particle system
@ -69,22 +57,10 @@ public:
virtual ~CCParticleFireworks(){}
bool init(){ return initWithTotalParticles(1500); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleFireworks * node()
{
return create();
}
static CCParticleFireworks * create()
{
CCParticleFireworks *pRet = new CCParticleFireworks();
if (pRet->init())
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCParticleFireworks* node();
static CCParticleFireworks* create();
};
//! @brief A sun particle system
@ -95,21 +71,10 @@ public:
virtual ~CCParticleSun(){}
bool init(){ return initWithTotalParticles(350); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleSun * node()
{
return create();
}
static CCParticleSun * create()
{
CCParticleSun *pRet = new CCParticleSun();
if (pRet->init())
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCParticleSun* node();
static CCParticleSun* create();
};
//! @brief A galaxy particle system
@ -120,22 +85,10 @@ public:
virtual ~CCParticleGalaxy(){}
bool init(){ return initWithTotalParticles(200); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleGalaxy * node()
{
return create();
}
static CCParticleGalaxy * create()
{
CCParticleGalaxy *pRet = new CCParticleGalaxy();
if (pRet->init())
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCParticleGalaxy* node();
static CCParticleGalaxy* create();
};
//! @brief A flower particle system
@ -146,22 +99,10 @@ public:
virtual ~CCParticleFlower(){}
bool init(){ return initWithTotalParticles(250); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleFlower * node()
{
return create();
}
static CCParticleFlower * create()
{
CCParticleFlower *pRet = new CCParticleFlower();
if (pRet->init())
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCParticleFlower* node();
static CCParticleFlower* create();
};
//! @brief A meteor particle system
@ -172,21 +113,8 @@ public:
virtual ~CCParticleMeteor(){}
bool init(){ return initWithTotalParticles(150); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleMeteor * node()
{
return create();
}
static CCParticleMeteor * create()
{
CCParticleMeteor *pRet = new CCParticleMeteor();
if (pRet->init())
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
CC_DEPRECATED_ATTRIBUTE static CCParticleMeteor * node();
static CCParticleMeteor * create();
};
//! @brief An spiral particle system
@ -197,21 +125,10 @@ public:
virtual ~CCParticleSpiral(){}
bool init(){ return initWithTotalParticles(500); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleSpiral * node()
{
return create();
}
static CCParticleSpiral * create()
{
CCParticleSpiral *pRet = new CCParticleSpiral();
if (pRet->init())
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCParticleSpiral* node();
static CCParticleSpiral* create();
};
//! @brief An explosion particle system
@ -222,21 +139,10 @@ public:
virtual ~CCParticleExplosion(){}
bool init(){ return initWithTotalParticles(700); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleExplosion * node()
{
return create();
}
static CCParticleExplosion * create()
{
CCParticleExplosion *pRet = new CCParticleExplosion();
if (pRet->init())
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCParticleExplosion* node();
static CCParticleExplosion* create();
};
//! @brief An smoke particle system
@ -247,21 +153,10 @@ public:
virtual ~CCParticleSmoke(){}
bool init(){ return initWithTotalParticles(200); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleSmoke * node()
{
return create();
}
static CCParticleSmoke * create()
{
CCParticleSmoke *pRet = new CCParticleSmoke();
if (pRet->init())
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCParticleSmoke* node();
static CCParticleSmoke* create();
};
//! @brief An snow particle system
@ -272,22 +167,10 @@ public:
virtual ~CCParticleSnow(){}
bool init(){ return initWithTotalParticles(700); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleSnow * node()
{
return create();
}
static CCParticleSnow * create()
{
CCParticleSnow *pRet = new CCParticleSnow();
if (pRet->init())
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCParticleSnow* node();
static CCParticleSnow* create();
};
//! @brief A rain particle system
@ -298,21 +181,10 @@ public:
virtual ~CCParticleRain(){}
bool init(){ return initWithTotalParticles(1000); }
virtual bool initWithTotalParticles(unsigned int numberOfParticles);
static CCParticleRain * node()
{
return create();
}
static CCParticleRain * create()
{
CCParticleRain *pRet = new CCParticleRain();
if (pRet->init())
{
pRet->autorelease();
return pRet;
}
CC_SAFE_DELETE(pRet);
return NULL;
}
//@deprecated: This interface will be deprecated sooner or later.
CC_DEPRECATED_ATTRIBUTE static CCParticleRain* node();
static CCParticleRain* create();
};
// end of particle_nodes group

View File

@ -88,13 +88,12 @@ void CCEGLViewProtocol::setDesignResolutionSize(float width, float height, Resol
m_eResolutionPolicy = resolutionPolicy;
// reset director's member variables to fit visible rect
CCDirector::sharedDirector()->m_obWinSizeInPoints = getSize();
CCDirector::sharedDirector()->m_obWinSizeInPixels = CCSizeMake(m_obDesignResolutionSize.width*CC_CONTENT_SCALE_FACTOR(), m_obDesignResolutionSize.height*CC_CONTENT_SCALE_FACTOR());
CCDirector::sharedDirector()->m_obWinSizeInPoints = getDesignResolutionSize();
CCDirector::sharedDirector()->createStatsLabel();
CCDirector::sharedDirector()->setGLDefaultValues();
}
const CCSize& CCEGLViewProtocol::getSize() const
const CCSize& CCEGLViewProtocol::getDesignResolutionSize() const
{
return m_obDesignResolutionSize;
}

View File

@ -48,13 +48,6 @@ public:
/** Open or close IME keyboard , subclass must implement this method. */
virtual void setIMEKeyboardState(bool bOpen) = 0;
/**
* Get design resolution size.
* If setDesignResolutionSize wasn't invoked, the result of this function return is the same as 'getFrameSize'
*/
virtual const CCSize& getSize() const;
/**
* Get the frame size of EGL view.
* In general, it returns the screen size since the EGL view is a fullscreen view.
@ -78,16 +71,20 @@ public:
/**
* Set the design resolution size.
* Behavior undefined when enableRetina == true.
* @param width Design resolution width.
* @param height Design resolution height.
* @param resolutionPolicy The resolution policy desired, you may choose:
* [1] kCCResolutionExactFit Fill screen by stretch-to-fit: if the design resolution ratio of width to height is different from the screen resolution ratio, your game view will be stretched.
* [2] kCCResolutionNoBorder Full screen without black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two areas of your game view will be cut.
* [3] kCCResolutionShowAll Full screen with black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two black borders will be shown.
* [1] kResolutionExactFit Fill screen by stretch-to-fit: if the design resolution ratio of width to height is different from the screen resolution ratio, your game view will be stretched.
* [2] kResolutionNoBorder Full screen without black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two areas of your game view will be cut.
* [3] kResolutionShowAll Full screen with black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two black borders will be shown.
*/
virtual void setDesignResolutionSize(float width, float height, ResolutionPolicy resolutionPolicy);
/** Get design resolution size.
* Default resolution size is the same as 'getFrameSize'.
*/
virtual const CCSize& getDesignResolutionSize() const;
/** Set touch delegate */
virtual void setTouchDelegate(EGLTouchDelegate * pDelegate);

View File

@ -55,6 +55,12 @@ namespace cocos2d
}
}
void CCAccelerometer::setAccelerometerInterval(float interval)
{
setAccelerometerIntervalJNI(interval);
}
void CCAccelerometer::update(float x, float y, float z, long sensorTimeStamp)
{
if (m_pAccelDelegate)

View File

@ -37,6 +37,7 @@ public:
~CCAccelerometer();
void setDelegate(CCAccelerometerDelegate* pDelegate);
void setAccelerometerInterval(float interval);
void update(float x, float y, float z, long sensorTimeStamp);
private:

View File

@ -33,6 +33,7 @@ import android.util.Log;
import android.view.Display;
import android.view.Surface;
import android.view.WindowManager;
import android.os.Build.*;
public class Cocos2dxAccelerometer implements SensorEventListener {
// ===========================================================
@ -72,6 +73,16 @@ public class Cocos2dxAccelerometer implements SensorEventListener {
this.mSensorManager.registerListener(this, this.mAccelerometer, SensorManager.SENSOR_DELAY_GAME);
}
public void setInterval(float interval) {
// Honeycomb version is 11
if(android.os.Build.VERSION.SDK_INT < 11) {
this.mSensorManager.registerListener(this, this.mAccelerometer, SensorManager.SENSOR_DELAY_GAME);
} else {
//convert seconds to microseconds
this.mSensorManager.registerListener(this, this.mAccelerometer, (int)(interval*100000));
}
}
public void disable() {
this.mSensorManager.unregisterListener(this);
}

View File

@ -109,6 +109,11 @@ public class Cocos2dxHelper {
Cocos2dxHelper.sCocos2dxAccelerometer.enable();
}
public static void setAccelerometerInterval(float interval) {
Cocos2dxHelper.sCocos2dxAccelerometer.setInterval(interval);
}
public static void disableAccelerometer() {
Cocos2dxHelper.sAccelerometerEnabled = false;
Cocos2dxHelper.sCocos2dxAccelerometer.disable();

View File

@ -156,6 +156,15 @@ extern "C" {
}
}
void setAccelerometerIntervalJNI(float interval) {
JniMethodInfo t;
if (JniHelper::getStaticMethodInfo(t, CLASS_NAME, "setAccelerometerInterval", "(I)V")) {
t.env->CallStaticVoidMethod(t.classID, t.methodID, interval);
t.env->DeleteLocalRef(t.classID);
}
}
void disableAccelerometerJNI() {
JniMethodInfo t;

View File

@ -37,6 +37,7 @@ extern "C" {
extern const char * getPackageNameJNI();
extern void enableAccelerometerJNI();
extern void disableAccelerometerJNI();
extern void setAccelerometerIntervalJNI(float interval);
}
#endif

View File

@ -27,7 +27,7 @@ THE SOFTWARE.
#include "cocoa/CCGeometry.h"
#include "platform/CCEGLViewProtocol.h"
#include "platform/CCPlatFormMacros.h"
#include "platform/CCPlatformMacros.h"
NS_CC_BEGIN

View File

@ -38,5 +38,6 @@
+ (id) sharedAccelerometerDispather;
- (id) init;
- (void) addDelegate: (cocos2d::CCAccelerometerDelegate *) delegate;
- (void) setAccelerometerInterval:(float)interval;
@end

View File

@ -68,6 +68,11 @@ static AccelerometerDispatcher* s_pAccelerometerDispatcher;
}
}
-(void) setAccelerometerInterval:(float)interval
{
[[UIAccelerometer sharedAccelerometer] setUpdateInterval:interval];
}
- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
{
if (! delegate_)

View File

@ -36,6 +36,7 @@ public:
~CCAccelerometer();
void setDelegate(CCAccelerometerDelegate* pDelegate);
void setAccelerometerInterval(float interval);
};
NS_CC_END

View File

@ -40,5 +40,10 @@ void CCAccelerometer::setDelegate(CCAccelerometerDelegate* pDelegate)
[[AccelerometerDispatcher sharedAccelerometerDispather] addDelegate:pDelegate];
}
void CCAccelerometer::setAccelerometerInterval(float interval)
{
[[AccelerometerDispatcher sharedAccelerometerDispather] setAccelerometerInterval:interval];
}
NS_CC_END

View File

@ -263,7 +263,7 @@ static EAGLView *view = 0;
cocos2d::CCSize size;
size.width = size_.width;
size.height = size_.height;
cocos2d::CCDirector::sharedDirector()->reshapeProjection(size);
//cocos2d::CCDirector::sharedDirector()->reshapeProjection(size);
// Avoid flicker. Issue #350
//[director performSelectorOnMainThread:@selector(drawScene) withObject:nil waitUntilDone:YES];

View File

@ -261,6 +261,15 @@ void CCEGLView::setViewPortInPoints(float x , float y , float w , float h)
(GLsizei)(h * m_fScaleY * m_fFrameZoomFactor));
}
void CCEGLView::setScissorInPoints(float x , float y , float w , float h)
{
glScissor((GLint)(x * m_fScaleX * m_fFrameZoomFactor + m_obViewPortRect.origin.x * m_fFrameZoomFactor),
(GLint)(y * m_fScaleY * m_fFrameZoomFactor + m_obViewPortRect.origin.y * m_fFrameZoomFactor),
(GLsizei)(w * m_fScaleX * m_fFrameZoomFactor),
(GLsizei)(h * m_fScaleY * m_fFrameZoomFactor));
}
bool CCEGLView::isOpenGLReady()
{
return bIsInit;

View File

@ -33,6 +33,8 @@ public:
*/
virtual void setFrameSize(float width, float height);
virtual void setViewPortInPoints(float x , float y , float w , float h);
virtual void setScissorInPoints(float x , float y , float w , float h);
/*
* Set zoom factor for frame. This method is for debugging big resolution (e.g.new ipad) app on desktop.
*/

View File

@ -49,6 +49,7 @@ public:
* Set opengl view port rectangle with points.
*/
virtual void setViewPortInPoints(float x , float y , float w , float h);
virtual void setScissorInPoints(float x , float y , float w , float h);
virtual void setIMEKeyboardState(bool bOpen);
virtual void setMultiTouchMask(bool mask);

View File

@ -98,6 +98,16 @@ void CCEGLView::setViewPortInPoints(float x , float y , float w , float h)
(GLsizei)(h * m_fScaleY * frameZoomFactor));
}
void CCEGLView::setScissorInPoints(float x , float y , float w , float h)
{
float frameZoomFactor = [[EAGLView sharedEGLView] frameZoomFactor];
glScissor((GLint)(x * m_fScaleX * frameZoomFactor + m_obViewPortRect.origin.x * frameZoomFactor),
(GLint)(y * m_fScaleY * frameZoomFactor + m_obViewPortRect.origin.y * frameZoomFactor),
(GLsizei)(w * m_fScaleX * frameZoomFactor),
(GLsizei)(h * m_fScaleY * frameZoomFactor));
}
void CCEGLView::setMultiTouchMask(bool mask)
{
//EAGLView *glView = [EAGLView sharedEGLView];

View File

@ -158,7 +158,7 @@ static EAGLView *view;
cocos2d::CCDirector *director = cocos2d::CCDirector::sharedDirector();
CGSize size = NSSizeToCGSize(rect.size);
cocos2d::CCSize ccsize = cocos2d::CCSizeMake(size.width, size.height);
director->reshapeProjection(ccsize);
//director->reshapeProjection(ccsize);
// avoid flicker
director->drawScene();

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -55,34 +55,32 @@
#include <sys/types.h>
#include <time.h>
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \
!defined(__CYGWIN__) || defined(__MINGW32__)
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__))
/* The check above prevents the winsock2 inclusion if winsock.h already was
included, since they can't co-exist without problems */
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
#else
#endif
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
libc5-based Linux systems. Only include it on system that are known to
libc5-based Linux systems. Only include it on systems that are known to
require it! */
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
defined(ANDROID) || \
defined(ANDROID) || defined(__ANDROID__) || \
(defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
#include <sys/select.h>
#endif
#ifndef _WIN32_WCE
#if !defined(WIN32) && !defined(_WIN32_WCE)
#include <sys/socket.h>
#endif
#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
#include <sys/time.h>
#endif
#include <sys/types.h>
#endif
#ifdef __BEOS__
#include <support/SupportDefs.h>
@ -122,7 +120,7 @@ typedef void CURL;
#ifndef curl_socket_typedef
/* socket typedef */
#ifdef WIN32
#if defined(WIN32) && !defined(__LWIP_OPT_H__)
typedef SOCKET curl_socket_t;
#define CURL_SOCKET_BAD INVALID_SOCKET
#else
@ -189,10 +187,10 @@ typedef int (*curl_progress_callback)(void *clientp,
#define CURL_MAX_HTTP_HEADER (100*1024)
#endif
/* This is a magic return code for the write callback that, when returned,
will signal libcurl to pause receiving on the current transfer. */
#define CURL_WRITEFUNC_PAUSE 0x10000001
typedef size_t (*curl_write_callback)(char *buffer,
size_t size,
size_t nitems,
@ -315,6 +313,13 @@ typedef enum {
CURLSOCKTYPE_LAST /* never use */
} curlsocktype;
/* The return code from the sockopt_callback can signal information back
to libcurl: */
#define CURL_SOCKOPT_OK 0
#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return
CURLE_ABORTED_BY_CALLBACK */
#define CURL_SOCKOPT_ALREADY_CONNECTED 2
typedef int (*curl_sockopt_callback)(void *clientp,
curl_socket_t curlfd,
curlsocktype purpose);
@ -334,6 +339,9 @@ typedef curl_socket_t
curlsocktype purpose,
struct curl_sockaddr *address);
typedef int
(*curl_closesocket_callback)(void *clientp, curl_socket_t item);
typedef enum {
CURLIOE_OK, /* I/O operation successful */
CURLIOE_UNKNOWNCMD, /* command was unknown to callback */
@ -394,7 +402,8 @@ typedef enum {
CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
CURLE_FAILED_INIT, /* 2 */
CURLE_URL_MALFORMAT, /* 3 */
CURLE_OBSOLETE4, /* 4 - NOT USED */
CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for
7.17.0, reused in April 2011 for 7.21.5] */
CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
CURLE_COULDNT_RESOLVE_HOST, /* 6 */
CURLE_COULDNT_CONNECT, /* 7 */
@ -402,9 +411,12 @@ typedef enum {
CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
due to lack of access - when login fails
this is not returned. */
CURLE_OBSOLETE10, /* 10 - NOT USED */
CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for
7.15.4, reused in Dec 2011 for 7.24.0]*/
CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
CURLE_OBSOLETE12, /* 12 - NOT USED */
CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server
[was obsoleted in August 2007 for 7.17.0,
reused in Dec 2011 for 7.24.0]*/
CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
CURLE_FTP_CANT_GET_HOST, /* 15 */
@ -444,7 +456,7 @@ typedef enum {
CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
CURLE_OBSOLETE46, /* 46 - NOT USED */
CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */
CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */
CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */
CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */
CURLE_OBSOLETE50, /* 50 - NOT USED */
CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
@ -459,7 +471,7 @@ typedef enum {
CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */
CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
@ -499,17 +511,24 @@ typedef enum {
7.19.0) */
CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */
CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */
CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Identifiers */
CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */
CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */
CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */
CURL_LAST /* never use! */
} CURLcode;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
the obsolete stuff removed! */
/* Backwards compatibility with older names */
/* Previously obsoletes error codes re-used in 7.24.0 */
#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED
#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT
/* compatibility with older names */
#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING
/* The following were added in 7.21.5, April 2011 */
#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION
/* The following were added in 7.17.1 */
/* These are scheduled to disappear by 2009 */
@ -517,7 +536,7 @@ typedef enum {
/* The following were added in 7.17.0 */
/* These are scheduled to disappear by 2009 */
#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* noone should be using this! */
#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */
#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46
#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44
#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10
@ -529,7 +548,7 @@ typedef enum {
#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40
#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24
#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57
#define CURLE_URL_MALFORMAT_USER CURLE_OBSOLETE4
#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN
#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED
#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE
@ -579,17 +598,32 @@ typedef enum {
in 7.18.0 */
} curl_proxytype; /* this enum was added in 7.10 */
#define CURLAUTH_NONE 0 /* nothing */
#define CURLAUTH_BASIC (1<<0) /* Basic (default) */
#define CURLAUTH_DIGEST (1<<1) /* Digest */
#define CURLAUTH_GSSNEGOTIATE (1<<2) /* GSS-Negotiate */
#define CURLAUTH_NTLM (1<<3) /* NTLM */
#define CURLAUTH_DIGEST_IE (1<<4) /* Digest with IE flavour */
#define CURLAUTH_ONLY (1<<31) /* used together with a single other
type to force no auth or just that
single type */
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) /* all fine types set */
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
/*
* Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:
*
* CURLAUTH_NONE - No HTTP authentication
* CURLAUTH_BASIC - HTTP Basic authentication (default)
* CURLAUTH_DIGEST - HTTP Digest authentication
* CURLAUTH_GSSNEGOTIATE - HTTP GSS-Negotiate authentication
* CURLAUTH_NTLM - HTTP NTLM authentication
* CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour
* CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper
* CURLAUTH_ONLY - Use together with a single other type to force no
* authentication or just that single type
* CURLAUTH_ANY - All fine types set
* CURLAUTH_ANYSAFE - All fine types except Basic
*/
#define CURLAUTH_NONE ((unsigned long)0)
#define CURLAUTH_BASIC (((unsigned long)1)<<0)
#define CURLAUTH_DIGEST (((unsigned long)1)<<1)
#define CURLAUTH_GSSNEGOTIATE (((unsigned long)1)<<2)
#define CURLAUTH_NTLM (((unsigned long)1)<<3)
#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)
#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)
#define CURLAUTH_ONLY (((unsigned long)1)<<31)
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */
#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */
@ -599,6 +633,10 @@ typedef enum {
#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */
#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
#define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */
#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */
#define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */
#define CURL_ERROR_SIZE 256
struct curl_khkey {
@ -649,6 +687,15 @@ typedef enum {
CURLUSESSL_LAST /* not an option, never use */
} curl_usessl;
/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */
/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the
name of improving interoperability with older servers. Some SSL libraries
have introduced work-arounds for this flaw but those work-arounds sometimes
make the SSL communication fail. To regain functionality with those broken
servers, a user can this way allow the vulnerability back. */
#define CURLSSLOPT_ALLOW_BEAST (1<<0)
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
the obsolete stuff removed! */
@ -743,7 +790,7 @@ typedef enum {
#endif
#ifdef CURL_ISOCPP
#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number
#define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu
#else
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
#define LONG CURLOPTTYPE_LONG
@ -901,9 +948,7 @@ typedef enum {
/* send linked-list of post-transfer QUOTE commands */
CINIT(POSTQUOTE, OBJECTPOINT, 39),
/* Pass a pointer to string of the output using full variable-replacement
as described elsewhere. */
CINIT(WRITEINFO, OBJECTPOINT, 40),
CINIT(WRITEINFO, OBJECTPOINT, 40), /* DEPRECATED, do not use! */
CINIT(VERBOSE, LONG, 41), /* talk a lot */
CINIT(HEADER, LONG, 42), /* throw the header out too */
@ -912,7 +957,7 @@ typedef enum {
CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */
CINIT(UPLOAD, LONG, 46), /* this is an upload */
CINIT(POST, LONG, 47), /* HTTP POST method */
CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */
CINIT(DIRLISTONLY, LONG, 48), /* bare names when listing directories */
CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
@ -979,9 +1024,7 @@ typedef enum {
/* Max amount of cached alive connections */
CINIT(MAXCONNECTS, LONG, 71),
/* What policy to use when closing connections when the cache is filled
up */
CINIT(CLOSEPOLICY, LONG, 72),
CINIT(CLOSEPOLICY, LONG, 72), /* DEPRECATED, do not use! */
/* 73 = OBSOLETE */
@ -1055,7 +1098,7 @@ typedef enum {
CINIT(SSLENGINE_DEFAULT, LONG, 90),
/* Non-zero value means to use the global dns cache */
CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */
CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */
/* DNS cache timeout */
CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
@ -1092,8 +1135,9 @@ typedef enum {
CINIT(PROXYTYPE, LONG, 101),
/* Set the Accept-Encoding string. Use this to tell a server you would like
the response to be compressed. */
CINIT(ENCODING, OBJECTPOINT, 102),
the response to be compressed. Before 7.21.6, this was known as
CURLOPT_ENCODING */
CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102),
/* Set pointer to private data */
CINIT(PRIVATE, OBJECTPOINT, 103),
@ -1106,8 +1150,8 @@ typedef enum {
and password to whatever host the server decides. */
CINIT(UNRESTRICTED_AUTH, LONG, 105),
/* Specifically switch on or off the FTP engine's use of the EPRT command ( it
also disables the LPRT attempt). By default, those ones will always be
/* Specifically switch on or off the FTP engine's use of the EPRT command (
it also disables the LPRT attempt). By default, those ones will always be
attempted before the good old traditional PORT command. */
CINIT(FTP_USE_EPRT, LONG, 106),
@ -1451,6 +1495,46 @@ typedef enum {
/* Set authentication type for authenticated TLS */
CINIT(TLSAUTH_TYPE, OBJECTPOINT, 206),
/* Set to 1 to enable the "TE:" header in HTTP requests to ask for
compressed transfer-encoded responses. Set to 0 to disable the use of TE:
in outgoing requests. The current default is 0, but it might change in a
future libcurl release.
libcurl will ask for the compressed methods it knows of, and if that
isn't any, it will not ask for transfer-encoding at all even if this
option is set to 1.
*/
CINIT(TRANSFER_ENCODING, LONG, 207),
/* Callback function for closing socket (instead of close(2)). The callback
should have type curl_closesocket_callback */
CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208),
CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209),
/* allow GSSAPI credential delegation */
CINIT(GSSAPI_DELEGATION, LONG, 210),
/* Set the name servers to use for DNS resolution */
CINIT(DNS_SERVERS, OBJECTPOINT, 211),
/* Time-out accept operations (currently for FTP only) after this amount
of miliseconds. */
CINIT(ACCEPTTIMEOUT_MS, LONG, 212),
/* Set TCP keepalive */
CINIT(TCP_KEEPALIVE, LONG, 213),
/* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */
CINIT(TCP_KEEPIDLE, LONG, 214),
CINIT(TCP_KEEPINTVL, LONG, 215),
/* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */
CINIT(SSL_OPTIONS, LONG, 216),
/* set the SMTP auth originator */
CINIT(MAIL_AUTH, OBJECTPOINT, 217),
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
@ -1554,13 +1638,16 @@ enum CURL_TLSAUTH {
};
/* symbols to use with CURLOPT_POSTREDIR.
CURL_REDIR_POST_301 and CURL_REDIR_POST_302 can be bitwise ORed so that
CURL_REDIR_POST_301 | CURL_REDIR_POST_302 == CURL_REDIR_POST_ALL */
CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303
can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302
| CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */
#define CURL_REDIR_GET_ALL 0
#define CURL_REDIR_POST_301 1
#define CURL_REDIR_POST_302 2
#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302)
#define CURL_REDIR_POST_303 4
#define CURL_REDIR_POST_ALL \
(CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
typedef enum {
CURL_TIMECOND_NONE,
@ -1679,7 +1766,8 @@ CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
* Should return the buffer length passed to it as the argument "len" on
* success.
*/
typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len);
typedef size_t (*curl_formget_callback)(void *arg, const char *buf,
size_t len);
/*
* NAME curl_formget()
@ -1978,8 +2066,9 @@ typedef enum {
CURLSHE_BAD_OPTION, /* 1 */
CURLSHE_IN_USE, /* 2 */
CURLSHE_INVALID, /* 3 */
CURLSHE_NOMEM, /* out of memory */
CURLSHE_LAST /* never use */
CURLSHE_NOMEM, /* 4 out of memory */
CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */
CURLSHE_LAST /* never use */
} CURLSHcode;
typedef enum {
@ -2059,8 +2148,9 @@ typedef struct {
#define CURL_VERSION_CONV (1<<12) /* character conversions supported */
#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */
#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */
#define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegating to winbind helper */
/*
/*
* NAME curl_version_info()
*
* DESCRIPTION

View File

@ -8,7 +8,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2009, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -59,52 +59,52 @@
/* ================================================================ */
#ifdef CURL_SIZEOF_LONG
# error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
#error "CURL_SIZEOF_LONG shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_SIZEOF_LONG_already_defined
#endif
#ifdef CURL_TYPEOF_CURL_SOCKLEN_T
# error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
#error "CURL_TYPEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_already_defined
#endif
#ifdef CURL_SIZEOF_CURL_SOCKLEN_T
# error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
#error "CURL_SIZEOF_CURL_SOCKLEN_T shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_already_defined
#endif
#ifdef CURL_TYPEOF_CURL_OFF_T
# error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
#error "CURL_TYPEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_already_defined
#endif
#ifdef CURL_FORMAT_CURL_OFF_T
# error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
#error "CURL_FORMAT_CURL_OFF_T shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_already_defined
#endif
#ifdef CURL_FORMAT_CURL_OFF_TU
# error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
#error "CURL_FORMAT_CURL_OFF_TU shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_already_defined
#endif
#ifdef CURL_FORMAT_OFF_T
# error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
#error "CURL_FORMAT_OFF_T shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_FORMAT_OFF_T_already_defined
#endif
#ifdef CURL_SIZEOF_CURL_OFF_T
# error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
#error "CURL_SIZEOF_CURL_OFF_T shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_already_defined
#endif
#ifdef CURL_SUFFIX_CURL_OFF_T
# error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
#error "CURL_SUFFIX_CURL_OFF_T shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_already_defined
#endif
#ifdef CURL_SUFFIX_CURL_OFF_TU
# error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
#error "CURL_SUFFIX_CURL_OFF_TU shall not be defined except in curlbuild.h"
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_already_defined
#endif

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -26,17 +26,17 @@
a script at release-time. This was made its own header file in 7.11.2 */
/* This is the global package copyright */
#define LIBCURL_COPYRIGHT "1996 - 2010 Daniel Stenberg, <daniel@haxx.se>."
#define LIBCURL_COPYRIGHT "1996 - 2012 Daniel Stenberg, <daniel@haxx.se>."
/* This is the version number of the libcurl package from which this header
file origins: */
#define LIBCURL_VERSION "7.21.4"
#define LIBCURL_VERSION "7.26.0"
/* The numeric version number is also available "in parts" by using these
defines: */
#define LIBCURL_VERSION_MAJOR 7
#define LIBCURL_VERSION_MINOR 21
#define LIBCURL_VERSION_PATCH 4
#define LIBCURL_VERSION_MINOR 26
#define LIBCURL_VERSION_PATCH 0
/* This is the numeric version of the libcurl version number, meant for easier
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
@ -53,7 +53,7 @@
and it is always a greater number in a more recent release. It makes
comparisons with greater than and less than work.
*/
#define LIBCURL_VERSION_NUM 0x071504
#define LIBCURL_VERSION_NUM 0x071a00
/*
* This is the date and time when the full source package was created. The
@ -64,6 +64,6 @@
*
* "Mon Feb 12 11:35:33 UTC 2007"
*/
#define LIBCURL_TIMESTAMP "Thu Feb 17 12:19:40 UTC 2011"
#define LIBCURL_TIMESTAMP "Thu May 24 16:05:42 UTC 2012"
#endif /* __CURL_CURLVER_H */

View File

@ -53,8 +53,8 @@ CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
*
* Creates a new curl session handle with the same options set for the handle
* passed in. Duplicating a handle could only be a matter of cloning data and
* options, internal state info and things like persistant connections cannot
* be transfered. It is useful in multithreaded applications when you can run
* options, internal state info and things like persistent connections cannot
* be transferred. It is useful in multithreaded applications when you can run
* curl_easy_duphandle() for each new thread to avoid a series of identical
* curl_easy_setopt() invokes in every thread.
*/

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -41,66 +41,66 @@
#define curl_easy_setopt(handle, option, value) \
__extension__ ({ \
__typeof__ (option) _curl_opt = option; \
if (__builtin_constant_p(_curl_opt)) { \
if (_curl_is_long_option(_curl_opt)) \
if (!_curl_is_long(value)) \
if(__builtin_constant_p(_curl_opt)) { \
if(_curl_is_long_option(_curl_opt)) \
if(!_curl_is_long(value)) \
_curl_easy_setopt_err_long(); \
if (_curl_is_off_t_option(_curl_opt)) \
if (!_curl_is_off_t(value)) \
if(_curl_is_off_t_option(_curl_opt)) \
if(!_curl_is_off_t(value)) \
_curl_easy_setopt_err_curl_off_t(); \
if (_curl_is_string_option(_curl_opt)) \
if (!_curl_is_string(value)) \
if(_curl_is_string_option(_curl_opt)) \
if(!_curl_is_string(value)) \
_curl_easy_setopt_err_string(); \
if (_curl_is_write_cb_option(_curl_opt)) \
if (!_curl_is_write_cb(value)) \
if(_curl_is_write_cb_option(_curl_opt)) \
if(!_curl_is_write_cb(value)) \
_curl_easy_setopt_err_write_callback(); \
if ((_curl_opt) == CURLOPT_READFUNCTION) \
if (!_curl_is_read_cb(value)) \
if((_curl_opt) == CURLOPT_READFUNCTION) \
if(!_curl_is_read_cb(value)) \
_curl_easy_setopt_err_read_cb(); \
if ((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
if (!_curl_is_ioctl_cb(value)) \
if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
if(!_curl_is_ioctl_cb(value)) \
_curl_easy_setopt_err_ioctl_cb(); \
if ((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
if (!_curl_is_sockopt_cb(value)) \
if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
if(!_curl_is_sockopt_cb(value)) \
_curl_easy_setopt_err_sockopt_cb(); \
if ((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
if (!_curl_is_opensocket_cb(value)) \
if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
if(!_curl_is_opensocket_cb(value)) \
_curl_easy_setopt_err_opensocket_cb(); \
if ((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
if (!_curl_is_progress_cb(value)) \
if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
if(!_curl_is_progress_cb(value)) \
_curl_easy_setopt_err_progress_cb(); \
if ((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
if (!_curl_is_debug_cb(value)) \
if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
if(!_curl_is_debug_cb(value)) \
_curl_easy_setopt_err_debug_cb(); \
if ((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
if (!_curl_is_ssl_ctx_cb(value)) \
if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
if(!_curl_is_ssl_ctx_cb(value)) \
_curl_easy_setopt_err_ssl_ctx_cb(); \
if (_curl_is_conv_cb_option(_curl_opt)) \
if (!_curl_is_conv_cb(value)) \
if(_curl_is_conv_cb_option(_curl_opt)) \
if(!_curl_is_conv_cb(value)) \
_curl_easy_setopt_err_conv_cb(); \
if ((_curl_opt) == CURLOPT_SEEKFUNCTION) \
if (!_curl_is_seek_cb(value)) \
if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
if(!_curl_is_seek_cb(value)) \
_curl_easy_setopt_err_seek_cb(); \
if (_curl_is_cb_data_option(_curl_opt)) \
if (!_curl_is_cb_data(value)) \
if(_curl_is_cb_data_option(_curl_opt)) \
if(!_curl_is_cb_data(value)) \
_curl_easy_setopt_err_cb_data(); \
if ((_curl_opt) == CURLOPT_ERRORBUFFER) \
if (!_curl_is_error_buffer(value)) \
if((_curl_opt) == CURLOPT_ERRORBUFFER) \
if(!_curl_is_error_buffer(value)) \
_curl_easy_setopt_err_error_buffer(); \
if ((_curl_opt) == CURLOPT_STDERR) \
if (!_curl_is_FILE(value)) \
if((_curl_opt) == CURLOPT_STDERR) \
if(!_curl_is_FILE(value)) \
_curl_easy_setopt_err_FILE(); \
if (_curl_is_postfields_option(_curl_opt)) \
if (!_curl_is_postfields(value)) \
if(_curl_is_postfields_option(_curl_opt)) \
if(!_curl_is_postfields(value)) \
_curl_easy_setopt_err_postfields(); \
if ((_curl_opt) == CURLOPT_HTTPPOST) \
if (!_curl_is_arr((value), struct curl_httppost)) \
if((_curl_opt) == CURLOPT_HTTPPOST) \
if(!_curl_is_arr((value), struct curl_httppost)) \
_curl_easy_setopt_err_curl_httpost(); \
if (_curl_is_slist_option(_curl_opt)) \
if (!_curl_is_arr((value), struct curl_slist)) \
if(_curl_is_slist_option(_curl_opt)) \
if(!_curl_is_arr((value), struct curl_slist)) \
_curl_easy_setopt_err_curl_slist(); \
if ((_curl_opt) == CURLOPT_SHARE) \
if (!_curl_is_ptr((value), CURLSH)) \
if((_curl_opt) == CURLOPT_SHARE) \
if(!_curl_is_ptr((value), CURLSH)) \
_curl_easy_setopt_err_CURLSH(); \
} \
curl_easy_setopt(handle, _curl_opt, value); \
@ -111,18 +111,18 @@ __extension__ ({ \
#define curl_easy_getinfo(handle, info, arg) \
__extension__ ({ \
__typeof__ (info) _curl_info = info; \
if (__builtin_constant_p(_curl_info)) { \
if (_curl_is_string_info(_curl_info)) \
if (!_curl_is_arr((arg), char *)) \
if(__builtin_constant_p(_curl_info)) { \
if(_curl_is_string_info(_curl_info)) \
if(!_curl_is_arr((arg), char *)) \
_curl_easy_getinfo_err_string(); \
if (_curl_is_long_info(_curl_info)) \
if (!_curl_is_arr((arg), long)) \
if(_curl_is_long_info(_curl_info)) \
if(!_curl_is_arr((arg), long)) \
_curl_easy_getinfo_err_long(); \
if (_curl_is_double_info(_curl_info)) \
if (!_curl_is_arr((arg), double)) \
if(_curl_is_double_info(_curl_info)) \
if(!_curl_is_arr((arg), double)) \
_curl_easy_getinfo_err_double(); \
if (_curl_is_slist_info(_curl_info)) \
if (!_curl_is_arr((arg), struct curl_slist *)) \
if(_curl_is_slist_info(_curl_info)) \
if(!_curl_is_arr((arg), struct curl_slist *)) \
_curl_easy_getinfo_err_curl_slist(); \
} \
curl_easy_getinfo(handle, _curl_info, arg); \
@ -141,15 +141,17 @@ __extension__ ({ \
/* To define a new warning, use _CURL_WARNING(identifier, "message") */
#define _CURL_WARNING(id, message) \
static void __attribute__((warning(message))) __attribute__((unused)) \
__attribute__((noinline)) id(void) { __asm__(""); }
static void __attribute__((__warning__(message))) \
__attribute__((__unused__)) __attribute__((__noinline__)) \
id(void) { __asm__(""); }
_CURL_WARNING(_curl_easy_setopt_err_long,
"curl_easy_setopt expects a long argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
"curl_easy_setopt expects a curl_off_t argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_string,
"curl_easy_setopt expects a string (char* or char[]) argument for this option"
"curl_easy_setopt expects a "
"string (char* or char[]) argument for this option"
)
_CURL_WARNING(_curl_easy_setopt_err_write_callback,
"curl_easy_setopt expects a curl_write_callback argument for this option")
@ -160,7 +162,8 @@ _CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
"curl_easy_setopt expects a curl_sockopt_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
"curl_easy_setopt expects a curl_opensocket_callback argument for this option"
"curl_easy_setopt expects a "
"curl_opensocket_callback argument for this option"
)
_CURL_WARNING(_curl_easy_setopt_err_progress_cb,
"curl_easy_setopt expects a curl_progress_callback argument for this option")
@ -173,9 +176,11 @@ _CURL_WARNING(_curl_easy_setopt_err_conv_cb,
_CURL_WARNING(_curl_easy_setopt_err_seek_cb,
"curl_easy_setopt expects a curl_seek_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_cb_data,
"curl_easy_setopt expects a private data pointer as argument for this option")
"curl_easy_setopt expects a "
"private data pointer as argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_error_buffer,
"curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option")
"curl_easy_setopt expects a "
"char buffer of CURL_ERROR_SIZE as argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_FILE,
"curl_easy_setopt expects a FILE* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_postfields,
@ -224,7 +229,7 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
(option) == CURLOPT_PROXYUSERNAME || \
(option) == CURLOPT_PROXYPASSWORD || \
(option) == CURLOPT_NOPROXY || \
(option) == CURLOPT_ENCODING || \
(option) == CURLOPT_ACCEPT_ENCODING || \
(option) == CURLOPT_REFERER || \
(option) == CURLOPT_USERAGENT || \
(option) == CURLOPT_COOKIE || \
@ -388,7 +393,8 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
/* XXX: also check size of an char[] array? */
#define _curl_is_error_buffer(expr) \
(__builtin_types_compatible_p(__typeof__(expr), char *) || \
(_curl_is_NULL(expr) || \
__builtin_types_compatible_p(__typeof__(expr), char *) || \
__builtin_types_compatible_p(__typeof__(expr), char[]))
/* evaluates to true if expr is of type (const) void* or (const) FILE* */
@ -481,7 +487,8 @@ typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
curlsocktype);
/* evaluates to true if expr is of type curl_opensocket_callback or "similar" */
/* evaluates to true if expr is of type curl_opensocket_callback or
"similar" */
#define _curl_is_opensocket_cb(expr) \
(_curl_is_NULL(expr) || \
__builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\
@ -516,7 +523,11 @@ typedef int (_curl_progress_callback2)(const void *,
_curl_callback_compatible((expr), _curl_debug_callback1) || \
_curl_callback_compatible((expr), _curl_debug_callback2) || \
_curl_callback_compatible((expr), _curl_debug_callback3) || \
_curl_callback_compatible((expr), _curl_debug_callback4))
_curl_callback_compatible((expr), _curl_debug_callback4) || \
_curl_callback_compatible((expr), _curl_debug_callback5) || \
_curl_callback_compatible((expr), _curl_debug_callback6) || \
_curl_callback_compatible((expr), _curl_debug_callback7) || \
_curl_callback_compatible((expr), _curl_debug_callback8))
typedef int (_curl_debug_callback1) (CURL *,
curl_infotype, char *, size_t, void *);
typedef int (_curl_debug_callback2) (CURL *,
@ -525,6 +536,14 @@ typedef int (_curl_debug_callback3) (CURL *,
curl_infotype, const char *, size_t, void *);
typedef int (_curl_debug_callback4) (CURL *,
curl_infotype, const char *, size_t, const void *);
typedef int (_curl_debug_callback5) (CURL *,
curl_infotype, unsigned char *, size_t, void *);
typedef int (_curl_debug_callback6) (CURL *,
curl_infotype, unsigned char *, size_t, const void *);
typedef int (_curl_debug_callback7) (CURL *,
curl_infotype, const unsigned char *, size_t, void *);
typedef int (_curl_debug_callback8) (CURL *,
curl_infotype, const unsigned char *, size_t, const void *);
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
/* this is getting even messier... */
@ -550,7 +569,8 @@ typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);
typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, const void *);
typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,
const void *);
#else
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;

View File

@ -1 +1 @@
89c49d395ece44cf2d891cd5c2a84f819e229d30
a62cf1a73b170a4fee840de349019fd33e9970f4

View File

@ -1 +1 @@
4dc0690a9f8419b4aba821eeb739d6beb4242cda
e83a0838166d5ccccc914361fc7d98f2b6e12e1e

View File

@ -1 +1 @@
fca1b81187a22728c6c352f121ac03f8abf2ae75
bfedd8e90d438c9fcf1c469fa7bb0ff2a59167af

View File

@ -1 +1 @@
68aaf2639b745d8479ad875745409f9cf65f4b93
e3bc493ab52f7a8d3da445e15f43c0c775740192

View File

@ -1 +1 @@
0319233cc1a28ea568fdc4ced57f2d1cfe11e81f
78e9ef9f9794da2d2098e733fd90ecad403ed735

View File

@ -1 +1 @@
54d8098e43887d3bb3a773542d869491d77d8e45
e8d210cb8607af7aa98219fce89ea1e6c14f8fc2

View File

@ -1 +1 @@
2f84bee7e68f8b6766688634d6a35221cd006a66
527a6e940f83b5d54b37b193af2081647cea4e90

View File

@ -1 +1 @@
67df2bca4c4bdf2c53f0ae219f55ad5efdd8dd48
7fc417297c12c4199a31febebb0e9c53abb5f762

View File

@ -1 +1 @@
03f601480de32bbcc70313b8afda1bbf0194944c
649d8a9d888a3368eeb0b63ac2832b9faebc3502

View File

@ -1 +1 @@
08568c709e115ac77d96705d4b5cb47c1f494514
ee2bf5ad51a3a637deeee985082760f9b843bbe7

View File

@ -1 +1 @@
8ae8c1465f02581e5f557c549ccbd31f77ac392e
3e4d0de19a158758f19a5b65db8b7f14c314771a

View File

@ -1 +1 @@
829ad7281999aff0543b4aca6574779ef6c48644
f14376ce9ace14d386cb5a3b2178454bad786fb6

View File

@ -1 +1 @@
813164629a16c93ebc3ff20a39072f2cae2aee3a
7a291da70df8112d8be685fd326a4171a9eff66c

View File

@ -1 +1 @@
936f891620a0dbe86ae34809f3472d57497a6098
f2063d0cb885da76b53ff7278eb34635c460d09e

View File

@ -1 +1 @@
e9908a726968236013dd4a7488211f936d1eb406
22740a73cdc408d9a8557d0f462f0a49bd29e26e

View File

@ -1,560 +0,0 @@
# Makefile.in generated by automake 1.9.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
# 2003, 2004, 2005 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
top_builddir = ../..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = include/curl
DIST_COMMON = $(pkginclude_HEADERS) $(srcdir)/Makefile.am \
$(srcdir)/Makefile.in $(srcdir)/curlbuild.h.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/curl-compilers.m4 \
$(top_srcdir)/m4/curl-confopts.m4 \
$(top_srcdir)/m4/curl-functions.m4 \
$(top_srcdir)/m4/curl-openssl.m4 \
$(top_srcdir)/m4/curl-override.m4 \
$(top_srcdir)/m4/curl-reentrant.m4 \
$(top_srcdir)/m4/curl-system.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/xc-translit.m4 $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/lib/curl_config.h \
$(top_builddir)/src/curl_config.h curlbuild.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(pkgincludedir)"
pkgincludeHEADERS_INSTALL = $(INSTALL_HEADER)
HEADERS = $(pkginclude_HEADERS)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
pkgincludedir = $(includedir)/curl
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AR = @AR@
AS = @AS@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
BUILD_LIBHOSTNAME_FALSE = @BUILD_LIBHOSTNAME_FALSE@
BUILD_LIBHOSTNAME_TRUE = @BUILD_LIBHOSTNAME_TRUE@
BUILD_UNITTESTS_FALSE = @BUILD_UNITTESTS_FALSE@
BUILD_UNITTESTS_TRUE = @BUILD_UNITTESTS_TRUE@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFIGURE_OPTIONS = @CONFIGURE_OPTIONS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CROSSCOMPILING_FALSE = @CROSSCOMPILING_FALSE@
CROSSCOMPILING_TRUE = @CROSSCOMPILING_TRUE@
CURLDEBUG_FALSE = @CURLDEBUG_FALSE@
CURLDEBUG_TRUE = @CURLDEBUG_TRUE@
CURLVERSION = @CURLVERSION@
CURL_CA_BUNDLE = @CURL_CA_BUNDLE@
CURL_CFLAG_EXTRAS = @CURL_CFLAG_EXTRAS@
CURL_DISABLE_DICT = @CURL_DISABLE_DICT@
CURL_DISABLE_FILE = @CURL_DISABLE_FILE@
CURL_DISABLE_FTP = @CURL_DISABLE_FTP@
CURL_DISABLE_GOPHER = @CURL_DISABLE_GOPHER@
CURL_DISABLE_HTTP = @CURL_DISABLE_HTTP@
CURL_DISABLE_IMAP = @CURL_DISABLE_IMAP@
CURL_DISABLE_LDAP = @CURL_DISABLE_LDAP@
CURL_DISABLE_LDAPS = @CURL_DISABLE_LDAPS@
CURL_DISABLE_POP3 = @CURL_DISABLE_POP3@
CURL_DISABLE_PROXY = @CURL_DISABLE_PROXY@
CURL_DISABLE_RTSP = @CURL_DISABLE_RTSP@
CURL_DISABLE_SMTP = @CURL_DISABLE_SMTP@
CURL_DISABLE_TELNET = @CURL_DISABLE_TELNET@
CURL_DISABLE_TFTP = @CURL_DISABLE_TFTP@
CURL_LIBS = @CURL_LIBS@
CURL_NETWORK_LIBS = @CURL_NETWORK_LIBS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
ENABLE_SHARED = @ENABLE_SHARED@
EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
HAVE_GNUTLS_SRP = @HAVE_GNUTLS_SRP@
HAVE_LDAP_SSL = @HAVE_LDAP_SSL@
HAVE_LIBZ = @HAVE_LIBZ@
HAVE_LIBZ_FALSE = @HAVE_LIBZ_FALSE@
HAVE_LIBZ_TRUE = @HAVE_LIBZ_TRUE@
HAVE_PK11_CREATEGENERICOBJECT = @HAVE_PK11_CREATEGENERICOBJECT@
HAVE_SSLEAY_SRP = @HAVE_SSLEAY_SRP@
IDN_ENABLED = @IDN_ENABLED@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
IPV6_ENABLED = @IPV6_ENABLED@
KRB4_ENABLED = @KRB4_ENABLED@
LD = @LD@
LDFLAGS = @LDFLAGS@
LIBCURL_LIBS = @LIBCURL_LIBS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MANOPT = @MANOPT@
MIMPURE_FALSE = @MIMPURE_FALSE@
MIMPURE_TRUE = @MIMPURE_TRUE@
NM = @NM@
NMEDIT = @NMEDIT@
NO_UNDEFINED_FALSE = @NO_UNDEFINED_FALSE@
NO_UNDEFINED_TRUE = @NO_UNDEFINED_TRUE@
NROFF = @NROFF@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH = @PATH@
PATH_SEPARATOR = @PATH_SEPARATOR@
PERL = @PERL@
PKGADD_NAME = @PKGADD_NAME@
PKGADD_PKG = @PKGADD_PKG@
PKGADD_VENDOR = @PKGADD_VENDOR@
PKGCONFIG = @PKGCONFIG@
RANDOM_FILE = @RANDOM_FILE@
RANLIB = @RANLIB@
REQUIRE_LIB_DEPS = @REQUIRE_LIB_DEPS@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SONAME_BUMP_FALSE = @SONAME_BUMP_FALSE@
SONAME_BUMP_TRUE = @SONAME_BUMP_TRUE@
SSL_ENABLED = @SSL_ENABLED@
STATICLIB_FALSE = @STATICLIB_FALSE@
STATICLIB_TRUE = @STATICLIB_TRUE@
STRIP = @STRIP@
SUPPORT_FEATURES = @SUPPORT_FEATURES@
SUPPORT_PROTOCOLS = @SUPPORT_PROTOCOLS@
TEST_SERVER_LIBS = @TEST_SERVER_LIBS@
USE_ARES = @USE_ARES@
USE_AXTLS = @USE_AXTLS@
USE_CYASSL = @USE_CYASSL@
USE_EMBEDDED_ARES_FALSE = @USE_EMBEDDED_ARES_FALSE@
USE_EMBEDDED_ARES_TRUE = @USE_EMBEDDED_ARES_TRUE@
USE_GNUTLS = @USE_GNUTLS@
USE_LIBRTMP = @USE_LIBRTMP@
USE_LIBSSH2 = @USE_LIBSSH2@
USE_MANUAL_FALSE = @USE_MANUAL_FALSE@
USE_MANUAL_TRUE = @USE_MANUAL_TRUE@
USE_NSS = @USE_NSS@
USE_OPENLDAP = @USE_OPENLDAP@
USE_POLARSSL = @USE_POLARSSL@
USE_SSLEAY = @USE_SSLEAY@
USE_WINDOWS_SSPI = @USE_WINDOWS_SSPI@
VERSION = @VERSION@
VERSIONNUM = @VERSIONNUM@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
libext = @libext@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
subdirs = @subdirs@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at http://curl.haxx.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
###########################################################################
pkginclude_HEADERS = \
curl.h curlver.h easy.h mprintf.h stdcheaders.h multi.h \
typecheck-gcc.h curlbuild.h curlrules.h
# curlbuild.h does not exist in the git tree. When the original libcurl
# source code distribution archive file is created, curlbuild.h.dist is
# renamed to curlbuild.h and included in the tarball so that it can be
# used directly on non-configure systems.
#
# The distributed curlbuild.h will be overwritten on configure systems
# when the configure script runs, with one that is suitable and specific
# to the library being configured and built.
#
# curlbuild.h.in is the distributed template file from which the configure
# script creates curlbuild.h at library configuration time, overwiting the
# one included in the distribution archive.
#
# curlbuild.h.dist is not included in the source code distribution archive.
EXTRA_DIST = curlbuild.h.in
DISTCLEANFILES = curlbuild.h
all: curlbuild.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign include/curl/Makefile'; \
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign include/curl/Makefile
.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
curlbuild.h: stamp-h3
@if test ! -f $@; then \
rm -f stamp-h3; \
$(MAKE) stamp-h3; \
else :; fi
stamp-h3: $(srcdir)/curlbuild.h.in $(top_builddir)/config.status
@rm -f stamp-h3
cd $(top_builddir) && $(SHELL) ./config.status include/curl/curlbuild.h
$(srcdir)/curlbuild.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h3
touch $@
distclean-hdr:
-rm -f curlbuild.h stamp-h3
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool
uninstall-info-am:
install-pkgincludeHEADERS: $(pkginclude_HEADERS)
@$(NORMAL_INSTALL)
test -z "$(pkgincludedir)" || $(mkdir_p) "$(DESTDIR)$(pkgincludedir)"
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
f=$(am__strip_dir) \
echo " $(pkgincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgincludedir)/$$f'"; \
$(pkgincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgincludedir)/$$f"; \
done
uninstall-pkgincludeHEADERS:
@$(NORMAL_UNINSTALL)
@list='$(pkginclude_HEADERS)'; for p in $$list; do \
f=$(am__strip_dir) \
echo " rm -f '$(DESTDIR)$(pkgincludedir)/$$f'"; \
rm -f "$(DESTDIR)$(pkgincludedir)/$$f"; \
done
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
tags: TAGS
TAGS: $(HEADERS) $(SOURCES) curlbuild.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) curlbuild.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique; \
fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) curlbuild.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) curlbuild.h.in $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkdir_p) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
@CURLDEBUG_FALSE@all-local:
all-am: Makefile $(HEADERS) curlbuild.h all-local
installdirs:
for dir in "$(DESTDIR)$(pkgincludedir)"; do \
test -z "$$dir" || $(mkdir_p) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr \
distclean-libtool distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
info: info-am
info-am:
install-data-am: install-pkgincludeHEADERS
install-exec-am:
install-info: install-info-am
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-info-am uninstall-pkgincludeHEADERS
.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \
clean-generic clean-libtool ctags distclean distclean-generic \
distclean-hdr distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-exec install-exec-am \
install-info install-info-am install-man \
install-pkgincludeHEADERS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-info-am uninstall-pkgincludeHEADERS
checksrc:
@@PERL@ $(top_srcdir)/lib/checksrc.pl -Wcurlbuild.h -D$(top_srcdir)/include/curl $(pkginclude_HEADERS) $(EXTRA_DIST)
# for debug builds, we scan the sources on all regular make invokes
@CURLDEBUG_TRUE@all-local: checksrc
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -55,34 +55,32 @@
#include <sys/types.h>
#include <time.h>
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \
!defined(__CYGWIN__) || defined(__MINGW32__)
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__))
/* The check above prevents the winsock2 inclusion if winsock.h already was
included, since they can't co-exist without problems */
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
#else
#endif
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
libc5-based Linux systems. Only include it on system that are known to
libc5-based Linux systems. Only include it on systems that are known to
require it! */
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
defined(ANDROID) || \
defined(ANDROID) || defined(__ANDROID__) || \
(defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
#include <sys/select.h>
#endif
#ifndef _WIN32_WCE
#if !defined(WIN32) && !defined(_WIN32_WCE)
#include <sys/socket.h>
#endif
#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
#include <sys/time.h>
#endif
#include <sys/types.h>
#endif
#ifdef __BEOS__
#include <support/SupportDefs.h>
@ -122,7 +120,7 @@ typedef void CURL;
#ifndef curl_socket_typedef
/* socket typedef */
#ifdef WIN32
#if defined(WIN32) && !defined(__LWIP_OPT_H__)
typedef SOCKET curl_socket_t;
#define CURL_SOCKET_BAD INVALID_SOCKET
#else
@ -189,10 +187,10 @@ typedef int (*curl_progress_callback)(void *clientp,
#define CURL_MAX_HTTP_HEADER (100*1024)
#endif
/* This is a magic return code for the write callback that, when returned,
will signal libcurl to pause receiving on the current transfer. */
#define CURL_WRITEFUNC_PAUSE 0x10000001
typedef size_t (*curl_write_callback)(char *buffer,
size_t size,
size_t nitems,
@ -413,9 +411,12 @@ typedef enum {
CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
due to lack of access - when login fails
this is not returned. */
CURLE_OBSOLETE10, /* 10 - NOT USED */
CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for
7.15.4, reused in Dec 2011 for 7.24.0]*/
CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
CURLE_OBSOLETE12, /* 12 - NOT USED */
CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server
[was obsoleted in August 2007 for 7.17.0,
reused in Dec 2011 for 7.24.0]*/
CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
CURLE_FTP_CANT_GET_HOST, /* 15 */
@ -513,13 +514,16 @@ typedef enum {
CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */
CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */
CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */
CURL_LAST /* never use! */
} CURLcode;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
the obsolete stuff removed! */
/* Previously obsoletes error codes re-used in 7.24.0 */
#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED
#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT
/* compatibility with older names */
#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING
@ -594,17 +598,32 @@ typedef enum {
in 7.18.0 */
} curl_proxytype; /* this enum was added in 7.10 */
#define CURLAUTH_NONE 0 /* nothing */
#define CURLAUTH_BASIC (1<<0) /* Basic (default) */
#define CURLAUTH_DIGEST (1<<1) /* Digest */
#define CURLAUTH_GSSNEGOTIATE (1<<2) /* GSS-Negotiate */
#define CURLAUTH_NTLM (1<<3) /* NTLM */
#define CURLAUTH_DIGEST_IE (1<<4) /* Digest with IE flavour */
#define CURLAUTH_ONLY (1<<31) /* used together with a single other
type to force no auth or just that
single type */
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) /* all fine types set */
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
/*
* Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:
*
* CURLAUTH_NONE - No HTTP authentication
* CURLAUTH_BASIC - HTTP Basic authentication (default)
* CURLAUTH_DIGEST - HTTP Digest authentication
* CURLAUTH_GSSNEGOTIATE - HTTP GSS-Negotiate authentication
* CURLAUTH_NTLM - HTTP NTLM authentication
* CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour
* CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper
* CURLAUTH_ONLY - Use together with a single other type to force no
* authentication or just that single type
* CURLAUTH_ANY - All fine types set
* CURLAUTH_ANYSAFE - All fine types except Basic
*/
#define CURLAUTH_NONE ((unsigned long)0)
#define CURLAUTH_BASIC (((unsigned long)1)<<0)
#define CURLAUTH_DIGEST (((unsigned long)1)<<1)
#define CURLAUTH_GSSNEGOTIATE (((unsigned long)1)<<2)
#define CURLAUTH_NTLM (((unsigned long)1)<<3)
#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)
#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)
#define CURLAUTH_ONLY (((unsigned long)1)<<31)
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */
#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */
@ -614,6 +633,10 @@ typedef enum {
#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */
#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
#define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */
#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */
#define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */
#define CURL_ERROR_SIZE 256
struct curl_khkey {
@ -664,6 +687,15 @@ typedef enum {
CURLUSESSL_LAST /* not an option, never use */
} curl_usessl;
/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */
/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the
name of improving interoperability with older servers. Some SSL libraries
have introduced work-arounds for this flaw but those work-arounds sometimes
make the SSL communication fail. To regain functionality with those broken
servers, a user can this way allow the vulnerability back. */
#define CURLSSLOPT_ALLOW_BEAST (1<<0)
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
the obsolete stuff removed! */
@ -916,9 +948,7 @@ typedef enum {
/* send linked-list of post-transfer QUOTE commands */
CINIT(POSTQUOTE, OBJECTPOINT, 39),
/* Pass a pointer to string of the output using full variable-replacement
as described elsewhere. */
CINIT(WRITEINFO, OBJECTPOINT, 40),
CINIT(WRITEINFO, OBJECTPOINT, 40), /* DEPRECATED, do not use! */
CINIT(VERBOSE, LONG, 41), /* talk a lot */
CINIT(HEADER, LONG, 42), /* throw the header out too */
@ -994,8 +1024,7 @@ typedef enum {
/* Max amount of cached alive connections */
CINIT(MAXCONNECTS, LONG, 71),
/* 72 - DEPRECATED */
CINIT(CLOSEPOLICY, LONG, 72),
CINIT(CLOSEPOLICY, LONG, 72), /* DEPRECATED, do not use! */
/* 73 = OBSOLETE */
@ -1069,7 +1098,7 @@ typedef enum {
CINIT(SSLENGINE_DEFAULT, LONG, 90),
/* Non-zero value means to use the global dns cache */
CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */
CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */
/* DNS cache timeout */
CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
@ -1483,6 +1512,29 @@ typedef enum {
CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208),
CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209),
/* allow GSSAPI credential delegation */
CINIT(GSSAPI_DELEGATION, LONG, 210),
/* Set the name servers to use for DNS resolution */
CINIT(DNS_SERVERS, OBJECTPOINT, 211),
/* Time-out accept operations (currently for FTP only) after this amount
of miliseconds. */
CINIT(ACCEPTTIMEOUT_MS, LONG, 212),
/* Set TCP keepalive */
CINIT(TCP_KEEPALIVE, LONG, 213),
/* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */
CINIT(TCP_KEEPIDLE, LONG, 214),
CINIT(TCP_KEEPINTVL, LONG, 215),
/* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */
CINIT(SSL_OPTIONS, LONG, 216),
/* set the SMTP auth originator */
CINIT(MAIL_AUTH, OBJECTPOINT, 217),
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
@ -1586,13 +1638,16 @@ enum CURL_TLSAUTH {
};
/* symbols to use with CURLOPT_POSTREDIR.
CURL_REDIR_POST_301 and CURL_REDIR_POST_302 can be bitwise ORed so that
CURL_REDIR_POST_301 | CURL_REDIR_POST_302 == CURL_REDIR_POST_ALL */
CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303
can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302
| CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */
#define CURL_REDIR_GET_ALL 0
#define CURL_REDIR_POST_301 1
#define CURL_REDIR_POST_302 2
#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302)
#define CURL_REDIR_POST_303 4
#define CURL_REDIR_POST_ALL \
(CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
typedef enum {
CURL_TIMECOND_NONE,
@ -2011,8 +2066,9 @@ typedef enum {
CURLSHE_BAD_OPTION, /* 1 */
CURLSHE_IN_USE, /* 2 */
CURLSHE_INVALID, /* 3 */
CURLSHE_NOMEM, /* out of memory */
CURLSHE_LAST /* never use */
CURLSHE_NOMEM, /* 4 out of memory */
CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */
CURLSHE_LAST /* never use */
} CURLSHcode;
typedef enum {
@ -2092,8 +2148,9 @@ typedef struct {
#define CURL_VERSION_CONV (1<<12) /* character conversions supported */
#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */
#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */
#define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegating to winbind helper */
/*
/*
* NAME curl_version_info()
*
* DESCRIPTION

View File

@ -153,13 +153,7 @@
#endif
/* The size of `long', as computed by sizeof. */
//#define CURL_SIZEOF_LONG 4
#ifdef __LP64__
#define CURL_SIZEOF_LONG 8
#else
#define CURL_SIZEOF_LONG 4
#endif
/* Integral data type used for curl_socklen_t. */
#define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -26,17 +26,17 @@
a script at release-time. This was made its own header file in 7.11.2 */
/* This is the global package copyright */
#define LIBCURL_COPYRIGHT "1996 - 2011 Daniel Stenberg, <daniel@haxx.se>."
#define LIBCURL_COPYRIGHT "1996 - 2012 Daniel Stenberg, <daniel@haxx.se>."
/* This is the version number of the libcurl package from which this header
file origins: */
#define LIBCURL_VERSION "7.21.7"
#define LIBCURL_VERSION "7.26.0"
/* The numeric version number is also available "in parts" by using these
defines: */
#define LIBCURL_VERSION_MAJOR 7
#define LIBCURL_VERSION_MINOR 21
#define LIBCURL_VERSION_PATCH 7
#define LIBCURL_VERSION_MINOR 26
#define LIBCURL_VERSION_PATCH 0
/* This is the numeric version of the libcurl version number, meant for easier
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
@ -53,7 +53,7 @@
and it is always a greater number in a more recent release. It makes
comparisons with greater than and less than work.
*/
#define LIBCURL_VERSION_NUM 0x071507
#define LIBCURL_VERSION_NUM 0x071a00
/*
* This is the date and time when the full source package was created. The
@ -64,6 +64,6 @@
*
* "Mon Feb 12 11:35:33 UTC 2007"
*/
#define LIBCURL_TIMESTAMP "Thu Jun 23 08:25:34 UTC 2011"
#define LIBCURL_TIMESTAMP "Thu May 24 16:05:42 UTC 2012"
#endif /* __CURL_CURLVER_H */

View File

@ -1 +0,0 @@
timestamp for include/curl/curlbuild.h

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -141,8 +141,9 @@ __extension__ ({ \
/* To define a new warning, use _CURL_WARNING(identifier, "message") */
#define _CURL_WARNING(id, message) \
static void __attribute__((warning(message))) __attribute__((unused)) \
__attribute__((noinline)) id(void) { __asm__(""); }
static void __attribute__((__warning__(message))) \
__attribute__((__unused__)) __attribute__((__noinline__)) \
id(void) { __asm__(""); }
_CURL_WARNING(_curl_easy_setopt_err_long,
"curl_easy_setopt expects a long argument for this option")
@ -392,7 +393,8 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
/* XXX: also check size of an char[] array? */
#define _curl_is_error_buffer(expr) \
(__builtin_types_compatible_p(__typeof__(expr), char *) || \
(_curl_is_NULL(expr) || \
__builtin_types_compatible_p(__typeof__(expr), char *) || \
__builtin_types_compatible_p(__typeof__(expr), char[]))
/* evaluates to true if expr is of type (const) void* or (const) FILE* */
@ -521,7 +523,11 @@ typedef int (_curl_progress_callback2)(const void *,
_curl_callback_compatible((expr), _curl_debug_callback1) || \
_curl_callback_compatible((expr), _curl_debug_callback2) || \
_curl_callback_compatible((expr), _curl_debug_callback3) || \
_curl_callback_compatible((expr), _curl_debug_callback4))
_curl_callback_compatible((expr), _curl_debug_callback4) || \
_curl_callback_compatible((expr), _curl_debug_callback5) || \
_curl_callback_compatible((expr), _curl_debug_callback6) || \
_curl_callback_compatible((expr), _curl_debug_callback7) || \
_curl_callback_compatible((expr), _curl_debug_callback8))
typedef int (_curl_debug_callback1) (CURL *,
curl_infotype, char *, size_t, void *);
typedef int (_curl_debug_callback2) (CURL *,
@ -530,6 +536,14 @@ typedef int (_curl_debug_callback3) (CURL *,
curl_infotype, const char *, size_t, void *);
typedef int (_curl_debug_callback4) (CURL *,
curl_infotype, const char *, size_t, const void *);
typedef int (_curl_debug_callback5) (CURL *,
curl_infotype, unsigned char *, size_t, void *);
typedef int (_curl_debug_callback6) (CURL *,
curl_infotype, unsigned char *, size_t, const void *);
typedef int (_curl_debug_callback7) (CURL *,
curl_infotype, const unsigned char *, size_t, void *);
typedef int (_curl_debug_callback8) (CURL *,
curl_infotype, const unsigned char *, size_t, const void *);
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
/* this is getting even messier... */

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
/* include/curl/curlbuild.h. Generated from curlbuild.h.in by configure. */
#ifndef __CURL_CURLBUILD_H
#define __CURL_CURLBUILD_H
/***************************************************************************
@ -113,7 +114,7 @@
/* Configure process defines this to 1 when it finds out that system */
/* header file ws2tcpip.h must be included by the external interface. */
#undef CURL_PULL_WS2TCPIP_H
/* #undef CURL_PULL_WS2TCPIP_H */
#ifdef CURL_PULL_WS2TCPIP_H
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
@ -125,66 +126,66 @@
/* Configure process defines this to 1 when it finds out that system */
/* header file sys/types.h must be included by the external interface. */
#undef CURL_PULL_SYS_TYPES_H
#define CURL_PULL_SYS_TYPES_H 1
#ifdef CURL_PULL_SYS_TYPES_H
# include <sys/types.h>
#endif
/* Configure process defines this to 1 when it finds out that system */
/* header file stdint.h must be included by the external interface. */
#undef CURL_PULL_STDINT_H
/* #undef CURL_PULL_STDINT_H */
#ifdef CURL_PULL_STDINT_H
# include <stdint.h>
#endif
/* Configure process defines this to 1 when it finds out that system */
/* header file inttypes.h must be included by the external interface. */
#undef CURL_PULL_INTTYPES_H
/* #undef CURL_PULL_INTTYPES_H */
#ifdef CURL_PULL_INTTYPES_H
# include <inttypes.h>
#endif
/* Configure process defines this to 1 when it finds out that system */
/* header file sys/socket.h must be included by the external interface. */
#undef CURL_PULL_SYS_SOCKET_H
#define CURL_PULL_SYS_SOCKET_H 1
#ifdef CURL_PULL_SYS_SOCKET_H
# include <sys/socket.h>
#endif
/* The size of `long', as computed by sizeof. */
#undef CURL_SIZEOF_LONG
#define CURL_SIZEOF_LONG 8
/* Integral data type used for curl_socklen_t. */
#undef CURL_TYPEOF_CURL_SOCKLEN_T
#define CURL_TYPEOF_CURL_SOCKLEN_T socklen_t
/* The size of `curl_socklen_t', as computed by sizeof. */
#undef CURL_SIZEOF_CURL_SOCKLEN_T
#define CURL_SIZEOF_CURL_SOCKLEN_T 4
/* Data type definition of curl_socklen_t. */
typedef CURL_TYPEOF_CURL_SOCKLEN_T curl_socklen_t;
/* Signed integral data type used for curl_off_t. */
#undef CURL_TYPEOF_CURL_OFF_T
#define CURL_TYPEOF_CURL_OFF_T long
/* Data type definition of curl_off_t. */
typedef CURL_TYPEOF_CURL_OFF_T curl_off_t;
/* curl_off_t formatting string directive without "%" conversion specifier. */
#undef CURL_FORMAT_CURL_OFF_T
#define CURL_FORMAT_CURL_OFF_T "ld"
/* unsigned curl_off_t formatting string without "%" conversion specifier. */
#undef CURL_FORMAT_CURL_OFF_TU
#define CURL_FORMAT_CURL_OFF_TU "lu"
/* curl_off_t formatting string directive with "%" conversion specifier. */
#undef CURL_FORMAT_OFF_T
#define CURL_FORMAT_OFF_T "%ld"
/* The size of `curl_off_t', as computed by sizeof. */
#undef CURL_SIZEOF_CURL_OFF_T
#define CURL_SIZEOF_CURL_OFF_T 8
/* curl_off_t constant suffix. */
#undef CURL_SUFFIX_CURL_OFF_T
#define CURL_SUFFIX_CURL_OFF_T L
/* unsigned curl_off_t constant suffix. */
#undef CURL_SUFFIX_CURL_OFF_TU
#define CURL_SUFFIX_CURL_OFF_TU UL
#endif /* __CURL_CURLBUILD_H */

View File

@ -0,0 +1,261 @@
#ifndef __CURL_CURLRULES_H
#define __CURL_CURLRULES_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
/* ================================================================ */
/* COMPILE TIME SANITY CHECKS */
/* ================================================================ */
/*
* NOTE 1:
* -------
*
* All checks done in this file are intentionally placed in a public
* header file which is pulled by curl/curl.h when an application is
* being built using an already built libcurl library. Additionally
* this file is also included and used when building the library.
*
* If compilation fails on this file it is certainly sure that the
* problem is elsewhere. It could be a problem in the curlbuild.h
* header file, or simply that you are using different compilation
* settings than those used to build the library.
*
* Nothing in this file is intended to be modified or adjusted by the
* curl library user nor by the curl library builder.
*
* Do not deactivate any check, these are done to make sure that the
* library is properly built and used.
*
* You can find further help on the libcurl development mailing list:
* http://cool.haxx.se/mailman/listinfo/curl-library/
*
* NOTE 2
* ------
*
* Some of the following compile time checks are based on the fact
* that the dimension of a constant array can not be a negative one.
* In this way if the compile time verification fails, the compilation
* will fail issuing an error. The error description wording is compiler
* dependent but it will be quite similar to one of the following:
*
* "negative subscript or subscript is too large"
* "array must have at least one element"
* "-1 is an illegal array size"
* "size of array is negative"
*
* If you are building an application which tries to use an already
* built libcurl library and you are getting this kind of errors on
* this file, it is a clear indication that there is a mismatch between
* how the library was built and how you are trying to use it for your
* application. Your already compiled or binary library provider is the
* only one who can give you the details you need to properly use it.
*/
/*
* Verify that some macros are actually defined.
*/
#ifndef CURL_SIZEOF_LONG
# error "CURL_SIZEOF_LONG definition is missing!"
Error Compilation_aborted_CURL_SIZEOF_LONG_is_missing
#endif
#ifndef CURL_TYPEOF_CURL_SOCKLEN_T
# error "CURL_TYPEOF_CURL_SOCKLEN_T definition is missing!"
Error Compilation_aborted_CURL_TYPEOF_CURL_SOCKLEN_T_is_missing
#endif
#ifndef CURL_SIZEOF_CURL_SOCKLEN_T
# error "CURL_SIZEOF_CURL_SOCKLEN_T definition is missing!"
Error Compilation_aborted_CURL_SIZEOF_CURL_SOCKLEN_T_is_missing
#endif
#ifndef CURL_TYPEOF_CURL_OFF_T
# error "CURL_TYPEOF_CURL_OFF_T definition is missing!"
Error Compilation_aborted_CURL_TYPEOF_CURL_OFF_T_is_missing
#endif
#ifndef CURL_FORMAT_CURL_OFF_T
# error "CURL_FORMAT_CURL_OFF_T definition is missing!"
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_T_is_missing
#endif
#ifndef CURL_FORMAT_CURL_OFF_TU
# error "CURL_FORMAT_CURL_OFF_TU definition is missing!"
Error Compilation_aborted_CURL_FORMAT_CURL_OFF_TU_is_missing
#endif
#ifndef CURL_FORMAT_OFF_T
# error "CURL_FORMAT_OFF_T definition is missing!"
Error Compilation_aborted_CURL_FORMAT_OFF_T_is_missing
#endif
#ifndef CURL_SIZEOF_CURL_OFF_T
# error "CURL_SIZEOF_CURL_OFF_T definition is missing!"
Error Compilation_aborted_CURL_SIZEOF_CURL_OFF_T_is_missing
#endif
#ifndef CURL_SUFFIX_CURL_OFF_T
# error "CURL_SUFFIX_CURL_OFF_T definition is missing!"
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_T_is_missing
#endif
#ifndef CURL_SUFFIX_CURL_OFF_TU
# error "CURL_SUFFIX_CURL_OFF_TU definition is missing!"
Error Compilation_aborted_CURL_SUFFIX_CURL_OFF_TU_is_missing
#endif
/*
* Macros private to this header file.
*/
#define CurlchkszEQ(t, s) sizeof(t) == s ? 1 : -1
#define CurlchkszGE(t1, t2) sizeof(t1) >= sizeof(t2) ? 1 : -1
/*
* Verify that the size previously defined and expected for long
* is the same as the one reported by sizeof() at compile time.
*/
typedef char
__curl_rule_01__
[CurlchkszEQ(long, CURL_SIZEOF_LONG)];
/*
* Verify that the size previously defined and expected for
* curl_off_t is actually the the same as the one reported
* by sizeof() at compile time.
*/
typedef char
__curl_rule_02__
[CurlchkszEQ(curl_off_t, CURL_SIZEOF_CURL_OFF_T)];
/*
* Verify at compile time that the size of curl_off_t as reported
* by sizeof() is greater or equal than the one reported for long
* for the current compilation.
*/
typedef char
__curl_rule_03__
[CurlchkszGE(curl_off_t, long)];
/*
* Verify that the size previously defined and expected for
* curl_socklen_t is actually the the same as the one reported
* by sizeof() at compile time.
*/
typedef char
__curl_rule_04__
[CurlchkszEQ(curl_socklen_t, CURL_SIZEOF_CURL_SOCKLEN_T)];
/*
* Verify at compile time that the size of curl_socklen_t as reported
* by sizeof() is greater or equal than the one reported for int for
* the current compilation.
*/
typedef char
__curl_rule_05__
[CurlchkszGE(curl_socklen_t, int)];
/* ================================================================ */
/* EXTERNALLY AND INTERNALLY VISIBLE DEFINITIONS */
/* ================================================================ */
/*
* CURL_ISOCPP and CURL_OFF_T_C definitions are done here in order to allow
* these to be visible and exported by the external libcurl interface API,
* while also making them visible to the library internals, simply including
* setup.h, without actually needing to include curl.h internally.
* If some day this section would grow big enough, all this should be moved
* to its own header file.
*/
/*
* Figure out if we can use the ## preprocessor operator, which is supported
* by ISO/ANSI C and C++. Some compilers support it without setting __STDC__
* or __cplusplus so we need to carefully check for them too.
*/
#if defined(__STDC__) || defined(_MSC_VER) || defined(__cplusplus) || \
defined(__HP_aCC) || defined(__BORLANDC__) || defined(__LCC__) || \
defined(__POCC__) || defined(__SALFORDC__) || defined(__HIGHC__) || \
defined(__ILEC400__)
/* This compiler is believed to have an ISO compatible preprocessor */
#define CURL_ISOCPP
#else
/* This compiler is believed NOT to have an ISO compatible preprocessor */
#undef CURL_ISOCPP
#endif
/*
* Macros for minimum-width signed and unsigned curl_off_t integer constants.
*/
#if defined(__BORLANDC__) && (__BORLANDC__ == 0x0551)
# define __CURL_OFF_T_C_HLPR2(x) x
# define __CURL_OFF_T_C_HLPR1(x) __CURL_OFF_T_C_HLPR2(x)
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_T)
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val) ## \
__CURL_OFF_T_C_HLPR1(CURL_SUFFIX_CURL_OFF_TU)
#else
# ifdef CURL_ISOCPP
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val ## Suffix
# else
# define __CURL_OFF_T_C_HLPR2(Val,Suffix) Val/**/Suffix
# endif
# define __CURL_OFF_T_C_HLPR1(Val,Suffix) __CURL_OFF_T_C_HLPR2(Val,Suffix)
# define CURL_OFF_T_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_T)
# define CURL_OFF_TU_C(Val) __CURL_OFF_T_C_HLPR1(Val,CURL_SUFFIX_CURL_OFF_TU)
#endif
/*
* Get rid of macros private to this header file.
*/
#undef CurlchkszEQ
#undef CurlchkszGE
/*
* Get rid of macros not intended to exist beyond this point.
*/
#undef CURL_PULL_WS2TCPIP_H
#undef CURL_PULL_SYS_TYPES_H
#undef CURL_PULL_SYS_SOCKET_H
#undef CURL_PULL_STDINT_H
#undef CURL_PULL_INTTYPES_H
#undef CURL_TYPEOF_CURL_SOCKLEN_T
#undef CURL_TYPEOF_CURL_OFF_T
#ifdef CURL_NO_OLDIES
#undef CURL_FORMAT_OFF_T /* not required since 7.19.0 - obsoleted in 7.20.0 */
#endif
#endif /* __CURL_CURLRULES_H */

View File

@ -0,0 +1,69 @@
#ifndef __CURL_CURLVER_H
#define __CURL_CURLVER_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
/* This header file contains nothing but libcurl version info, generated by
a script at release-time. This was made its own header file in 7.11.2 */
/* This is the global package copyright */
#define LIBCURL_COPYRIGHT "1996 - 2012 Daniel Stenberg, <daniel@haxx.se>."
/* This is the version number of the libcurl package from which this header
file origins: */
#define LIBCURL_VERSION "7.26.0"
/* The numeric version number is also available "in parts" by using these
defines: */
#define LIBCURL_VERSION_MAJOR 7
#define LIBCURL_VERSION_MINOR 26
#define LIBCURL_VERSION_PATCH 0
/* This is the numeric version of the libcurl version number, meant for easier
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
always follow this syntax:
0xXXYYZZ
Where XX, YY and ZZ are the main version, release and patch numbers in
hexadecimal (using 8 bits each). All three numbers are always represented
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
appears as "0x090b07".
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
and it is always a greater number in a more recent release. It makes
comparisons with greater than and less than work.
*/
#define LIBCURL_VERSION_NUM 0x071a00
/*
* This is the date and time when the full source package was created. The
* timestamp is not stored in git, as the timestamp is properly set in the
* tarballs by the maketgz script.
*
* The format of the date should follow this template:
*
* "Mon Feb 12 11:35:33 UTC 2007"
*/
#define LIBCURL_TIMESTAMP "Thu May 24 16:05:42 UTC 2012"
#endif /* __CURL_CURLVER_H */

View File

@ -0,0 +1,102 @@
#ifndef __CURL_EASY_H
#define __CURL_EASY_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
CURL_EXTERN CURL *curl_easy_init(void);
CURL_EXTERN CURLcode curl_easy_setopt(CURL *curl, CURLoption option, ...);
CURL_EXTERN CURLcode curl_easy_perform(CURL *curl);
CURL_EXTERN void curl_easy_cleanup(CURL *curl);
/*
* NAME curl_easy_getinfo()
*
* DESCRIPTION
*
* Request internal information from the curl session with this function. The
* third argument MUST be a pointer to a long, a pointer to a char * or a
* pointer to a double (as the documentation describes elsewhere). The data
* pointed to will be filled in accordingly and can be relied upon only if the
* function returns CURLE_OK. This function is intended to get used *AFTER* a
* performed transfer, all results from this function are undefined until the
* transfer is completed.
*/
CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
/*
* NAME curl_easy_duphandle()
*
* DESCRIPTION
*
* Creates a new curl session handle with the same options set for the handle
* passed in. Duplicating a handle could only be a matter of cloning data and
* options, internal state info and things like persistent connections cannot
* be transferred. It is useful in multithreaded applications when you can run
* curl_easy_duphandle() for each new thread to avoid a series of identical
* curl_easy_setopt() invokes in every thread.
*/
CURL_EXTERN CURL* curl_easy_duphandle(CURL *curl);
/*
* NAME curl_easy_reset()
*
* DESCRIPTION
*
* Re-initializes a CURL handle to the default values. This puts back the
* handle to the same state as it was in when it was just created.
*
* It does keep: live connections, the Session ID cache, the DNS cache and the
* cookies.
*/
CURL_EXTERN void curl_easy_reset(CURL *curl);
/*
* NAME curl_easy_recv()
*
* DESCRIPTION
*
* Receives data from the connected socket. Use after successful
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
*/
CURL_EXTERN CURLcode curl_easy_recv(CURL *curl, void *buffer, size_t buflen,
size_t *n);
/*
* NAME curl_easy_send()
*
* DESCRIPTION
*
* Sends data over the connected socket. Use after successful
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
*/
CURL_EXTERN CURLcode curl_easy_send(CURL *curl, const void *buffer,
size_t buflen, size_t *n);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -0,0 +1,81 @@
#ifndef __CURL_MPRINTF_H
#define __CURL_MPRINTF_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2006, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
#include <stdarg.h>
#include <stdio.h> /* needed for FILE */
#include "curl.h"
#ifdef __cplusplus
extern "C" {
#endif
CURL_EXTERN int curl_mprintf(const char *format, ...);
CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...);
CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...);
CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength,
const char *format, ...);
CURL_EXTERN int curl_mvprintf(const char *format, va_list args);
CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args);
CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args);
CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength,
const char *format, va_list args);
CURL_EXTERN char *curl_maprintf(const char *format, ...);
CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args);
#ifdef _MPRINTF_REPLACE
# undef printf
# undef fprintf
# undef sprintf
# undef vsprintf
# undef snprintf
# undef vprintf
# undef vfprintf
# undef vsnprintf
# undef aprintf
# undef vaprintf
# define printf curl_mprintf
# define fprintf curl_mfprintf
#ifdef CURLDEBUG
/* When built with CURLDEBUG we define away the sprintf() functions since we
don't want internal code to be using them */
# define sprintf sprintf_was_used
# define vsprintf vsprintf_was_used
#else
# define sprintf curl_msprintf
# define vsprintf curl_mvsprintf
#endif
# define snprintf curl_msnprintf
# define vprintf curl_mvprintf
# define vfprintf curl_mvfprintf
# define vsnprintf curl_mvsnprintf
# define aprintf curl_maprintf
# define vaprintf curl_mvaprintf
#endif
#ifdef __cplusplus
}
#endif
#endif /* __CURL_MPRINTF_H */

View File

@ -0,0 +1,345 @@
#ifndef __CURL_MULTI_H
#define __CURL_MULTI_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
/*
This is an "external" header file. Don't give away any internals here!
GOALS
o Enable a "pull" interface. The application that uses libcurl decides where
and when to ask libcurl to get/send data.
o Enable multiple simultaneous transfers in the same thread without making it
complicated for the application.
o Enable the application to select() on its own file descriptors and curl's
file descriptors simultaneous easily.
*/
/*
* This header file should not really need to include "curl.h" since curl.h
* itself includes this file and we expect user applications to do #include
* <curl/curl.h> without the need for especially including multi.h.
*
* For some reason we added this include here at one point, and rather than to
* break existing (wrongly written) libcurl applications, we leave it as-is
* but with this warning attached.
*/
#include "curl.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef void CURLM;
typedef enum {
CURLM_CALL_MULTI_PERFORM = -1, /* please call curl_multi_perform() or
curl_multi_socket*() soon */
CURLM_OK,
CURLM_BAD_HANDLE, /* the passed-in handle is not a valid CURLM handle */
CURLM_BAD_EASY_HANDLE, /* an easy handle was not good/valid */
CURLM_OUT_OF_MEMORY, /* if you ever get this, you're in deep sh*t */
CURLM_INTERNAL_ERROR, /* this is a libcurl bug */
CURLM_BAD_SOCKET, /* the passed in socket argument did not match */
CURLM_UNKNOWN_OPTION, /* curl_multi_setopt() with unsupported option */
CURLM_LAST
} CURLMcode;
/* just to make code nicer when using curl_multi_socket() you can now check
for CURLM_CALL_MULTI_SOCKET too in the same style it works for
curl_multi_perform() and CURLM_CALL_MULTI_PERFORM */
#define CURLM_CALL_MULTI_SOCKET CURLM_CALL_MULTI_PERFORM
typedef enum {
CURLMSG_NONE, /* first, not used */
CURLMSG_DONE, /* This easy handle has completed. 'result' contains
the CURLcode of the transfer */
CURLMSG_LAST /* last, not used */
} CURLMSG;
struct CURLMsg {
CURLMSG msg; /* what this message means */
CURL *easy_handle; /* the handle it concerns */
union {
void *whatever; /* message-specific data */
CURLcode result; /* return code for transfer */
} data;
};
typedef struct CURLMsg CURLMsg;
/*
* Name: curl_multi_init()
*
* Desc: inititalize multi-style curl usage
*
* Returns: a new CURLM handle to use in all 'curl_multi' functions.
*/
CURL_EXTERN CURLM *curl_multi_init(void);
/*
* Name: curl_multi_add_handle()
*
* Desc: add a standard curl handle to the multi stack
*
* Returns: CURLMcode type, general multi error code.
*/
CURL_EXTERN CURLMcode curl_multi_add_handle(CURLM *multi_handle,
CURL *curl_handle);
/*
* Name: curl_multi_remove_handle()
*
* Desc: removes a curl handle from the multi stack again
*
* Returns: CURLMcode type, general multi error code.
*/
CURL_EXTERN CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
CURL *curl_handle);
/*
* Name: curl_multi_fdset()
*
* Desc: Ask curl for its fd_set sets. The app can use these to select() or
* poll() on. We want curl_multi_perform() called as soon as one of
* them are ready.
*
* Returns: CURLMcode type, general multi error code.
*/
CURL_EXTERN CURLMcode curl_multi_fdset(CURLM *multi_handle,
fd_set *read_fd_set,
fd_set *write_fd_set,
fd_set *exc_fd_set,
int *max_fd);
/*
* Name: curl_multi_perform()
*
* Desc: When the app thinks there's data available for curl it calls this
* function to read/write whatever there is right now. This returns
* as soon as the reads and writes are done. This function does not
* require that there actually is data available for reading or that
* data can be written, it can be called just in case. It returns
* the number of handles that still transfer data in the second
* argument's integer-pointer.
*
* Returns: CURLMcode type, general multi error code. *NOTE* that this only
* returns errors etc regarding the whole multi stack. There might
* still have occurred problems on invidual transfers even when this
* returns OK.
*/
CURL_EXTERN CURLMcode curl_multi_perform(CURLM *multi_handle,
int *running_handles);
/*
* Name: curl_multi_cleanup()
*
* Desc: Cleans up and removes a whole multi stack. It does not free or
* touch any individual easy handles in any way. We need to define
* in what state those handles will be if this function is called
* in the middle of a transfer.
*
* Returns: CURLMcode type, general multi error code.
*/
CURL_EXTERN CURLMcode curl_multi_cleanup(CURLM *multi_handle);
/*
* Name: curl_multi_info_read()
*
* Desc: Ask the multi handle if there's any messages/informationals from
* the individual transfers. Messages include informationals such as
* error code from the transfer or just the fact that a transfer is
* completed. More details on these should be written down as well.
*
* Repeated calls to this function will return a new struct each
* time, until a special "end of msgs" struct is returned as a signal
* that there is no more to get at this point.
*
* The data the returned pointer points to will not survive calling
* curl_multi_cleanup().
*
* The 'CURLMsg' struct is meant to be very simple and only contain
* very basic informations. If more involved information is wanted,
* we will provide the particular "transfer handle" in that struct
* and that should/could/would be used in subsequent
* curl_easy_getinfo() calls (or similar). The point being that we
* must never expose complex structs to applications, as then we'll
* undoubtably get backwards compatibility problems in the future.
*
* Returns: A pointer to a filled-in struct, or NULL if it failed or ran out
* of structs. It also writes the number of messages left in the
* queue (after this read) in the integer the second argument points
* to.
*/
CURL_EXTERN CURLMsg *curl_multi_info_read(CURLM *multi_handle,
int *msgs_in_queue);
/*
* Name: curl_multi_strerror()
*
* Desc: The curl_multi_strerror function may be used to turn a CURLMcode
* value into the equivalent human readable error string. This is
* useful for printing meaningful error messages.
*
* Returns: A pointer to a zero-terminated error message.
*/
CURL_EXTERN const char *curl_multi_strerror(CURLMcode);
/*
* Name: curl_multi_socket() and
* curl_multi_socket_all()
*
* Desc: An alternative version of curl_multi_perform() that allows the
* application to pass in one of the file descriptors that have been
* detected to have "action" on them and let libcurl perform.
* See man page for details.
*/
#define CURL_POLL_NONE 0
#define CURL_POLL_IN 1
#define CURL_POLL_OUT 2
#define CURL_POLL_INOUT 3
#define CURL_POLL_REMOVE 4
#define CURL_SOCKET_TIMEOUT CURL_SOCKET_BAD
#define CURL_CSELECT_IN 0x01
#define CURL_CSELECT_OUT 0x02
#define CURL_CSELECT_ERR 0x04
typedef int (*curl_socket_callback)(CURL *easy, /* easy handle */
curl_socket_t s, /* socket */
int what, /* see above */
void *userp, /* private callback
pointer */
void *socketp); /* private socket
pointer */
/*
* Name: curl_multi_timer_callback
*
* Desc: Called by libcurl whenever the library detects a change in the
* maximum number of milliseconds the app is allowed to wait before
* curl_multi_socket() or curl_multi_perform() must be called
* (to allow libcurl's timed events to take place).
*
* Returns: The callback should return zero.
*/
typedef int (*curl_multi_timer_callback)(CURLM *multi, /* multi handle */
long timeout_ms, /* see above */
void *userp); /* private callback
pointer */
CURL_EXTERN CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
int *running_handles);
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
curl_socket_t s,
int ev_bitmask,
int *running_handles);
CURL_EXTERN CURLMcode curl_multi_socket_all(CURLM *multi_handle,
int *running_handles);
#ifndef CURL_ALLOW_OLD_MULTI_SOCKET
/* This macro below was added in 7.16.3 to push users who recompile to use
the new curl_multi_socket_action() instead of the old curl_multi_socket()
*/
#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
#endif
/*
* Name: curl_multi_timeout()
*
* Desc: Returns the maximum number of milliseconds the app is allowed to
* wait before curl_multi_socket() or curl_multi_perform() must be
* called (to allow libcurl's timed events to take place).
*
* Returns: CURLM error code.
*/
CURL_EXTERN CURLMcode curl_multi_timeout(CURLM *multi_handle,
long *milliseconds);
#undef CINIT /* re-using the same name as in curl.h */
#ifdef CURL_ISOCPP
#define CINIT(name,type,num) CURLMOPT_ ## name = CURLOPTTYPE_ ## type + num
#else
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
#define LONG CURLOPTTYPE_LONG
#define OBJECTPOINT CURLOPTTYPE_OBJECTPOINT
#define FUNCTIONPOINT CURLOPTTYPE_FUNCTIONPOINT
#define OFF_T CURLOPTTYPE_OFF_T
#define CINIT(name,type,number) CURLMOPT_/**/name = type + number
#endif
typedef enum {
/* This is the socket callback function pointer */
CINIT(SOCKETFUNCTION, FUNCTIONPOINT, 1),
/* This is the argument passed to the socket callback */
CINIT(SOCKETDATA, OBJECTPOINT, 2),
/* set to 1 to enable pipelining for this multi handle */
CINIT(PIPELINING, LONG, 3),
/* This is the timer callback function pointer */
CINIT(TIMERFUNCTION, FUNCTIONPOINT, 4),
/* This is the argument passed to the timer callback */
CINIT(TIMERDATA, OBJECTPOINT, 5),
/* maximum number of entries in the connection cache */
CINIT(MAXCONNECTS, LONG, 6),
CURLMOPT_LASTENTRY /* the last unused */
} CURLMoption;
/*
* Name: curl_multi_setopt()
*
* Desc: Sets options for the multi handle.
*
* Returns: CURLM error code.
*/
CURL_EXTERN CURLMcode curl_multi_setopt(CURLM *multi_handle,
CURLMoption option, ...);
/*
* Name: curl_multi_assign()
*
* Desc: This function sets an association in the multi handle between the
* given socket and a private pointer of the application. This is
* (only) useful for curl_multi_socket uses.
*
* Returns: CURLM error code.
*/
CURL_EXTERN CURLMcode curl_multi_assign(CURLM *multi_handle,
curl_socket_t sockfd, void *sockp);
#ifdef __cplusplus
} /* end of extern "C" */
#endif
#endif

View File

@ -0,0 +1,33 @@
#ifndef __STDC_HEADERS_H
#define __STDC_HEADERS_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at http://curl.haxx.se/docs/copyright.html.
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
#include <sys/types.h>
size_t fread (void *, size_t, size_t, FILE *);
size_t fwrite (const void *, size_t, size_t, FILE *);
int strcasecmp(const char *, const char *);
int strncasecmp(const char *, const char *, size_t);
#endif /* __STDC_HEADERS_H */

View File

@ -1 +1 @@
a485f5e235eab19953e38764652f50a60556d755
62d3069171e474ac720640f58c31cac4d312a2c9

View File

@ -1 +0,0 @@
b76eb018f78af561dcc72e78f477c6b6233f4298

View File

@ -1 +1 @@
0059c979a994f1102d90b9f532a6687f2d4905c2
b4d7f374257b051c9241d6ef7fbc80bf6966ad3a

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -55,34 +55,32 @@
#include <sys/types.h>
#include <time.h>
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__GNUC__) && \
!defined(__CYGWIN__) || defined(__MINGW32__)
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H))
#if defined(WIN32) && !defined(_WIN32_WCE) && !defined(__CYGWIN__)
#if !(defined(_WINSOCKAPI_) || defined(_WINSOCK_H) || defined(__LWIP_OPT_H__))
/* The check above prevents the winsock2 inclusion if winsock.h already was
included, since they can't co-exist without problems */
#include <winsock2.h>
#include <ws2tcpip.h>
#endif
#else
#endif
/* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish
libc5-based Linux systems. Only include it on system that are known to
libc5-based Linux systems. Only include it on systems that are known to
require it! */
#if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
defined(ANDROID) || \
defined(ANDROID) || defined(__ANDROID__) || \
(defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
#include <sys/select.h>
#endif
#ifndef _WIN32_WCE
#if !defined(WIN32) && !defined(_WIN32_WCE)
#include <sys/socket.h>
#endif
#if !defined(WIN32) && !defined(__WATCOMC__) && !defined(__VXWORKS__)
#include <sys/time.h>
#endif
#include <sys/types.h>
#endif
#ifdef __BEOS__
#include <support/SupportDefs.h>
@ -122,7 +120,7 @@ typedef void CURL;
#ifndef curl_socket_typedef
/* socket typedef */
#ifdef WIN32
#if defined(WIN32) && !defined(__LWIP_OPT_H__)
typedef SOCKET curl_socket_t;
#define CURL_SOCKET_BAD INVALID_SOCKET
#else
@ -189,10 +187,10 @@ typedef int (*curl_progress_callback)(void *clientp,
#define CURL_MAX_HTTP_HEADER (100*1024)
#endif
/* This is a magic return code for the write callback that, when returned,
will signal libcurl to pause receiving on the current transfer. */
#define CURL_WRITEFUNC_PAUSE 0x10000001
typedef size_t (*curl_write_callback)(char *buffer,
size_t size,
size_t nitems,
@ -315,6 +313,13 @@ typedef enum {
CURLSOCKTYPE_LAST /* never use */
} curlsocktype;
/* The return code from the sockopt_callback can signal information back
to libcurl: */
#define CURL_SOCKOPT_OK 0
#define CURL_SOCKOPT_ERROR 1 /* causes libcurl to abort and return
CURLE_ABORTED_BY_CALLBACK */
#define CURL_SOCKOPT_ALREADY_CONNECTED 2
typedef int (*curl_sockopt_callback)(void *clientp,
curl_socket_t curlfd,
curlsocktype purpose);
@ -334,6 +339,9 @@ typedef curl_socket_t
curlsocktype purpose,
struct curl_sockaddr *address);
typedef int
(*curl_closesocket_callback)(void *clientp, curl_socket_t item);
typedef enum {
CURLIOE_OK, /* I/O operation successful */
CURLIOE_UNKNOWNCMD, /* command was unknown to callback */
@ -394,7 +402,8 @@ typedef enum {
CURLE_UNSUPPORTED_PROTOCOL, /* 1 */
CURLE_FAILED_INIT, /* 2 */
CURLE_URL_MALFORMAT, /* 3 */
CURLE_OBSOLETE4, /* 4 - NOT USED */
CURLE_NOT_BUILT_IN, /* 4 - [was obsoleted in August 2007 for
7.17.0, reused in April 2011 for 7.21.5] */
CURLE_COULDNT_RESOLVE_PROXY, /* 5 */
CURLE_COULDNT_RESOLVE_HOST, /* 6 */
CURLE_COULDNT_CONNECT, /* 7 */
@ -402,9 +411,12 @@ typedef enum {
CURLE_REMOTE_ACCESS_DENIED, /* 9 a service was denied by the server
due to lack of access - when login fails
this is not returned. */
CURLE_OBSOLETE10, /* 10 - NOT USED */
CURLE_FTP_ACCEPT_FAILED, /* 10 - [was obsoleted in April 2006 for
7.15.4, reused in Dec 2011 for 7.24.0]*/
CURLE_FTP_WEIRD_PASS_REPLY, /* 11 */
CURLE_OBSOLETE12, /* 12 - NOT USED */
CURLE_FTP_ACCEPT_TIMEOUT, /* 12 - timeout occurred accepting server
[was obsoleted in August 2007 for 7.17.0,
reused in Dec 2011 for 7.24.0]*/
CURLE_FTP_WEIRD_PASV_REPLY, /* 13 */
CURLE_FTP_WEIRD_227_FORMAT, /* 14 */
CURLE_FTP_CANT_GET_HOST, /* 15 */
@ -444,7 +456,7 @@ typedef enum {
CURLE_INTERFACE_FAILED, /* 45 - CURLOPT_INTERFACE failed */
CURLE_OBSOLETE46, /* 46 - NOT USED */
CURLE_TOO_MANY_REDIRECTS , /* 47 - catch endless re-direct loops */
CURLE_UNKNOWN_TELNET_OPTION, /* 48 - User specified an unknown option */
CURLE_UNKNOWN_OPTION, /* 48 - User specified an unknown option */
CURLE_TELNET_OPTION_SYNTAX , /* 49 - Malformed telnet option */
CURLE_OBSOLETE50, /* 50 - NOT USED */
CURLE_PEER_FAILED_VERIFICATION, /* 51 - peer's certificate or fingerprint
@ -459,7 +471,7 @@ typedef enum {
CURLE_SSL_CERTPROBLEM, /* 58 - problem with the local certificate */
CURLE_SSL_CIPHER, /* 59 - couldn't use specified cipher */
CURLE_SSL_CACERT, /* 60 - problem with the CA cert (path?) */
CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized transfer encoding */
CURLE_BAD_CONTENT_ENCODING, /* 61 - Unrecognized/bad encoding */
CURLE_LDAP_INVALID_URL, /* 62 - Invalid LDAP URL */
CURLE_FILESIZE_EXCEEDED, /* 63 - Maximum file size exceeded */
CURLE_USE_SSL_FAILED, /* 64 - Requested FTP SSL level failed */
@ -499,17 +511,24 @@ typedef enum {
7.19.0) */
CURLE_FTP_PRET_FAILED, /* 84 - a PRET command failed */
CURLE_RTSP_CSEQ_ERROR, /* 85 - mismatch of RTSP CSeq numbers */
CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Identifiers */
CURLE_RTSP_SESSION_ERROR, /* 86 - mismatch of RTSP Session Ids */
CURLE_FTP_BAD_FILE_LIST, /* 87 - unable to parse FTP file list */
CURLE_CHUNK_FAILED, /* 88 - chunk callback reported error */
CURL_LAST /* never use! */
} CURLcode;
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
the obsolete stuff removed! */
/* Backwards compatibility with older names */
/* Previously obsoletes error codes re-used in 7.24.0 */
#define CURLE_OBSOLETE10 CURLE_FTP_ACCEPT_FAILED
#define CURLE_OBSOLETE12 CURLE_FTP_ACCEPT_TIMEOUT
/* compatibility with older names */
#define CURLOPT_ENCODING CURLOPT_ACCEPT_ENCODING
/* The following were added in 7.21.5, April 2011 */
#define CURLE_UNKNOWN_TELNET_OPTION CURLE_UNKNOWN_OPTION
/* The following were added in 7.17.1 */
/* These are scheduled to disappear by 2009 */
@ -517,7 +536,7 @@ typedef enum {
/* The following were added in 7.17.0 */
/* These are scheduled to disappear by 2009 */
#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* noone should be using this! */
#define CURLE_OBSOLETE CURLE_OBSOLETE50 /* no one should be using this! */
#define CURLE_BAD_PASSWORD_ENTERED CURLE_OBSOLETE46
#define CURLE_BAD_CALLING_ORDER CURLE_OBSOLETE44
#define CURLE_FTP_USER_PASSWORD_INCORRECT CURLE_OBSOLETE10
@ -529,7 +548,7 @@ typedef enum {
#define CURLE_LIBRARY_NOT_FOUND CURLE_OBSOLETE40
#define CURLE_MALFORMAT_USER CURLE_OBSOLETE24
#define CURLE_SHARE_IN_USE CURLE_OBSOLETE57
#define CURLE_URL_MALFORMAT_USER CURLE_OBSOLETE4
#define CURLE_URL_MALFORMAT_USER CURLE_NOT_BUILT_IN
#define CURLE_FTP_ACCESS_DENIED CURLE_REMOTE_ACCESS_DENIED
#define CURLE_FTP_COULDNT_SET_BINARY CURLE_FTP_COULDNT_SET_TYPE
@ -579,17 +598,32 @@ typedef enum {
in 7.18.0 */
} curl_proxytype; /* this enum was added in 7.10 */
#define CURLAUTH_NONE 0 /* nothing */
#define CURLAUTH_BASIC (1<<0) /* Basic (default) */
#define CURLAUTH_DIGEST (1<<1) /* Digest */
#define CURLAUTH_GSSNEGOTIATE (1<<2) /* GSS-Negotiate */
#define CURLAUTH_NTLM (1<<3) /* NTLM */
#define CURLAUTH_DIGEST_IE (1<<4) /* Digest with IE flavour */
#define CURLAUTH_ONLY (1<<31) /* used together with a single other
type to force no auth or just that
single type */
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE) /* all fine types set */
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
/*
* Bitmasks for CURLOPT_HTTPAUTH and CURLOPT_PROXYAUTH options:
*
* CURLAUTH_NONE - No HTTP authentication
* CURLAUTH_BASIC - HTTP Basic authentication (default)
* CURLAUTH_DIGEST - HTTP Digest authentication
* CURLAUTH_GSSNEGOTIATE - HTTP GSS-Negotiate authentication
* CURLAUTH_NTLM - HTTP NTLM authentication
* CURLAUTH_DIGEST_IE - HTTP Digest authentication with IE flavour
* CURLAUTH_NTLM_WB - HTTP NTLM authentication delegated to winbind helper
* CURLAUTH_ONLY - Use together with a single other type to force no
* authentication or just that single type
* CURLAUTH_ANY - All fine types set
* CURLAUTH_ANYSAFE - All fine types except Basic
*/
#define CURLAUTH_NONE ((unsigned long)0)
#define CURLAUTH_BASIC (((unsigned long)1)<<0)
#define CURLAUTH_DIGEST (((unsigned long)1)<<1)
#define CURLAUTH_GSSNEGOTIATE (((unsigned long)1)<<2)
#define CURLAUTH_NTLM (((unsigned long)1)<<3)
#define CURLAUTH_DIGEST_IE (((unsigned long)1)<<4)
#define CURLAUTH_NTLM_WB (((unsigned long)1)<<5)
#define CURLAUTH_ONLY (((unsigned long)1)<<31)
#define CURLAUTH_ANY (~CURLAUTH_DIGEST_IE)
#define CURLAUTH_ANYSAFE (~(CURLAUTH_BASIC|CURLAUTH_DIGEST_IE))
#define CURLSSH_AUTH_ANY ~0 /* all types supported by the server */
#define CURLSSH_AUTH_NONE 0 /* none allowed, silly but complete */
@ -599,6 +633,10 @@ typedef enum {
#define CURLSSH_AUTH_KEYBOARD (1<<3) /* keyboard interactive */
#define CURLSSH_AUTH_DEFAULT CURLSSH_AUTH_ANY
#define CURLGSSAPI_DELEGATION_NONE 0 /* no delegation (default) */
#define CURLGSSAPI_DELEGATION_POLICY_FLAG (1<<0) /* if permitted by policy */
#define CURLGSSAPI_DELEGATION_FLAG (1<<1) /* delegate always */
#define CURL_ERROR_SIZE 256
struct curl_khkey {
@ -649,6 +687,15 @@ typedef enum {
CURLUSESSL_LAST /* not an option, never use */
} curl_usessl;
/* Definition of bits for the CURLOPT_SSL_OPTIONS argument: */
/* - ALLOW_BEAST tells libcurl to allow the BEAST SSL vulnerability in the
name of improving interoperability with older servers. Some SSL libraries
have introduced work-arounds for this flaw but those work-arounds sometimes
make the SSL communication fail. To regain functionality with those broken
servers, a user can this way allow the vulnerability back. */
#define CURLSSLOPT_ALLOW_BEAST (1<<0)
#ifndef CURL_NO_OLDIES /* define this to test if your app builds with all
the obsolete stuff removed! */
@ -743,7 +790,7 @@ typedef enum {
#endif
#ifdef CURL_ISOCPP
#define CINIT(name,type,number) CURLOPT_ ## name = CURLOPTTYPE_ ## type + number
#define CINIT(na,t,nu) CURLOPT_ ## na = CURLOPTTYPE_ ## t + nu
#else
/* The macro "##" is ISO C, we assume pre-ISO C doesn't support it. */
#define LONG CURLOPTTYPE_LONG
@ -901,9 +948,7 @@ typedef enum {
/* send linked-list of post-transfer QUOTE commands */
CINIT(POSTQUOTE, OBJECTPOINT, 39),
/* Pass a pointer to string of the output using full variable-replacement
as described elsewhere. */
CINIT(WRITEINFO, OBJECTPOINT, 40),
CINIT(WRITEINFO, OBJECTPOINT, 40), /* DEPRECATED, do not use! */
CINIT(VERBOSE, LONG, 41), /* talk a lot */
CINIT(HEADER, LONG, 42), /* throw the header out too */
@ -912,7 +957,7 @@ typedef enum {
CINIT(FAILONERROR, LONG, 45), /* no output on http error codes >= 300 */
CINIT(UPLOAD, LONG, 46), /* this is an upload */
CINIT(POST, LONG, 47), /* HTTP POST method */
CINIT(DIRLISTONLY, LONG, 48), /* return bare names when listing directories */
CINIT(DIRLISTONLY, LONG, 48), /* bare names when listing directories */
CINIT(APPEND, LONG, 50), /* Append instead of overwrite on upload! */
@ -979,9 +1024,7 @@ typedef enum {
/* Max amount of cached alive connections */
CINIT(MAXCONNECTS, LONG, 71),
/* What policy to use when closing connections when the cache is filled
up */
CINIT(CLOSEPOLICY, LONG, 72),
CINIT(CLOSEPOLICY, LONG, 72), /* DEPRECATED, do not use! */
/* 73 = OBSOLETE */
@ -1055,7 +1098,7 @@ typedef enum {
CINIT(SSLENGINE_DEFAULT, LONG, 90),
/* Non-zero value means to use the global dns cache */
CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* To become OBSOLETE soon */
CINIT(DNS_USE_GLOBAL_CACHE, LONG, 91), /* DEPRECATED, do not use! */
/* DNS cache timeout */
CINIT(DNS_CACHE_TIMEOUT, LONG, 92),
@ -1092,8 +1135,9 @@ typedef enum {
CINIT(PROXYTYPE, LONG, 101),
/* Set the Accept-Encoding string. Use this to tell a server you would like
the response to be compressed. */
CINIT(ENCODING, OBJECTPOINT, 102),
the response to be compressed. Before 7.21.6, this was known as
CURLOPT_ENCODING */
CINIT(ACCEPT_ENCODING, OBJECTPOINT, 102),
/* Set pointer to private data */
CINIT(PRIVATE, OBJECTPOINT, 103),
@ -1106,8 +1150,8 @@ typedef enum {
and password to whatever host the server decides. */
CINIT(UNRESTRICTED_AUTH, LONG, 105),
/* Specifically switch on or off the FTP engine's use of the EPRT command ( it
also disables the LPRT attempt). By default, those ones will always be
/* Specifically switch on or off the FTP engine's use of the EPRT command (
it also disables the LPRT attempt). By default, those ones will always be
attempted before the good old traditional PORT command. */
CINIT(FTP_USE_EPRT, LONG, 106),
@ -1451,6 +1495,46 @@ typedef enum {
/* Set authentication type for authenticated TLS */
CINIT(TLSAUTH_TYPE, OBJECTPOINT, 206),
/* Set to 1 to enable the "TE:" header in HTTP requests to ask for
compressed transfer-encoded responses. Set to 0 to disable the use of TE:
in outgoing requests. The current default is 0, but it might change in a
future libcurl release.
libcurl will ask for the compressed methods it knows of, and if that
isn't any, it will not ask for transfer-encoding at all even if this
option is set to 1.
*/
CINIT(TRANSFER_ENCODING, LONG, 207),
/* Callback function for closing socket (instead of close(2)). The callback
should have type curl_closesocket_callback */
CINIT(CLOSESOCKETFUNCTION, FUNCTIONPOINT, 208),
CINIT(CLOSESOCKETDATA, OBJECTPOINT, 209),
/* allow GSSAPI credential delegation */
CINIT(GSSAPI_DELEGATION, LONG, 210),
/* Set the name servers to use for DNS resolution */
CINIT(DNS_SERVERS, OBJECTPOINT, 211),
/* Time-out accept operations (currently for FTP only) after this amount
of miliseconds. */
CINIT(ACCEPTTIMEOUT_MS, LONG, 212),
/* Set TCP keepalive */
CINIT(TCP_KEEPALIVE, LONG, 213),
/* non-universal keepalive knobs (Linux, AIX, HP-UX, more) */
CINIT(TCP_KEEPIDLE, LONG, 214),
CINIT(TCP_KEEPINTVL, LONG, 215),
/* Enable/disable specific SSL features with a bitmask, see CURLSSLOPT_* */
CINIT(SSL_OPTIONS, LONG, 216),
/* set the SMTP auth originator */
CINIT(MAIL_AUTH, OBJECTPOINT, 217),
CURLOPT_LASTENTRY /* the last unused */
} CURLoption;
@ -1554,13 +1638,16 @@ enum CURL_TLSAUTH {
};
/* symbols to use with CURLOPT_POSTREDIR.
CURL_REDIR_POST_301 and CURL_REDIR_POST_302 can be bitwise ORed so that
CURL_REDIR_POST_301 | CURL_REDIR_POST_302 == CURL_REDIR_POST_ALL */
CURL_REDIR_POST_301, CURL_REDIR_POST_302 and CURL_REDIR_POST_303
can be bitwise ORed so that CURL_REDIR_POST_301 | CURL_REDIR_POST_302
| CURL_REDIR_POST_303 == CURL_REDIR_POST_ALL */
#define CURL_REDIR_GET_ALL 0
#define CURL_REDIR_POST_301 1
#define CURL_REDIR_POST_302 2
#define CURL_REDIR_POST_ALL (CURL_REDIR_POST_301|CURL_REDIR_POST_302)
#define CURL_REDIR_POST_303 4
#define CURL_REDIR_POST_ALL \
(CURL_REDIR_POST_301|CURL_REDIR_POST_302|CURL_REDIR_POST_303)
typedef enum {
CURL_TIMECOND_NONE,
@ -1679,7 +1766,8 @@ CURL_EXTERN CURLFORMcode curl_formadd(struct curl_httppost **httppost,
* Should return the buffer length passed to it as the argument "len" on
* success.
*/
typedef size_t (*curl_formget_callback)(void *arg, const char *buf, size_t len);
typedef size_t (*curl_formget_callback)(void *arg, const char *buf,
size_t len);
/*
* NAME curl_formget()
@ -1978,8 +2066,9 @@ typedef enum {
CURLSHE_BAD_OPTION, /* 1 */
CURLSHE_IN_USE, /* 2 */
CURLSHE_INVALID, /* 3 */
CURLSHE_NOMEM, /* out of memory */
CURLSHE_LAST /* never use */
CURLSHE_NOMEM, /* 4 out of memory */
CURLSHE_NOT_BUILT_IN, /* 5 feature not present in lib */
CURLSHE_LAST /* never use */
} CURLSHcode;
typedef enum {
@ -2059,8 +2148,9 @@ typedef struct {
#define CURL_VERSION_CONV (1<<12) /* character conversions supported */
#define CURL_VERSION_CURLDEBUG (1<<13) /* debug memory tracking supported */
#define CURL_VERSION_TLSAUTH_SRP (1<<14) /* TLS-SRP auth is supported */
#define CURL_VERSION_NTLM_WB (1<<15) /* NTLM delegating to winbind helper */
/*
/*
* NAME curl_version_info()
*
* DESCRIPTION

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -26,17 +26,17 @@
a script at release-time. This was made its own header file in 7.11.2 */
/* This is the global package copyright */
#define LIBCURL_COPYRIGHT "1996 - 2010 Daniel Stenberg, <daniel@haxx.se>."
#define LIBCURL_COPYRIGHT "1996 - 2012 Daniel Stenberg, <daniel@haxx.se>."
/* This is the version number of the libcurl package from which this header
file origins: */
#define LIBCURL_VERSION "7.21.4"
#define LIBCURL_VERSION "7.26.0"
/* The numeric version number is also available "in parts" by using these
defines: */
#define LIBCURL_VERSION_MAJOR 7
#define LIBCURL_VERSION_MINOR 21
#define LIBCURL_VERSION_PATCH 4
#define LIBCURL_VERSION_MINOR 26
#define LIBCURL_VERSION_PATCH 0
/* This is the numeric version of the libcurl version number, meant for easier
parsing and comparions by programs. The LIBCURL_VERSION_NUM define will
@ -53,7 +53,7 @@
and it is always a greater number in a more recent release. It makes
comparisons with greater than and less than work.
*/
#define LIBCURL_VERSION_NUM 0x071504
#define LIBCURL_VERSION_NUM 0x071a00
/*
* This is the date and time when the full source package was created. The
@ -64,6 +64,6 @@
*
* "Mon Feb 12 11:35:33 UTC 2007"
*/
#define LIBCURL_TIMESTAMP "Thu Feb 17 12:19:40 UTC 2011"
#define LIBCURL_TIMESTAMP "Thu May 24 16:05:42 UTC 2012"
#endif /* __CURL_CURLVER_H */

View File

@ -53,8 +53,8 @@ CURL_EXTERN CURLcode curl_easy_getinfo(CURL *curl, CURLINFO info, ...);
*
* Creates a new curl session handle with the same options set for the handle
* passed in. Duplicating a handle could only be a matter of cloning data and
* options, internal state info and things like persistant connections cannot
* be transfered. It is useful in multithreaded applications when you can run
* options, internal state info and things like persistent connections cannot
* be transferred. It is useful in multithreaded applications when you can run
* curl_easy_duphandle() for each new thread to avoid a series of identical
* curl_easy_setopt() invokes in every thread.
*/

View File

@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2010, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@ -41,66 +41,66 @@
#define curl_easy_setopt(handle, option, value) \
__extension__ ({ \
__typeof__ (option) _curl_opt = option; \
if (__builtin_constant_p(_curl_opt)) { \
if (_curl_is_long_option(_curl_opt)) \
if (!_curl_is_long(value)) \
if(__builtin_constant_p(_curl_opt)) { \
if(_curl_is_long_option(_curl_opt)) \
if(!_curl_is_long(value)) \
_curl_easy_setopt_err_long(); \
if (_curl_is_off_t_option(_curl_opt)) \
if (!_curl_is_off_t(value)) \
if(_curl_is_off_t_option(_curl_opt)) \
if(!_curl_is_off_t(value)) \
_curl_easy_setopt_err_curl_off_t(); \
if (_curl_is_string_option(_curl_opt)) \
if (!_curl_is_string(value)) \
if(_curl_is_string_option(_curl_opt)) \
if(!_curl_is_string(value)) \
_curl_easy_setopt_err_string(); \
if (_curl_is_write_cb_option(_curl_opt)) \
if (!_curl_is_write_cb(value)) \
if(_curl_is_write_cb_option(_curl_opt)) \
if(!_curl_is_write_cb(value)) \
_curl_easy_setopt_err_write_callback(); \
if ((_curl_opt) == CURLOPT_READFUNCTION) \
if (!_curl_is_read_cb(value)) \
if((_curl_opt) == CURLOPT_READFUNCTION) \
if(!_curl_is_read_cb(value)) \
_curl_easy_setopt_err_read_cb(); \
if ((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
if (!_curl_is_ioctl_cb(value)) \
if((_curl_opt) == CURLOPT_IOCTLFUNCTION) \
if(!_curl_is_ioctl_cb(value)) \
_curl_easy_setopt_err_ioctl_cb(); \
if ((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
if (!_curl_is_sockopt_cb(value)) \
if((_curl_opt) == CURLOPT_SOCKOPTFUNCTION) \
if(!_curl_is_sockopt_cb(value)) \
_curl_easy_setopt_err_sockopt_cb(); \
if ((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
if (!_curl_is_opensocket_cb(value)) \
if((_curl_opt) == CURLOPT_OPENSOCKETFUNCTION) \
if(!_curl_is_opensocket_cb(value)) \
_curl_easy_setopt_err_opensocket_cb(); \
if ((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
if (!_curl_is_progress_cb(value)) \
if((_curl_opt) == CURLOPT_PROGRESSFUNCTION) \
if(!_curl_is_progress_cb(value)) \
_curl_easy_setopt_err_progress_cb(); \
if ((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
if (!_curl_is_debug_cb(value)) \
if((_curl_opt) == CURLOPT_DEBUGFUNCTION) \
if(!_curl_is_debug_cb(value)) \
_curl_easy_setopt_err_debug_cb(); \
if ((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
if (!_curl_is_ssl_ctx_cb(value)) \
if((_curl_opt) == CURLOPT_SSL_CTX_FUNCTION) \
if(!_curl_is_ssl_ctx_cb(value)) \
_curl_easy_setopt_err_ssl_ctx_cb(); \
if (_curl_is_conv_cb_option(_curl_opt)) \
if (!_curl_is_conv_cb(value)) \
if(_curl_is_conv_cb_option(_curl_opt)) \
if(!_curl_is_conv_cb(value)) \
_curl_easy_setopt_err_conv_cb(); \
if ((_curl_opt) == CURLOPT_SEEKFUNCTION) \
if (!_curl_is_seek_cb(value)) \
if((_curl_opt) == CURLOPT_SEEKFUNCTION) \
if(!_curl_is_seek_cb(value)) \
_curl_easy_setopt_err_seek_cb(); \
if (_curl_is_cb_data_option(_curl_opt)) \
if (!_curl_is_cb_data(value)) \
if(_curl_is_cb_data_option(_curl_opt)) \
if(!_curl_is_cb_data(value)) \
_curl_easy_setopt_err_cb_data(); \
if ((_curl_opt) == CURLOPT_ERRORBUFFER) \
if (!_curl_is_error_buffer(value)) \
if((_curl_opt) == CURLOPT_ERRORBUFFER) \
if(!_curl_is_error_buffer(value)) \
_curl_easy_setopt_err_error_buffer(); \
if ((_curl_opt) == CURLOPT_STDERR) \
if (!_curl_is_FILE(value)) \
if((_curl_opt) == CURLOPT_STDERR) \
if(!_curl_is_FILE(value)) \
_curl_easy_setopt_err_FILE(); \
if (_curl_is_postfields_option(_curl_opt)) \
if (!_curl_is_postfields(value)) \
if(_curl_is_postfields_option(_curl_opt)) \
if(!_curl_is_postfields(value)) \
_curl_easy_setopt_err_postfields(); \
if ((_curl_opt) == CURLOPT_HTTPPOST) \
if (!_curl_is_arr((value), struct curl_httppost)) \
if((_curl_opt) == CURLOPT_HTTPPOST) \
if(!_curl_is_arr((value), struct curl_httppost)) \
_curl_easy_setopt_err_curl_httpost(); \
if (_curl_is_slist_option(_curl_opt)) \
if (!_curl_is_arr((value), struct curl_slist)) \
if(_curl_is_slist_option(_curl_opt)) \
if(!_curl_is_arr((value), struct curl_slist)) \
_curl_easy_setopt_err_curl_slist(); \
if ((_curl_opt) == CURLOPT_SHARE) \
if (!_curl_is_ptr((value), CURLSH)) \
if((_curl_opt) == CURLOPT_SHARE) \
if(!_curl_is_ptr((value), CURLSH)) \
_curl_easy_setopt_err_CURLSH(); \
} \
curl_easy_setopt(handle, _curl_opt, value); \
@ -111,18 +111,18 @@ __extension__ ({ \
#define curl_easy_getinfo(handle, info, arg) \
__extension__ ({ \
__typeof__ (info) _curl_info = info; \
if (__builtin_constant_p(_curl_info)) { \
if (_curl_is_string_info(_curl_info)) \
if (!_curl_is_arr((arg), char *)) \
if(__builtin_constant_p(_curl_info)) { \
if(_curl_is_string_info(_curl_info)) \
if(!_curl_is_arr((arg), char *)) \
_curl_easy_getinfo_err_string(); \
if (_curl_is_long_info(_curl_info)) \
if (!_curl_is_arr((arg), long)) \
if(_curl_is_long_info(_curl_info)) \
if(!_curl_is_arr((arg), long)) \
_curl_easy_getinfo_err_long(); \
if (_curl_is_double_info(_curl_info)) \
if (!_curl_is_arr((arg), double)) \
if(_curl_is_double_info(_curl_info)) \
if(!_curl_is_arr((arg), double)) \
_curl_easy_getinfo_err_double(); \
if (_curl_is_slist_info(_curl_info)) \
if (!_curl_is_arr((arg), struct curl_slist *)) \
if(_curl_is_slist_info(_curl_info)) \
if(!_curl_is_arr((arg), struct curl_slist *)) \
_curl_easy_getinfo_err_curl_slist(); \
} \
curl_easy_getinfo(handle, _curl_info, arg); \
@ -141,15 +141,17 @@ __extension__ ({ \
/* To define a new warning, use _CURL_WARNING(identifier, "message") */
#define _CURL_WARNING(id, message) \
static void __attribute__((warning(message))) __attribute__((unused)) \
__attribute__((noinline)) id(void) { __asm__(""); }
static void __attribute__((__warning__(message))) \
__attribute__((__unused__)) __attribute__((__noinline__)) \
id(void) { __asm__(""); }
_CURL_WARNING(_curl_easy_setopt_err_long,
"curl_easy_setopt expects a long argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_curl_off_t,
"curl_easy_setopt expects a curl_off_t argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_string,
"curl_easy_setopt expects a string (char* or char[]) argument for this option"
"curl_easy_setopt expects a "
"string (char* or char[]) argument for this option"
)
_CURL_WARNING(_curl_easy_setopt_err_write_callback,
"curl_easy_setopt expects a curl_write_callback argument for this option")
@ -160,7 +162,8 @@ _CURL_WARNING(_curl_easy_setopt_err_ioctl_cb,
_CURL_WARNING(_curl_easy_setopt_err_sockopt_cb,
"curl_easy_setopt expects a curl_sockopt_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_opensocket_cb,
"curl_easy_setopt expects a curl_opensocket_callback argument for this option"
"curl_easy_setopt expects a "
"curl_opensocket_callback argument for this option"
)
_CURL_WARNING(_curl_easy_setopt_err_progress_cb,
"curl_easy_setopt expects a curl_progress_callback argument for this option")
@ -173,9 +176,11 @@ _CURL_WARNING(_curl_easy_setopt_err_conv_cb,
_CURL_WARNING(_curl_easy_setopt_err_seek_cb,
"curl_easy_setopt expects a curl_seek_callback argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_cb_data,
"curl_easy_setopt expects a private data pointer as argument for this option")
"curl_easy_setopt expects a "
"private data pointer as argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_error_buffer,
"curl_easy_setopt expects a char buffer of CURL_ERROR_SIZE as argument for this option")
"curl_easy_setopt expects a "
"char buffer of CURL_ERROR_SIZE as argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_FILE,
"curl_easy_setopt expects a FILE* argument for this option")
_CURL_WARNING(_curl_easy_setopt_err_postfields,
@ -224,7 +229,7 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
(option) == CURLOPT_PROXYUSERNAME || \
(option) == CURLOPT_PROXYPASSWORD || \
(option) == CURLOPT_NOPROXY || \
(option) == CURLOPT_ENCODING || \
(option) == CURLOPT_ACCEPT_ENCODING || \
(option) == CURLOPT_REFERER || \
(option) == CURLOPT_USERAGENT || \
(option) == CURLOPT_COOKIE || \
@ -388,7 +393,8 @@ _CURL_WARNING(_curl_easy_getinfo_err_curl_slist,
/* evaluates to true if expr is abuffer suitable for CURLOPT_ERRORBUFFER */
/* XXX: also check size of an char[] array? */
#define _curl_is_error_buffer(expr) \
(__builtin_types_compatible_p(__typeof__(expr), char *) || \
(_curl_is_NULL(expr) || \
__builtin_types_compatible_p(__typeof__(expr), char *) || \
__builtin_types_compatible_p(__typeof__(expr), char[]))
/* evaluates to true if expr is of type (const) void* or (const) FILE* */
@ -481,7 +487,8 @@ typedef int (_curl_sockopt_callback1)(void *, curl_socket_t, curlsocktype);
typedef int (_curl_sockopt_callback2)(const void *, curl_socket_t,
curlsocktype);
/* evaluates to true if expr is of type curl_opensocket_callback or "similar" */
/* evaluates to true if expr is of type curl_opensocket_callback or
"similar" */
#define _curl_is_opensocket_cb(expr) \
(_curl_is_NULL(expr) || \
__builtin_types_compatible_p(__typeof__(expr), curl_opensocket_callback) ||\
@ -516,7 +523,11 @@ typedef int (_curl_progress_callback2)(const void *,
_curl_callback_compatible((expr), _curl_debug_callback1) || \
_curl_callback_compatible((expr), _curl_debug_callback2) || \
_curl_callback_compatible((expr), _curl_debug_callback3) || \
_curl_callback_compatible((expr), _curl_debug_callback4))
_curl_callback_compatible((expr), _curl_debug_callback4) || \
_curl_callback_compatible((expr), _curl_debug_callback5) || \
_curl_callback_compatible((expr), _curl_debug_callback6) || \
_curl_callback_compatible((expr), _curl_debug_callback7) || \
_curl_callback_compatible((expr), _curl_debug_callback8))
typedef int (_curl_debug_callback1) (CURL *,
curl_infotype, char *, size_t, void *);
typedef int (_curl_debug_callback2) (CURL *,
@ -525,6 +536,14 @@ typedef int (_curl_debug_callback3) (CURL *,
curl_infotype, const char *, size_t, void *);
typedef int (_curl_debug_callback4) (CURL *,
curl_infotype, const char *, size_t, const void *);
typedef int (_curl_debug_callback5) (CURL *,
curl_infotype, unsigned char *, size_t, void *);
typedef int (_curl_debug_callback6) (CURL *,
curl_infotype, unsigned char *, size_t, const void *);
typedef int (_curl_debug_callback7) (CURL *,
curl_infotype, const unsigned char *, size_t, void *);
typedef int (_curl_debug_callback8) (CURL *,
curl_infotype, const unsigned char *, size_t, const void *);
/* evaluates to true if expr is of type curl_ssl_ctx_callback or "similar" */
/* this is getting even messier... */
@ -550,7 +569,8 @@ typedef CURLcode (_curl_ssl_ctx_callback4)(CURL *, const void *, const void *);
typedef CURLcode (_curl_ssl_ctx_callback5)(CURL *, SSL_CTX, void *);
typedef CURLcode (_curl_ssl_ctx_callback6)(CURL *, SSL_CTX, const void *);
typedef CURLcode (_curl_ssl_ctx_callback7)(CURL *, const SSL_CTX, void *);
typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX, const void *);
typedef CURLcode (_curl_ssl_ctx_callback8)(CURL *, const SSL_CTX,
const void *);
#else
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback5;
typedef _curl_ssl_ctx_callback1 _curl_ssl_ctx_callback6;

View File

@ -1 +0,0 @@
/* not used */

View File

@ -1 +1 @@
fa6c63eca77d50e8429ab658766c97f8f9b91ae5
b0c8a791905972b4daf96fcdf2e63a9c3ded0ef3

View File

@ -55,16 +55,21 @@ void CCMessageBox(const char * pszMsg, const char * pszTitle)
void CCLuaLog(const char *pszMsg)
{
int bufflen = MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, NULL, 0);
++bufflen;
WCHAR* buff = new WCHAR[bufflen];
memset(buff, 0, sizeof(WCHAR) * bufflen);
MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, buff, bufflen - 1);
WCHAR* widebuff = new WCHAR[bufflen + 1];
memset(widebuff, 0, sizeof(WCHAR) * (bufflen + 1));
MultiByteToWideChar(CP_UTF8, 0, pszMsg, -1, widebuff, bufflen);
OutputDebugStringW(buff);
OutputDebugStringW(widebuff);
OutputDebugStringA("\n");
puts(pszMsg);
bufflen = WideCharToMultiByte(CP_ACP, 0, widebuff, -1, NULL, 0, NULL, NULL);
char* buff = new char[bufflen + 1];
memset(buff, 0, sizeof(char) * (bufflen + 1));
WideCharToMultiByte(CP_ACP, 0, widebuff, -1, buff, bufflen, NULL, NULL);
puts(buff);
delete[] widebuff;
delete[] buff;
}
NS_CC_END

View File

@ -697,6 +697,14 @@ void CCEGLView::setViewPortInPoints(float x , float y , float w , float h)
(GLsizei)(h * m_fScaleY * m_fFrameZoomFactor));
}
void CCEGLView::setScissorInPoints(float x , float y , float w , float h)
{
glScissor((GLint)(x * m_fScaleX * m_fFrameZoomFactor + m_obViewPortRect.origin.x * m_fFrameZoomFactor),
(GLint)(y * m_fScaleY * m_fFrameZoomFactor + m_obViewPortRect.origin.y * m_fFrameZoomFactor),
(GLsizei)(w * m_fScaleX * m_fFrameZoomFactor),
(GLsizei)(h * m_fScaleY * m_fFrameZoomFactor));
}
CCEGLView* CCEGLView::sharedOpenGLView()
{
static CCEGLView* s_pEglView = NULL;

View File

@ -73,6 +73,8 @@ public:
void setAccelerometerKeyHook( LPFN_ACCELEROMETER_KEYHOOK lpfnAccelerometerKeyHook );
virtual void setViewPortInPoints(float x , float y , float w , float h);
virtual void setScissorInPoints(float x , float y , float w , float h);
// static function
/**
@brief get the shared main open gl window

View File

@ -208,7 +208,7 @@
<link>
<name>tilemap_parallax_nodes</name>
<type>2</type>
<locationURI>PARENT-1-PROJECT_LOC/tileMap_parallax_nodes</locationURI>
<locationURI>PARENT-1-PROJECT_LOC/tilemap_parallax_nodes</locationURI>
</link>
<link>
<name>touch_dispatcher</name>

View File

@ -23,10 +23,14 @@ INCLUDES = -I.. \
-I../platform/third_party/linux/libxml2 \
-I../platform/third_party/linux/libpng \
-I../platform/third_party/linux/libjpeg \
-I../platform/third_party/linux/libtiff/include \
-I../platform/third_party/linux/ \
-I../platform/third_party/linux/libtiff/include
# -I../platform/third_party/linux/libpng \
LBITS := $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)
INCLUDES += -I$(COCOS2DX_PATH)/platform/third_party/linux/include64
else
INCLUDES += -I$(COCOS2DX_PATH)/platform/third_party/linux
endif
DEFINES = -DLINUX
DEFINES += -D__CC_PLATFORM_FILEUTILS_CPP__
@ -191,7 +195,6 @@ OBJECTS = ../actions/CCAction.o \
# ../../extensions/CCListView/CCListView.o \
# ../../extensions/GUI/CCTextureWatcher/CCTextureWatcher.o \
LBITS := $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)
STATICLIBS_DIR = ../platform/third_party/linux/libraries/lib64
else

View File

@ -546,11 +546,16 @@ void CCSprite::updateTransform(void)
setDirty(false);
}
// recursively iterate over children
if( m_bHasChildren )
{
arrayMakeObjectsPerformSelector(m_pChildren, updateTransform, CCSprite*);
}
// MARMALADE CHANGED
// recursively iterate over children
/* if( m_bHasChildren )
{
// MARMALADE: CHANGED TO USE CCNode*
// NOTE THAT WE HAVE ALSO DEFINED virtual CCNode::updateTransform()
arrayMakeObjectsPerformSelector(m_pChildren, updateTransform, CCSprite*);
}*/
CCNode::updateTransform();
#if CC_SPRITE_DEBUG_DRAW
// draw bounding box
CCPoint vertices[4] = {

View File

@ -642,7 +642,7 @@ void CCSpriteBatchNode::removeSpriteFromAtlas(CCSprite *pobSprite)
// update all sprites beyond this one
unsigned int count = m_pobDescendants->count();
for(; uIndex < count; ++uIndex)
{
CCSprite* s = (CCSprite*)(m_pobDescendants->objectAtIndex(uIndex));

View File

@ -29,7 +29,7 @@ THE SOFTWARE.
using namespace std;
NS_CC_BEGIN;
NS_CC_BEGIN
static CCNotificationCenter *s_sharedNotifCenter = NULL;
@ -214,4 +214,4 @@ CCObject *CCNotificationObserver::getObject()
return m_object;
}
NS_CC_END;
NS_CC_END

View File

@ -28,38 +28,71 @@ THE SOFTWARE.
#include "cocoa/CCObject.h"
#include "cocoa/CCArray.h"
NS_CC_BEGIN;
NS_CC_BEGIN
class CC_DLL CCNotificationCenter : public CCObject
{
public:
/** CCNotificationCenter constructor */
CCNotificationCenter();
/** CCNotificationCenter destructor */
~CCNotificationCenter();
/** Gets the single instance of CCNotificationCenter. */
static CCNotificationCenter *sharedNotificationCenter(void);
/** Destroys the single instance of CCNotificationCenter. */
static void purgeNotificationCenter(void);
/** @brief Adds an observer for the specified target.
* @param target The target which wants to observe notification events.
* @param selector The callback function which will be invoked when the specified notification event was posted.
* @param name The name of this notification.
* @param obj The extra parameter which will be passed to the callback function.
*/
void addObserver(CCObject *target,
SEL_CallFuncO selector,
const char *name,
CCObject *obj);
/** @brief Removes the observer by the specified target and name.
* @param target The target of this notification.
* @param name The name of this notification.
*/
void removeObserver(CCObject *target,const char *name);
/** @brief Registers one hander for script binding.
* @note Only supports Lua Binding now.
* @param handler The lua handler.
*/
void registerScriptObserver(int handler);
/** Unregisters script observer */
void unregisterScriptObserver(void);
/** @brief Posts one notification event by name.
* @param name The name of this notification.
*/
void postNotification(const char *name);
/** @brief Posts one notification event by name.
* @param name The name of this notification.
* @param object The extra parameter.
*/
void postNotification(const char *name, CCObject *object);
/** @brief Gets script handler.
* @note Only supports Lua Binding now.
* @return The script handle.
*/
inline int getScriptHandler() { return m_scriptHandler; };
private:
//
// internal functions
//
// Check whether the observer exists by the specified target and name.
bool observerExisted(CCObject *target,const char *name);
//
// variables
//
CCArray *m_observers;
@ -69,12 +102,21 @@ private:
class CC_DLL CCNotificationObserver : public CCObject
{
public:
/** @brief CCNotificationObserver constructor
* @param target The target which wants to observer notification events.
* @param selector The callback function which will be invoked when the specified notification event was posted.
* @param name The name of this notification.
* @param obj The extra parameter which will be passed to the callback function.
*/
CCNotificationObserver(CCObject *target,
SEL_CallFuncO selector,
const char *name,
CCObject *obj);
/** CCNotificationObserver destructor function */
~CCNotificationObserver();
/** Invokes the callback function of this observer */
void performSelector(CCObject *obj);
private:
CC_PROPERTY_READONLY(CCObject *, m_target, Target);
@ -83,6 +125,6 @@ private:
CC_PROPERTY_READONLY(CCObject *, m_object, Object);
};
NS_CC_END;
NS_CC_END
#endif//__CCNOTIFICATIONCENTER_H__

View File

@ -33,6 +33,14 @@ bool CCBAnimationManager::init()
mNodeSequences = new CCDictionary();
mBaseValues = new CCDictionary();
mDocumentOutletNames = CCArray::create();
mDocumentOutletNodes = CCArray::create();
mDocumentCallbackNames = CCArray::create();
mDocumentCallbackNodes = CCArray::create();
mTarget = NULL;
mAnimationCompleteCallbackFunc = NULL;
return true;
}
@ -85,6 +93,52 @@ void CCBAnimationManager::setRootNode(CCNode *pRootNode)
CC_SAFE_RETAIN(mRootNode);
}
void CCBAnimationManager::setDocumentControllerName(const std::string &name) {
mDocumentControllerName = name;
}
std::string CCBAnimationManager::getDocumentControllerName() {
return mDocumentControllerName;
}
void CCBAnimationManager::addDocumentCallbackNode(CCNode *node) {
mDocumentCallbackNodes->addObject(node);
}
void CCBAnimationManager::addDocumentCallbackName(std::string name) {
CCString *tmpName = CCString::create(name);
mDocumentCallbackNames->addObject(tmpName);
}
CCArray* CCBAnimationManager::getDocumentCallbackNames() {
return mDocumentCallbackNames;
}
CCArray* CCBAnimationManager::getDocumentCallbackNodes() {
return mDocumentCallbackNodes;
}
void CCBAnimationManager::addDocumentOutletNode(CCNode *node) {
mDocumentOutletNodes->addObject(node);
}
void CCBAnimationManager::addDocumentOutletName(std::string name) {
mDocumentOutletNames->addObject(CCString::create(name));
}
CCArray* CCBAnimationManager::getDocumentOutletNames() {
return mDocumentOutletNames;
}
CCArray* CCBAnimationManager::getDocumentOutletNodes() {
return mDocumentOutletNodes;
}
std::string CCBAnimationManager::getLastCompletedSequenceName() {
return lastCompletedSequenceName;
}
const CCSize& CCBAnimationManager::getRootContainerSize()
{
return mRootContainerSize;
@ -181,6 +235,24 @@ CCBSequence* CCBAnimationManager::getSequence(int nSequenceId)
return NULL;
}
void CCBAnimationManager::moveAnimationsFromNode(CCNode* fromNode, CCNode* toNode) {
// Move base values
CCObject* baseValue = mBaseValues->objectForKey((intptr_t)fromNode);
if(baseValue) {
mBaseValues->setObject(baseValue, (intptr_t)toNode);
mBaseValues->removeObjectForKey((intptr_t)fromNode);
}
// Move seqs
CCObject *seqs = mNodeSequences->objectForKey((intptr_t)fromNode);
if(seqs) {
mNodeSequences->setObject(seqs, (intptr_t)toNode);
mNodeSequences->removeObjectForKey((intptr_t)fromNode);
}
}
// Refer to CCBReader::readKeyframe() for the real type of value
CCActionInterval* CCBAnimationManager::getAction(CCBKeyframe *pKeyframe0, CCBKeyframe *pKeyframe1, const char *pPropName, CCNode *pNode)
{
@ -265,15 +337,15 @@ CCActionInterval* CCBAnimationManager::getAction(CCBKeyframe *pKeyframe0, CCBKey
return NULL;
}
void CCBAnimationManager::setAnimatedProperty(const char *pPropName, CCNode *pNode, CCObject *pValue, float fTweenDuraion)
void CCBAnimationManager::setAnimatedProperty(const char *pPropName, CCNode *pNode, CCObject *pValue, float fTweenDuration)
{
if (fTweenDuraion > 0)
if (fTweenDuration > 0)
{
// Create a fake keyframe to generate the action from
CCBKeyframe *kf1 = new CCBKeyframe();
kf1->autorelease();
kf1->setValue(pValue);
kf1->setTime(fTweenDuraion);
kf1->setTime(fTweenDuration);
kf1->setEasingType(kCCBKeyframeEasingLinear);
// Animate
@ -334,7 +406,16 @@ void CCBAnimationManager::setAnimatedProperty(const char *pPropName, CCNode *pNo
ccColor3BWapper *color = (ccColor3BWapper*)pValue;
((CCSprite*)pNode)->setColor(color->getColor());
}
else
else if (strcmp(pPropName, "visible") == 0)
{
bool x = (bool)pValue;
if(x) {
CCSequence::createWithTwoActions(CCDelayTime::create(fTweenDuration), CCShow::create());
} else {
CCSequence::createWithTwoActions(CCDelayTime::create(fTweenDuration), CCHide::create());
}
}
else
{
CCLog("unsupported property name is %s", pPropName);
CCAssert(false, "unsupported property now");
@ -540,13 +621,37 @@ void CCBAnimationManager::debug()
}
void CCBAnimationManager::setAnimationCompletedCallback(CCObject *target, SEL_CallFunc callbackFunc) {
if (target)
{
target->retain();
}
if (mTarget)
{
mTarget->release();
}
mTarget = target;
mAnimationCompleteCallbackFunc = callbackFunc;
}
void CCBAnimationManager::sequenceCompleted()
{
if(lastCompletedSequenceName != mRunningSequence->getName()) {
lastCompletedSequenceName = mRunningSequence->getName();
}
if (mDelegate)
{
mDelegate->completedAnimationSequenceNamed(mRunningSequence->getName());
}
if (mTarget && mAnimationCompleteCallbackFunc) {
(mTarget->*mAnimationCompleteCallbackFunc)();
}
int nextSeqId = mRunningSequence->getChainedSequenceId();
mRunningSequence = NULL;

View File

@ -29,6 +29,16 @@ private:
CCBAnimationManagerDelegate *mDelegate;
CCBSequence *mRunningSequence;
CCArray *mDocumentOutletNames;
CCArray *mDocumentOutletNodes;
CCArray *mDocumentCallbackNames;
CCArray *mDocumentCallbackNodes;
std::string mDocumentControllerName;
std::string lastCompletedSequenceName;
SEL_CallFunc mAnimationCompleteCallbackFunc;
CCObject *mTarget;
public:
CCBAnimationManager();
~CCBAnimationManager();
@ -41,7 +51,23 @@ public:
void setAutoPlaySequenceId(int autoPlaySequenceId);
CCNode* getRootNode();
void setRootNode(CCNode* pRootNode); // retain
void setRootNode(CCNode* pRootNode); // retain
void addDocumentCallbackNode(CCNode *node);
void addDocumentCallbackName(std::string name);
void addDocumentOutletNode(CCNode *node);
void addDocumentOutletName(std::string name);
void setDocumentControllerName(const std::string &name);
std::string getDocumentControllerName();
CCArray* getDocumentCallbackNames();
CCArray* getDocumentCallbackNodes();
CCArray* getDocumentOutletNames();
CCArray* getDocumentOutletNodes();
std::string getLastCompletedSequenceName();
const CCSize& getRootContainerSize();
void setRootContainerSize(const CCSize &rootContainerSize);
@ -55,11 +81,13 @@ public:
void addNode(CCNode *pNode, CCDictionary *pSeq);
void setBaseValue(CCObject *pValue, CCNode *pNode, const char *pPropName);
void moveAnimationsFromNode(CCNode* fromNode, CCNode* toNode);
void runAnimations(const char *pName, float fTweenDuration);
void runAnimations(const char *pName);
void runAnimations(int nSeqId, float fTweenDuraiton);
void setAnimationCompletedCallback(CCObject *target, SEL_CallFunc callbackFunc);
void debug();
private:

View File

@ -91,6 +91,11 @@ CCBReader::CCBReader(CCBReader * pCCBReader)
this->mCCBMemberVariableAssigner = pCCBReader->mCCBMemberVariableAssigner;
this->mCCBSelectorResolver = pCCBReader->mCCBSelectorResolver;
this->mCCNodeLoaderListener = pCCBReader->mCCNodeLoaderListener;
this->mOwnerCallbackNames = pCCBReader->mOwnerCallbackNames;
this->mOwnerCallbackNodes = pCCBReader->mOwnerCallbackNodes;
this->mOwnerOutletNames = pCCBReader->mOwnerOutletNames;
this->mOwnerOutletNodes = pCCBReader->mOwnerOutletNodes;
}
CCBReader::CCBReader()
@ -227,6 +232,12 @@ CCNode* CCBReader::readNodeGraphFromData(CCData *pData, CCObject *pOwner, const
initWithData(pData, pOwner);
mActionManager->setRootContainerSize(parentSize);
mOwnerOutletNames = CCArray::create();
mOwnerOutletNodes = CCArray::create();
mOwnerCallbackNames = CCArray::create();
mOwnerCallbackNodes = CCArray::create();
CCNode *pNodeGraph = readFileWithCleanUp(true);
if (pNodeGraph && mActionManager->getAutoPlaySequenceId() != -1)
@ -234,7 +245,20 @@ CCNode* CCBReader::readNodeGraphFromData(CCData *pData, CCObject *pOwner, const
// Auto play animations
mActionManager->runAnimations(mActionManager->getAutoPlaySequenceId(), 0);
}
if(jsControlled) {
mNodesWithAnimationManagers = CCArray::create();
mAnimationManagerForNodes = CCArray::create();
}
for(int i = 0; i < mAnimationManagers.size(); ++i) {
if(jsControlled) {
mNodesWithAnimationManagers->addObject(mAnimationManagers[i].first);
mAnimationManagerForNodes->addObject(mAnimationManagers[i].second);
}
}
// Return action manager by reference
if (ppAnimationManager)
{
@ -289,6 +313,8 @@ bool CCBReader::readHeader() {
return false;
}
jsControlled = this->readBool();
return true;
}
@ -321,7 +347,9 @@ CCNode* CCBReader::readFileWithCleanUp(bool bCleanUp)
}
CCNode *pNode = readNodeGraph();
mAnimationManagers.push_back(std::make_pair(pNode, mActionManager));
if (bCleanUp)
{
cleanUpNodeGraph(pNode);
@ -459,6 +487,12 @@ CCNode * CCBReader::readNodeGraph(CCNode * pParent) {
/* Read class name. */
CCString * className = this->readCachedString();
CCString * jsControlledName;
if(jsControlled) {
jsControlledName = this->readCachedString();
}
// Read assignment type and name
int memberVarAssignmentType = this->readInt(false);
CCString * memberVarAssignmentName;
@ -481,6 +515,10 @@ CCNode * CCBReader::readNodeGraph(CCNode * pParent) {
mActionManager->setRootNode(node);
}
if(jsControlled && node == mActionManager->getRootNode()) {
mActionManager->setDocumentControllerName(jsControlledName->getCString());
}
// Read animated properties
CCDictionary *seqs = CCDictionary::create();
mAnimatedProps = new set<string>();
@ -538,6 +576,8 @@ CCNode * CCBReader::readNodeGraph(CCNode * pParent) {
embeddedNode->setVisible(true);
embeddedNode->ignoreAnchorPointForPosition(ccbFileNode->isIgnoreAnchorPointForPosition());
mActionManager->moveAnimationsFromNode(ccbFileNode, embeddedNode);
ccbFileNode->setCCBFileNode(NULL);
node = embeddedNode;
@ -551,6 +591,7 @@ CCNode * CCBReader::readNodeGraph(CCNode * pParent) {
}*/
#else
if(memberVarAssignmentType != kCCBTargetTypeNone) {
if(!jsControlled) {
CCObject * target = NULL;
if(memberVarAssignmentType == kCCBTargetTypeDocumentRoot)
{
@ -574,6 +615,15 @@ CCNode * CCBReader::readNodeGraph(CCNode * pParent) {
this->mCCBMemberVariableAssigner->onAssignCCBMemberVariable(target, memberVarAssignmentName, node);
}
}
} else {
if(memberVarAssignmentType == kCCBTargetTypeDocumentRoot) {
mActionManager->addDocumentOutletName(memberVarAssignmentName->getCString());
mActionManager->addDocumentOutletNode(node);
} else {
mOwnerOutletNames->addObject(CCString::create(memberVarAssignmentName->getCString()));
mOwnerOutletNodes->addObject(node);
}
}
}
#endif // CCB_ENABLE_JAVASCRIPT
@ -759,6 +809,60 @@ bool CCBReader::endsWith(CCString * pString, CCString * pEnding) {
}
}
bool CCBReader::isJSControlled() {
return jsControlled;
}
void CCBReader::addOwnerCallbackName(std::string name) {
mOwnerCallbackNames->addObject(CCString::create(name));
}
void CCBReader::addOwnerCallbackNode(CCNode *node) {
mOwnerCallbackNodes->addObject(node);
}
void CCBReader::addDocumentCallbackName(std::string name) {
mActionManager->addDocumentCallbackName(name);
}
void CCBReader::addDocumentCallbackNode(CCNode *node) {
mActionManager->addDocumentCallbackNode(node);
}
CCArray* CCBReader::getOwnerCallbackNames() {
return mOwnerCallbackNames;
}
CCArray* CCBReader::getOwnerCallbackNodes() {
return mOwnerCallbackNodes;
}
CCArray* CCBReader::getOwnerOutletNames() {
return mOwnerOutletNames;
}
CCArray* CCBReader::getOwnerOutletNodes() {
return mOwnerOutletNodes;
}
CCArray* CCBReader::getNodesWithAnimationManagers() {
return mNodesWithAnimationManagers;
}
CCArray* CCBReader::getAnimationManagersForNodes() {
return mAnimationManagerForNodes;
}
std::vector<std::pair<CCNode *, CCBAnimationManager *> > CCBReader::getAnimationManagers() {
return mAnimationManagers;
}
void CCBReader::setAnimationManagers(std::vector<std::pair<CCNode *, CCBAnimationManager *> > x) {
mAnimationManagers = x;
}
/************************************************************************
Static functions
************************************************************************/

View File

@ -26,7 +26,7 @@
return NULL; \
}
#define kCCBVersion 3
#define kCCBVersion 4
enum {
kCCBPropTypePosition = 0,
@ -166,6 +166,8 @@ class CCBKeyframe;
class CCBReader : public CCObject
{
private:
bool jsControlled;
CCData *mData;
unsigned char *mBytes;
int mCurrentByte;
@ -177,12 +179,23 @@ private:
CCObject *mOwner;
CCBAnimationManager *mActionManager;
std::vector<std::pair<CCNode*, CCBAnimationManager *> > mAnimationManagers;
std::set<std::string> *mAnimatedProps;
CCNodeLoaderLibrary *mCCNodeLoaderLibrary;
CCNodeLoaderListener *mCCNodeLoaderListener;
CCBMemberVariableAssigner *mCCBMemberVariableAssigner;
CCBSelectorResolver *mCCBSelectorResolver;
CCBSelectorResolver *mCCBSelectorResolver;
CCArray* mOwnerOutletNames;
CCArray* mOwnerOutletNodes;
CCArray* mNodesWithAnimationManagers;
CCArray* mAnimationManagerForNodes;
CCArray* mOwnerCallbackNames;
CCArray* mOwnerCallbackNodes;
public:
CCBReader(CCNodeLoaderLibrary *pCCNodeLoaderLibrary, CCBMemberVariableAssigner *pCCBMemberVariableAssigner = NULL, CCBSelectorResolver *pCCBSelectorResolver = NULL, CCNodeLoaderListener *pCCNodeLoaderListener = NULL);
@ -231,6 +244,24 @@ public:
bool readBool();
float readFloat();
CCString* readCachedString();
bool isJSControlled();
CCArray *getOwnerCallbackNames();
CCArray *getOwnerCallbackNodes();
CCArray* getOwnerOutletNames();
CCArray* getOwnerOutletNodes();
CCArray* getNodesWithAnimationManagers();
CCArray* getAnimationManagersForNodes();
std::vector<std::pair<CCNode *, CCBAnimationManager *> > getAnimationManagers();
void setAnimationManagers(std::vector<std::pair<CCNode *, CCBAnimationManager *> > x);
void addOwnerCallbackName(std::string name);
void addOwnerCallbackNode(CCNode *node);
void addDocumentCallbackName(std::string name);
void addDocumentCallbackNode(CCNode *node);
static float getResolutionScale();

View File

@ -680,54 +680,55 @@ BlockData * CCNodeLoader::parsePropTypeBlock(CCNode * pNode, CCNode * pParent, C
if(selectorTarget != kCCBTargetTypeNone) {
CCObject * target = NULL;
if(selectorTarget == kCCBTargetTypeDocumentRoot) {
target = pCCBReader->getAnimationManager()->getRootNode();
} else if(selectorTarget == kCCBTargetTypeOwner) {
target = pCCBReader->getOwner();
if(!pCCBReader->isJSControlled()) {
/* Scripting specific code because selector function is common for all callbacks.
* So if we had 1 target and 1 selector function, the context (callback function name)
* would get lost. Hence the need for a new target for each callback.
*/
if(pCCBReader->hasScriptingOwner) {
CCBScriptOwnerProtocol *proxy = dynamic_cast<CCBScriptOwnerProtocol *>(pCCBReader->getOwner());
if(proxy) {
target = dynamic_cast<CCObject *>(proxy->createNew());
}
if(selectorTarget == kCCBTargetTypeDocumentRoot) {
target = pCCBReader->getAnimationManager()->getRootNode();
} else if(selectorTarget == kCCBTargetTypeOwner) {
target = pCCBReader->getOwner();
}
}
if(target != NULL) {
if(selectorName->length() > 0) {
SEL_MenuHandler selMenuHandler = 0;
CCBSelectorResolver * targetAsCCBSelectorResolver = dynamic_cast<CCBSelectorResolver *>(target);
if(targetAsCCBSelectorResolver != NULL) {
selMenuHandler = targetAsCCBSelectorResolver->onResolveCCBCCMenuItemSelector(target, selectorName);
}
if(selMenuHandler == 0) {
CCBSelectorResolver * ccbSelectorResolver = pCCBReader->getCCBSelectorResolver();
if(ccbSelectorResolver != NULL) {
selMenuHandler = ccbSelectorResolver->onResolveCCBCCMenuItemSelector(target, selectorName);
if(target != NULL) {
if(selectorName->length() > 0) {
SEL_MenuHandler selMenuHandler = 0;
CCBSelectorResolver * targetAsCCBSelectorResolver = dynamic_cast<CCBSelectorResolver *>(target);
if(targetAsCCBSelectorResolver != NULL) {
selMenuHandler = targetAsCCBSelectorResolver->onResolveCCBCCMenuItemSelector(target, selectorName);
}
if(selMenuHandler == 0) {
CCBSelectorResolver * ccbSelectorResolver = pCCBReader->getCCBSelectorResolver();
if(ccbSelectorResolver != NULL) {
selMenuHandler = ccbSelectorResolver->onResolveCCBCCMenuItemSelector(target, selectorName);
}
}
if(selMenuHandler == 0) {
CCLOG("Skipping selector '%s' since no CCBSelectorResolver is present.", selectorName->getCString());
} else {
BlockData * blockData = new BlockData();
blockData->mSELMenuHandler = selMenuHandler;
blockData->mTarget = target;
return blockData;
}
}
if(selMenuHandler == 0) {
CCLOG("Skipping selector '%s' since no CCBSelectorResolver is present.", selectorName->getCString());
} else {
BlockData * blockData = new BlockData();
blockData->mSELMenuHandler = selMenuHandler;
blockData->mTarget = target;
return blockData;
CCLOG("Unexpected empty selector.");
}
} else {
CCLOG("Unexpected empty selector.");
CCLOG("Unexpected NULL target for selector.");
}
} else {
CCLOG("Unexpected NULL target for selector.");
if(selectorTarget == kCCBTargetTypeDocumentRoot) {
pCCBReader->addDocumentCallbackNode(pNode);
pCCBReader->addDocumentCallbackName(selectorName->getCString());
} else {
pCCBReader->addOwnerCallbackNode(pNode);
pCCBReader->addOwnerCallbackName(selectorName->getCString());
}
}
}
@ -740,45 +741,57 @@ BlockCCControlData * CCNodeLoader::parsePropTypeBlockCCControl(CCNode * pNode, C
int controlEvents = pCCBReader->readInt(false);
if(selectorTarget != kCCBTargetTypeNone) {
CCObject * target = NULL;
if(selectorTarget == kCCBTargetTypeDocumentRoot) {
target = pCCBReader->getAnimationManager()->getRootNode();
} else if(selectorTarget == kCCBTargetTypeOwner) {
target = pCCBReader->getOwner();
}
if(target != NULL) {
if(selectorName->length() > 0) {
SEL_CCControlHandler selCCControlHandler = 0;
CCBSelectorResolver * targetAsCCBSelectorResolver = dynamic_cast<CCBSelectorResolver *>(target);
if(targetAsCCBSelectorResolver != NULL) {
selCCControlHandler = targetAsCCBSelectorResolver->onResolveCCBCCControlSelector(target, selectorName);
}
if(selCCControlHandler == 0) {
CCBSelectorResolver * ccbSelectorResolver = pCCBReader->getCCBSelectorResolver();
if(ccbSelectorResolver != NULL) {
selCCControlHandler = ccbSelectorResolver->onResolveCCBCCControlSelector(target, selectorName);
if(!pCCBReader->isJSControlled()) {
CCObject * target = NULL;
if(selectorTarget == kCCBTargetTypeDocumentRoot) {
target = pCCBReader->getAnimationManager()->getRootNode();
} else if(selectorTarget == kCCBTargetTypeOwner) {
target = pCCBReader->getOwner();
}
if(target != NULL) {
if(selectorName->length() > 0) {
SEL_CCControlHandler selCCControlHandler = 0;
CCBSelectorResolver * targetAsCCBSelectorResolver = dynamic_cast<CCBSelectorResolver *>(target);
if(targetAsCCBSelectorResolver != NULL) {
selCCControlHandler = targetAsCCBSelectorResolver->onResolveCCBCCControlSelector(target, selectorName);
}
if(selCCControlHandler == 0) {
CCBSelectorResolver * ccbSelectorResolver = pCCBReader->getCCBSelectorResolver();
if(ccbSelectorResolver != NULL) {
selCCControlHandler = ccbSelectorResolver->onResolveCCBCCControlSelector(target, selectorName);
}
}
if(selCCControlHandler == 0) {
CCLOG("Skipping selector '%s' since no CCBSelectorResolver is present.", selectorName->getCString());
} else {
BlockCCControlData * blockCCControlData = new BlockCCControlData();
blockCCControlData->mSELCCControlHandler = selCCControlHandler;
blockCCControlData->mTarget = target;
blockCCControlData->mControlEvents = controlEvents;
return blockCCControlData;
}
}
if(selCCControlHandler == 0) {
CCLOG("Skipping selector '%s' since no CCBSelectorResolver is present.", selectorName->getCString());
} else {
BlockCCControlData * blockCCControlData = new BlockCCControlData();
blockCCControlData->mSELCCControlHandler = selCCControlHandler;
blockCCControlData->mTarget = target;
blockCCControlData->mControlEvents = controlEvents;
return blockCCControlData;
CCLOG("Unexpected empty selector.");
}
} else {
CCLOG("Unexpected empty selector.");
CCLOG("Unexpected NULL target for selector.");
}
} else {
CCLOG("Unexpected NULL target for selector.");
if(selectorTarget == kCCBTargetTypeDocumentRoot) {
pCCBReader->addDocumentCallbackNode(pNode);
pCCBReader->addDocumentCallbackName(selectorName->getCString());
} else {
pCCBReader->addOwnerCallbackNode(pNode);
pCCBReader->addOwnerCallbackName(selectorName->getCString());
}
}
}
@ -804,9 +817,13 @@ CCNode * CCNodeLoader::parsePropTypeCCBFile(CCNode * pNode, CCNode * pParent, CC
ccbReader->initWithData(data, pCCBReader->getOwner());
data->release();
ccbReader->getAnimationManager()->setRootContainerSize(pParent->getContentSize());
ccbReader->setAnimationManagers(pCCBReader->getAnimationManagers());
CCNode * ccbFileNode = ccbReader->readFileWithCleanUp(false);
pCCBReader->setAnimationManagers(ccbReader->getAnimationManagers());
if (ccbFileNode && ccbReader->getAnimationManager()->getAutoPlaySequenceId() != -1)
{
// Auto play animations

View File

@ -162,7 +162,7 @@ bool CCControlHuePicker::checkSliderPosition(CCPoint location)
double distance = sqrt(pow (location.x + 10, 2) + pow(location.y, 2));
// check that the touch location is within the circle
if (160 > distance && distance > 118)
if (80 > distance && distance > 59)
{
updateSliderPosition(location);
return true;

View File

@ -398,9 +398,9 @@ CCHttpClient* CCHttpClient::getInstance()
void CCHttpClient::destroyInstance()
{
CCDirector::sharedDirector()->getScheduler()->unscheduleSelector(schedule_selector(CCHttpClient::dispatchResponseCallbacks),
CCHttpClient::getInstance());
CC_SAFE_RELEASE_NULL(s_pHttpClient);
CC_ASSERT(s_pHttpClient);
CCDirector::sharedDirector()->getScheduler()->unscheduleSelector(schedule_selector(CCHttpClient::dispatchResponseCallbacks), s_pHttpClient);
s_pHttpClient->release();
}
CCHttpClient::CCHttpClient()
@ -420,7 +420,7 @@ CCHttpClient::~CCHttpClient()
sem_post(s_pSem);
}
CCDirector::sharedDirector()->getScheduler()->unscheduleSelector(schedule_selector(CCHttpClient::dispatchResponseCallbacks), this);
s_pHttpClient = NULL;
}
//Lazy create semaphore & mutex & thread

View File

@ -14,30 +14,40 @@ AppDelegate::~AppDelegate()
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
CCDirector *pDirector = CCDirector::sharedDirector();
CCDirector* pDirector = CCDirector::sharedDirector();
CCEGLView* pEGLView = CCEGLView::sharedOpenGLView();
pDirector->setOpenGLView(CCEGLView::sharedOpenGLView());
//pDirector->setProjection(kCCDirectorProjection2D);
CCSize screenSize = CCEGLView::sharedOpenGLView()->getFrameSize();
if (screenSize.height > 768)
{
CCFileUtils::sharedFileUtils()->setResourceDirectory("ipadhd");
pDirector->setContentScaleFactor(1536.0f/kDesignResolutionSize_height);
pDirector->setOpenGLView(pEGLView);
// Set the design resolution
pEGLView->setDesignResolutionSize(designResolutionSize.width, designResolutionSize.height, kResolutionNoBorder);
CCSize frameSize = pEGLView->getFrameSize();
// In this demo, we select resource according to the frame's height.
// If the resource size is different from design resolution size, you need to set contentScaleFactor.
// We use the ratio of resource's height to the height of design resolution,
// this can make sure that the resource's height could fit for the height of design resolution.
// if the frame's height is larger than the height of medium resource size, select large resource.
if (frameSize.height > mediumResource.size.height)
{
CCFileUtils::sharedFileUtils()->setResourceDirectory(largeResource.directory);
pDirector->setContentScaleFactor(largeResource.size.height/designResolutionSize.height);
}
else if (screenSize.height > 320)
{
CCFileUtils::sharedFileUtils()->setResourceDirectory("ipad");
pDirector->setContentScaleFactor(768.0f/kDesignResolutionSize_height);
// if the frame's height is larger than the height of small resource size, select medium resource.
else if (frameSize.height > smallResource.size.height)
{
CCFileUtils::sharedFileUtils()->setResourceDirectory(mediumResource.directory);
pDirector->setContentScaleFactor(mediumResource.size.height/designResolutionSize.height);
}
// if the frame's height is smaller than the height of medium resource size, select small resource.
else
{
CCFileUtils::sharedFileUtils()->setResourceDirectory("iphone");
pDirector->setContentScaleFactor(320.0f/kDesignResolutionSize_height);
{
CCFileUtils::sharedFileUtils()->setResourceDirectory(smallResource.directory);
pDirector->setContentScaleFactor(smallResource.size.height/designResolutionSize.height);
}
CCEGLView::sharedOpenGLView()->setDesignResolutionSize(kDesignResolutionSize_width, kDesignResolutionSize_height, kResolutionNoBorder);
// turn on display FPS
pDirector->setDisplayStats(true);

View File

@ -1,30 +1,56 @@
#ifndef __APPMACROS_H__
#define __APPMACROS_H__
#include "cocos2d.h"
#define kDesignResolution_480x320 0
#define kDesignResolution_1024x768 1
#define kDesignResolution_2048x1536 2
/* For demonstrating using one design resolution to match different resources,
or one resource to match different design resolutions.
#define kTargetDesignResolutionSize kDesignResolution_2048x1536
[Situation 1] Using one design resolution to match different resources.
Please look into Appdelegate::applicationDidFinishLaunching.
We check current device frame size to decide which resource need to be selected.
So if you want to test this situation which said in title '[Situation 1]',
you should change ios simulator to different device(e.g. iphone, iphone-retina3.5, iphone-retina4.0, ipad, ipad-retina),
or change the window size in "proj.XXX/main.cpp" by "CCEGLView::setFrameSize" if you are using win32 or linux plaform
and modify "proj.mac/AppController.mm" by changing the window rectangle.
#if (kTargetDesignResolutionSize == kDesignResolution_480x320)
#define kDesignResolutionSize_width 480.0f
#define kDesignResolutionSize_height 320.0f
[Situation 2] Using one resource to match different design resolutions.
The coordinates in your codes is based on your current design resolution rather than resource size.
Therefore, your design resolution could be very large and your resource size could be small.
To test this, just define the marco 'TARGET_DESIGN_RESOLUTION_SIZE' to 'DESIGN_RESOLUTION_2048X1536'
and open iphone simulator or create a window of 480x320 size.
[Note] Normally, developer just need to define one design resolution(e.g. 960x640) with one or more resources.
*/
#elif (kTargetDesignResolutionSize == kDesignResolution_1024x768)
#define kDesignResolutionSize_width 1024.0f
#define kDesignResolutionSize_height 768.0f
#define DESIGN_RESOLUTION_480X320 0
#define DESIGN_RESOLUTION_1024X768 1
#define DESIGN_RESOLUTION_2048X1536 2
#elif (kTargetDesignResolutionSize == kDesignResolution_2048x1536)
#define kDesignResolutionSize_width 2048.0f
#define kDesignResolutionSize_height 1536.0f
/* If you want to switch design resolution, change next line */
#define TARGET_DESIGN_RESOLUTION_SIZE DESIGN_RESOLUTION_2048X1536
typedef struct tagResource
{
cocos2d::CCSize size;
char directory[100];
}Resource;
static Resource smallResource = { cocos2d::CCSizeMake(480, 320), "iphone" };
static Resource mediumResource = { cocos2d::CCSizeMake(1024, 768), "ipad" };
static Resource largeResource = { cocos2d::CCSizeMake(2048, 1536), "ipadhd" };
#if (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_480X320)
static cocos2d::CCSize designResolutionSize = cocos2d::CCSizeMake(480, 320);
#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_1024X768)
static cocos2d::CCSize designResolutionSize = cocos2d::CCSizeMake(1024, 768);
#elif (TARGET_DESIGN_RESOLUTION_SIZE == DESIGN_RESOLUTION_2048X1536)
static cocos2d::CCSize designResolutionSize = cocos2d::CCSizeMake(2048, 1536);
#else
#error unknown target design resolution!
#endif
#define kTitleFontSize (kDesignResolutionSize_width / 480.0f * 24)
// The font size 24 is designed for small resolution, so we should change it to fit for current design resolution
#define TITLE_FONT_SIZE (cocos2d::CCEGLView::sharedOpenGLView()->getDesignResolutionSize().width / smallResource.size.width * 24)
#endif /* __APPMACROS_H__ */

View File

@ -56,7 +56,7 @@ bool HelloWorld::init()
// add a label shows "Hello World"
// create and initialize a label
CCLabelTTF* pLabel = CCLabelTTF::create("Hello World", "Arial", kTitleFontSize);
CCLabelTTF* pLabel = CCLabelTTF::create("Hello World", "Arial", TITLE_FONT_SIZE);
// position the label on the center of the screen
pLabel->setPosition(ccp(origin.x + visibleSize.width/2,

Some files were not shown because too many files have changed in this diff Show More