今天同事给我发来一个文件,说让我通过android调用里面的函数文件是:
里面的内容是:
call_so.cpp文件的内容:
#pragma pack(1) //非常重要的申明,内存对齐的方法,影响sizeof()的结果
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
#include "operation_tools.h"
#include "call_so.h"
char uv_file_name[1024];
int uv_class_type = 1;
int uf_call_so_file(LPBYTE InHdib,RECT InArea)
{
printf("InArea.left=%ld,right=%ld,top=%ld,bottom=%ld\r\n",InArea.left,InArea.right,InArea.top,InArea.bottom);
return 1;
}
call_so.h的内容:
#ifndef __CALLSO__
#define __CALLSO__
int uf_call_so_file(LPBYTE InHdib,RECT InArea);
#endif
operation_tools.sh的内容:
#ifndef __OPERATIONTOOLS__
#define __OPERATIONTOOLS__
#include <sys/stat.h>
#include <new>
#include <iostream>
#include <cstdlib>
#include <math.h>
using namespace std;
typedef unsigned long DWORD;
typedef int BOOL;
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef float FLOAT;
//typedef DWORD far* LPDWORD;
typedef DWORD *LPDWORD;
typedef unsigned char * LPBYTE;
typedef int INT;
typedef unsigned int UINT;
typedef unsigned int *PUINT;
typedef long LONG;
#define pthread_t HANDLE
#define pthread_mutex_t HANDLE
#define pthread_cond_t HANDLE
typedef void *HANDLE;
typedef HANDLE HLOCAL;
typedef LPBYTE HDIB;
#define LPSTR char*
#include <memory.h>
#include <string.h>
#ifndef _RECT_
#define _RECT_
struct _RECT
{
long left;
long top;
long right;
long bottom;
} ;
#ifndef _DECLARE_MAXVALUE
#define _DECLARE_MAXVALUE
typedef struct
{
int Value;
int Dist;
double AngleNumber;
}MaxValue;
#endif
typedef _RECT RECT;
#define LMEM_MOVEABLE 0x0002
#define LMEM_ZEROINIT 0x0040
#define LHND (LMEM_MOVEABLE | LMEM_ZEROINIT)
/*
typedef int BOOL;
typedef unsigned char BYTE;
typedef float FLOAT;
typedef FLOAT *PFLOAT;
typedef char CHAR;
typedef unsigned char UCHAR;
typedef unsigned char *PUCHAR;
typedef short SHORT;
typedef unsigned short USHORT;
typedef unsigned short *PUSHORT;
typedef long LONG;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef long long LONGLONG;
typedef unsigned long long ULONGLONG;
typedef ULONGLONG *PULONGLONG;
typedef unsigned long ULONG;
typedef int INT;
typedef unsigned int UINT;
typedef unsigned int *PUINT;
typedef void VOID;
typedef char *LPSTR;
typedef const char *LPCSTR;
typedef wchar_t WCHAR;
typedef WCHAR *LPWSTR;
typedef const WCHAR *LPCWSTR;
typedef DWORD *LPDWORD;
typedef unsigned long UINT_PTR;
typedef UINT_PTR SIZE_T;
typedef LONGLONG USN;
typedef BYTE BOOLEAN;
typedef void *PVOID;
typedef struct _FILETIME {
DWORD dwLowDateTime;
DWORD dwHighDateTime;
} FILETIME;
typedef union _ULARGE_INTEGER {
struct {
DWORD LowPart;
DWORD HighPart;
};
struct {
DWORD LowPart;
DWORD HighPart;
} u;
ULONGLONG QuadPart;
} ULARGE_INTEGER,
*PULARGE_INTEGER;
*/
#endif
#ifndef _POINT_
#define _POINT_
struct _POINT
{
int x;
int y;
};
typedef _POINT POINT;
#endif
/*
#ifndef _NEW_
#define _NEW_
// 重载了全局的new操作符
void* operator new (unsigned int size)