version 1.3, 2006/12/03 14:39:39
|
version 1.4, 2008/01/30 12:06:31
|
|
|
#define CONVERT_SIGNATURE_END PEGASUS_UINT64_LITERAL(0xFEDCBA9876543210) | #define CONVERT_SIGNATURE_END PEGASUS_UINT64_LITERAL(0xFEDCBA9876543210) |
#define CONVERT_SIZE (4 * sizeof (Uint64)) | #define CONVERT_SIZE (4 * sizeof (Uint64)) |
| |
#define ConvertEndianSwap(n) ((((n) & PEGASUS_UINT64_LITERAL(0xff00000000000000)) >> 56) | \ |
#define ConvertEndianSwap(n) \ |
|
((((n) & PEGASUS_UINT64_LITERAL(0xff00000000000000)) >> 56) | \ |
(((n) & PEGASUS_UINT64_LITERAL(0x00ff000000000000)) >> 40) | \ | (((n) & PEGASUS_UINT64_LITERAL(0x00ff000000000000)) >> 40) | \ |
(((n) & PEGASUS_UINT64_LITERAL(0x0000ff0000000000)) >> 24) | \ | (((n) & PEGASUS_UINT64_LITERAL(0x0000ff0000000000)) >> 24) | \ |
(((n) & PEGASUS_UINT64_LITERAL(0x000000ff00000000)) >> 8) | \ | (((n) & PEGASUS_UINT64_LITERAL(0x000000ff00000000)) >> 8) | \ |
|
|
| |
if (pui64[0] != CONVERT_SIGNATURE_BEGIN) | if (pui64[0] != CONVERT_SIGNATURE_BEGIN) |
{ | { |
PEGASUS_STD(cout)<<"TemplateConvertJavaToC "<<PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
PEGASUS_STD(cout)<<"TemplateConvertJavaToC "<< |
|
PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
*ptrap = 0; | *ptrap = 0; |
} | } |
if (pui64[1] != ConvertEndianSwap (pui64[2])) | if (pui64[1] != ConvertEndianSwap (pui64[2])) |
|
|
} | } |
if (pui64[3] != CONVERT_SIGNATURE_END) | if (pui64[3] != CONVERT_SIGNATURE_END) |
{ | { |
PEGASUS_STD(cout)<<"TemplateConvertJavaToC "<<PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
PEGASUS_STD(cout)<<"TemplateConvertJavaToC "<< |
|
PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
*ptrap = 0; | *ptrap = 0; |
} | } |
| |
PEGASUS_STD(cout)<<"TemplateConvertJavaToC "<<PEGASUS_STD(hex)<<(void*)p<<" -> "<<(void*)pui64[1]<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
PEGASUS_STD(cout)<<"TemplateConvertJavaToC "<< |
|
PEGASUS_STD(hex)<<(void*)p<<" -> "<<(void*)pui64[1]<< |
|
PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
| |
return (C)pui64[1]; | return (C)pui64[1]; |
} | } |
|
|
} | } |
else | else |
{ | { |
PEGASUS_STD(cout)<<"TemplateConvertCToJava"<<PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
PEGASUS_STD(cout)<<"TemplateConvertCToJava"<< |
|
PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
*ptrap = 0; | *ptrap = 0; |
} | } |
| |
PEGASUS_STD(cout)<<"TemplateConvertCToJava "<<PEGASUS_STD(hex)<<(void*)p<<" -> "<<(void*)pui64<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
PEGASUS_STD(cout)<<"TemplateConvertCToJava "<< |
|
PEGASUS_STD(hex)<<(void*)p<<" -> "<<(void*)pui64<< |
|
PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
| |
return (J)pui64; | return (J)pui64; |
} | } |
|
|
Uint64 *pui64 = (Uint64 *)p; | Uint64 *pui64 = (Uint64 *)p; |
Uint64 *ptrap = 0; | Uint64 *ptrap = 0; |
| |
PEGASUS_STD(cout)<<"TemplateConvertCleanup "<<PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
PEGASUS_STD(cout)<<"TemplateConvertCleanup "<< |
|
PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
| |
if (pui64[0] != CONVERT_SIGNATURE_BEGIN) | if (pui64[0] != CONVERT_SIGNATURE_BEGIN) |
{ | { |
|
|
| |
#define CONVERT_SIGNATURE_BEGIN 0xFE | #define CONVERT_SIGNATURE_BEGIN 0xFE |
#define CONVERT_SIGNATURE_END 0x12 | #define CONVERT_SIGNATURE_END 0x12 |
#define CONVERT_SIZE (sizeof (unsigned char) + sizeof (Uint64) + sizeof (unsigned char)) |
#define CONVERT_SIZE (sizeof(unsigned char)+ \ |
|
sizeof(Uint64)+ \ |
|
sizeof(unsigned char)) |
| |
template <typename J, typename C> | template <typename J, typename C> |
C TemplateConvertJavaToC (J p) | C TemplateConvertJavaToC (J p) |
|
|
| |
if (puch[0] != CONVERT_SIGNATURE_BEGIN) | if (puch[0] != CONVERT_SIGNATURE_BEGIN) |
{ | { |
PEGASUS_STD(cout)<<"TemplateConvertJavaToC "<<PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
PEGASUS_STD(cout)<<"TemplateConvertJavaToC "<< |
|
PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
*ptrap = 0; | *ptrap = 0; |
} | } |
if (puch[sizeof (unsigned char) + sizeof (Uint64)] != CONVERT_SIGNATURE_END) | if (puch[sizeof (unsigned char) + sizeof (Uint64)] != CONVERT_SIGNATURE_END) |
{ | { |
PEGASUS_STD(cout)<<"TemplateConvertJavaToC "<<PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
PEGASUS_STD(cout)<<"TemplateConvertJavaToC "<< |
|
PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
*ptrap = 0; | *ptrap = 0; |
} | } |
| |
PEGASUS_STD(cout)<<"TemplateConvertJavaToC "<<PEGASUS_STD(hex)<<(void*)p<<" -> "<<(void*)(*((long *)(puch + 1)))<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
PEGASUS_STD(cout)<<"TemplateConvertJavaToC "<< |
|
PEGASUS_STD(hex)<<(void*)p<<" -> "<<(void*)(*((long *)(puch + 1)))<< |
|
PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
| |
return (C)(void *)(*((Uint64 *)(puch + 1))); | return (C)(void *)(*((Uint64 *)(puch + 1))); |
} | } |
|
|
} | } |
else | else |
{ | { |
PEGASUS_STD(cout)<<"TemplateConvertCToJava"<<PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
PEGASUS_STD(cout)<<"TemplateConvertCToJava"<< |
|
PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
*ptrap = 0; | *ptrap = 0; |
} | } |
| |
PEGASUS_STD(cout)<<"TemplateConvertCToJava "<<PEGASUS_STD(hex)<<(void*)p<<" -> "<<(void *)puch<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
PEGASUS_STD(cout)<<"TemplateConvertCToJava "<< |
|
PEGASUS_STD(hex)<<(void*)p<<" -> "<<(void *)puch<< |
|
PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
| |
return (J)puch; | return (J)puch; |
} | } |
|
|
unsigned char *puch = (unsigned char *)p; | unsigned char *puch = (unsigned char *)p; |
unsigned char *ptrap = 0; | unsigned char *ptrap = 0; |
| |
PEGASUS_STD(cout)<<"TemplateConvertCleanup "<<PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
PEGASUS_STD(cout)<<"TemplateConvertCleanup "<< |
|
PEGASUS_STD(hex)<<(void*)p<<PEGASUS_STD(dec)<<PEGASUS_STD(endl); |
| |
if (puch[0] != CONVERT_SIGNATURE_BEGIN) | if (puch[0] != CONVERT_SIGNATURE_BEGIN) |
{ | { |
|
|
| |
#else | #else |
| |
#error "Unsupported conversion case in src/Pegasus/ProviderManager2/JMPI/Convert.h" |
#error "Unsupported conversion case in \ |
|
src/Pegasus/ProviderManager2/JMPI/Convert.h" |
| |
#endif | #endif |
| |