parent
eb65affba5
commit
0f78ceedd1
@ -1,6 +1,8 @@ |
||||
{ |
||||
"files.associations": { |
||||
"stdio.h": "c", |
||||
"c_wrapper.h": "c" |
||||
} |
||||
"ostream": "cpp", |
||||
"chrono": "cpp", |
||||
"thread": "cpp" |
||||
}, |
||||
"C_Cpp.errorSquiggles": "disabled" |
||||
} |
@ -0,0 +1,28 @@ |
||||
{ |
||||
"tasks": [ |
||||
{ |
||||
"type": "cppbuild", |
||||
"label": "C/C++: g++ build active file", |
||||
"command": "/usr/bin/g++", |
||||
"args": [ |
||||
"-fdiagnostics-color=always", |
||||
"-g", |
||||
"${file}", |
||||
"-o", |
||||
"${fileDirname}/${fileBasenameNoExtension}" |
||||
], |
||||
"options": { |
||||
"cwd": "${fileDirname}" |
||||
}, |
||||
"problemMatcher": [ |
||||
"$gcc" |
||||
], |
||||
"group": { |
||||
"kind": "build", |
||||
"isDefault": true |
||||
}, |
||||
"detail": "Task generated by Debugger." |
||||
} |
||||
], |
||||
"version": "2.0.0" |
||||
} |
@ -0,0 +1,9 @@ |
||||
#!/bin/bash |
||||
|
||||
rm ./openimsdk.so ./openimsdk.h |
||||
go build -buildmode=c-shared -trimpath -ldflags="-s -w" -o openimsdk.so export.go constant.go protocol.go tools.go |
||||
|
||||
|
||||
# build cpp sdk |
||||
# rm ./openimsdkcc.so |
||||
# g++ -fPIC -shared -o openimsdkcc.so openimsdkcc.cc ./openimsdk.so |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,283 @@ |
||||
/* Code generated by cmd/cgo; DO NOT EDIT. */ |
||||
|
||||
/* package command-line-arguments */ |
||||
|
||||
|
||||
#line 1 "cgo-builtin-export-prolog" |
||||
|
||||
#include <stddef.h> |
||||
|
||||
#ifndef GO_CGO_EXPORT_PROLOGUE_H |
||||
#define GO_CGO_EXPORT_PROLOGUE_H |
||||
|
||||
#ifndef GO_CGO_GOSTRING_TYPEDEF |
||||
typedef struct { const char *p; ptrdiff_t n; } _GoString_; |
||||
#endif |
||||
|
||||
#endif |
||||
|
||||
/* Start of preamble from import "C" comments. */ |
||||
|
||||
|
||||
#line 3 "export.go" |
||||
|
||||
#include <stdio.h> |
||||
typedef void (*CB_S)(char *); |
||||
typedef void (*CB_I_S)(int,char *); |
||||
typedef void (*CB_S_I_S_S)(char *,int,char *,char *); |
||||
typedef void (*CB_S_I_S_S_I)(char *,int,char *,char *,int); |
||||
extern void Call_CB_S(CB_S func,char* data); |
||||
extern void Call_CB_I_S(CB_I_S func,int event,char* data); |
||||
extern void Call_CB_S_I_S_S(CB_S_I_S_S func,char *,int errCode,char* errMsg,char* data); |
||||
extern void Call_CB_S_I_S_S_I(CB_S_I_S_S_I func,char *,int errCode,char* errMsg,char* data,int progress); |
||||
extern CB_S DebugPrint; |
||||
|
||||
|
||||
#line 1 "cgo-generated-wrapper" |
||||
|
||||
|
||||
/* End of preamble from import "C" comments. */ |
||||
|
||||
|
||||
/* Start of boilerplate cgo prologue. */ |
||||
#line 1 "cgo-gcc-export-header-prolog" |
||||
|
||||
#ifndef GO_CGO_PROLOGUE_H |
||||
#define GO_CGO_PROLOGUE_H |
||||
|
||||
typedef signed char GoInt8; |
||||
typedef unsigned char GoUint8; |
||||
typedef short GoInt16; |
||||
typedef unsigned short GoUint16; |
||||
typedef int GoInt32; |
||||
typedef unsigned int GoUint32; |
||||
typedef long long GoInt64; |
||||
typedef unsigned long long GoUint64; |
||||
typedef GoInt64 GoInt; |
||||
typedef GoUint64 GoUint; |
||||
typedef size_t GoUintptr; |
||||
typedef float GoFloat32; |
||||
typedef double GoFloat64; |
||||
#ifdef _MSC_VER |
||||
#include <complex.h> |
||||
typedef _Fcomplex GoComplex64; |
||||
typedef _Dcomplex GoComplex128; |
||||
#else |
||||
typedef float _Complex GoComplex64; |
||||
typedef double _Complex GoComplex128; |
||||
#endif |
||||
|
||||
/*
|
||||
static assertion to make sure the file is being used on architecture |
||||
at least with matching size of GoInt. |
||||
*/ |
||||
typedef char _check_for_64_bit_pointer_matching_GoInt[sizeof(void*)==64/8 ? 1:-1]; |
||||
|
||||
#ifndef GO_CGO_GOSTRING_TYPEDEF |
||||
typedef _GoString_ GoString; |
||||
#endif |
||||
typedef void *GoMap; |
||||
typedef void *GoChan; |
||||
typedef struct { void *t; void *v; } GoInterface; |
||||
typedef struct { void *data; GoInt len; GoInt cap; } GoSlice; |
||||
|
||||
#endif |
||||
|
||||
/* End of boilerplate cgo prologue. */ |
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
extern void set_print(CB_S print); |
||||
extern void set_group_listener(CB_I_S cCallback); |
||||
extern void set_conversation_listener(CB_I_S cCallback); |
||||
extern void set_advanced_msg_listener(CB_I_S cCallback); |
||||
extern void set_batch_msg_listener(CB_I_S cCallback); |
||||
extern void set_user_listener(CB_I_S cCallback); |
||||
extern void set_friend_listener(CB_I_S cCallback); |
||||
extern void set_custom_business_listener(CB_I_S cCallback); |
||||
extern GoUint8 init_sdk(CB_I_S cCallback, char* operationID, char* config); |
||||
extern void un_init_sdk(char* operationID); |
||||
extern void login(CB_S_I_S_S cCallback, char* operationID, char* uid, char* token); |
||||
extern void logout(CB_S_I_S_S cCallback, char* operationID); |
||||
extern void network_status_changed(CB_S_I_S_S cCallback, char* operationID); |
||||
extern GoInt get_login_status(char* operationID); |
||||
extern char* get_login_user(); |
||||
extern char* create_text_message(char* operationID, char* text); |
||||
extern char* create_advanced_text_message(char* operationID, char* text, char* messageEntityList); |
||||
extern char* create_text_at_message(char* operationID, char* text, char* atUserList, char* atUsersInfo, char* message); |
||||
extern char* create_location_message(char* operationID, char* description, double longitude, double latitude); |
||||
extern char* create_custom_message(char* operationID, char* data, char* extension, char* description); |
||||
extern char* create_quote_message(char* operationID, char* text, char* message); |
||||
extern char* create_advanced_quote_message(char* operationID, char* text, char* message, char* messageEntityList); |
||||
extern char* create_card_message(char* operationID, char* cardInfo); |
||||
extern char* create_video_message_from_full_path(char* operationID, char* videoFullPath, char* videoType, long long int duration, char* snapshotFullPath); |
||||
extern char* create_image_message_from_full_path(char* operationID, char* imageFullPath); |
||||
extern char* create_sound_message_from_full_path(char* operationID, char* soundPath, long long int duration); |
||||
extern char* create_file_message_from_full_path(char* operationID, char* fileFullPath, char* fileName); |
||||
extern char* create_image_message(char* operationID, char* imagePath); |
||||
extern char* create_image_message_by_url(char* operationID, char* sourcePicture, char* bigPicture, char* snapshotPicture); |
||||
extern char* create_sound_message_by_url(char* operationID, char* soundBaseInfo); |
||||
extern char* create_sound_message(char* operationID, char* soundPath, long long int duration); |
||||
extern char* create_video_message_by_url(char* operationID, char* videoBaseInfo); |
||||
extern char* create_video_message(char* operationID, char* videoPath, char* videoType, long long int duration, char* snapshotPath); |
||||
extern char* create_file_message_by_url(char* operationID, char* fileBaseInfo); |
||||
extern char* create_file_message(char* operationID, char* filePath, char* fileName); |
||||
extern char* create_merger_message(char* operationID, char* messageList, char* title, char* summaryList); |
||||
extern char* create_face_message(char* operationID, int index, char* data); |
||||
extern char* create_forward_message(char* operationID, char* m); |
||||
extern void get_all_conversation_list(CB_S_I_S_S cCallback, char* operationID); |
||||
extern void get_advanced_history_message_list(CB_S_I_S_S cCallback, char* operationID, char* getMessageOptions); |
||||
extern void send_message(CB_S_I_S_S_I cCallback, char* operationID, char* message, char* recvID, char* groupID, char* offlinePushInfo); |
||||
|
||||
// =====================================================user===============================================
|
||||
//
|
||||
extern void get_users_info(CB_S_I_S_S cCallback, char* operationID, char* userIDs); |
||||
extern void get_users_info_from_srv(CB_S_I_S_S cCallback, char* operationID, char* userIDs); |
||||
extern void set_self_info(CB_S_I_S_S cCallback, char* operationID, char* userInfo); |
||||
extern void get_self_user_info(CB_S_I_S_S cCallback, char* operationID); |
||||
extern void update_msg_sender_info(CB_S_I_S_S cCallback, char* operationID, char* nickname, char* faceURL); |
||||
extern void subscribe_users_status(CB_S_I_S_S cCallback, char* operationID, char* userIDs); |
||||
extern void unsubscribe_users_status(CB_S_I_S_S cCallback, char* operationID, char* userIDs); |
||||
extern void get_subscribe_users_status(CB_S_I_S_S cCallback, char* operationID); |
||||
extern void get_user_status(CB_S_I_S_S cCallback, char* operationID, char* userIDs); |
||||
|
||||
// =====================================================friend===============================================
|
||||
//
|
||||
extern void get_specified_friends_info(CB_S_I_S_S cCallback, char* operationID, char* userIDList); |
||||
extern void get_friend_list(CB_S_I_S_S cCallback, char* operationID); |
||||
extern void get_friend_list_page(CB_S_I_S_S cCallback, char* operationID, int offset, int count); |
||||
extern void search_friends(CB_S_I_S_S cCallback, char* operationID, char* searchParam); |
||||
extern void check_friend(CB_S_I_S_S cCallback, char* operationID, char* userIDList); |
||||
extern void add_friend(CB_S_I_S_S cCallback, char* operationID, char* userIDReqMsg); |
||||
extern void set_friend_remark(CB_S_I_S_S cCallback, char* operationID, char* userIDRemark); |
||||
extern void delete_friend(CB_S_I_S_S cCallback, char* operationID, char* friendUserID); |
||||
extern void get_friend_application_list_as_recipient(CB_S_I_S_S cCallback, char* operationID); |
||||
extern void get_friend_application_list_as_applicant(CB_S_I_S_S cCallback, char* operationID); |
||||
extern void accept_friend_application(CB_S_I_S_S cCallback, char* operationID, char* userIDHandleMsg); |
||||
extern void refuse_friend_application(CB_S_I_S_S cCallback, char* operationID, char* userIDHandleMsg); |
||||
extern void add_black(CB_S_I_S_S cCallback, char* operationID, char* blackUserID); |
||||
extern void get_black_list(CB_S_I_S_S cCallback, char* operationID); |
||||
extern void remove_black(CB_S_I_S_S cCallback, char* operationID, char* removeUserID); |
||||
|
||||
// =====================================================group===============================================
|
||||
// CreateGroup creates a group
|
||||
//
|
||||
extern void create_group(CB_S_I_S_S cCallback, char* operationID, char* cGroupReqInfo); |
||||
|
||||
// JoinGroup joins a group
|
||||
//
|
||||
extern void join_group(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cReqMsg, int cJoinSource); |
||||
|
||||
// QuitGroup quits a group
|
||||
//
|
||||
extern void quit_group(CB_S_I_S_S cCallback, char* operationID, char* cGroupID); |
||||
|
||||
// DismissGroup dismisses a group
|
||||
//
|
||||
extern void dismiss_group(CB_S_I_S_S cCallback, char* operationID, char* cGroupID); |
||||
|
||||
// ChangeGroupMute changes the mute status of a group
|
||||
//
|
||||
extern void change_group_mute(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, int cIsMute); |
||||
|
||||
// ChangeGroupMemberMute changes the mute status of a group member
|
||||
//
|
||||
extern void change_group_member_mute(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cUserID, int cMutedSeconds); |
||||
|
||||
// SetGroupMemberRoleLevel sets the role level of a group member
|
||||
//
|
||||
extern void set_group_member_role_level(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cUserID, int cRoleLevel); |
||||
|
||||
// SetGroupMemberInfo sets the information of a group member
|
||||
//
|
||||
extern void set_group_member_info(CB_S_I_S_S cCallback, char* operationID, char* cGroupMemberInfo); |
||||
|
||||
// GetJoinedGroupList retrieves the list of joined groups
|
||||
//
|
||||
extern void get_joined_group_list(CB_S_I_S_S cCallback, char* operationID); |
||||
|
||||
// GetSpecifiedGroupsInfo retrieves the information of specified groups
|
||||
//
|
||||
extern void get_specified_groups_info(CB_S_I_S_S cCallback, char* operationID, char* cGroupIDList); |
||||
|
||||
// SearchGroups searches for groups
|
||||
//
|
||||
extern void search_groups(CB_S_I_S_S cCallback, char* operationID, char* cSearchParam); |
||||
|
||||
// SetGroupInfo sets the information of a group
|
||||
//
|
||||
extern void set_group_info(CB_S_I_S_S cCallback, char* operationID, char* cGroupInfo); |
||||
|
||||
// SetGroupVerification sets the verification mode of a group
|
||||
//
|
||||
extern void set_group_verification(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, int cVerification); |
||||
|
||||
// SetGroupLookMemberInfo sets the member information visibility of a group
|
||||
//
|
||||
extern void set_group_look_member_info(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, int cRule); |
||||
|
||||
// SetGroupApplyMemberFriend sets the friend rule for group applicants
|
||||
//
|
||||
extern void set_group_apply_member_friend(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, int cRule); |
||||
|
||||
// GetGroupMemberList retrieves the list of group members
|
||||
//
|
||||
extern void get_group_member_list(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, int cFilter, int cOffset, int cCount); |
||||
|
||||
// GetGroupMemberOwnerAndAdmin retrieves the owner and admin members of a group
|
||||
//
|
||||
extern void get_group_member_owner_and_admin(CB_S_I_S_S cCallback, char* operationID, char* cGroupID); |
||||
|
||||
// GetGroupMemberListByJoinTimeFilter retrieves the list of group members filtered by join time
|
||||
//
|
||||
extern void get_group_member_list_by_join_time_filter(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, int cOffset, int cCount, long long int cJoinTimeBegin, long long int cJoinTimeEnd, char* cFilterUserIDList); |
||||
|
||||
// GetSpecifiedGroupMembersInfo retrieves the information of specified group members
|
||||
//
|
||||
extern void get_specified_group_members_info(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cUserIDList); |
||||
|
||||
// KickGroupMember kicks group members
|
||||
//
|
||||
extern void kick_group_member(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cReason, char* cUserIDList); |
||||
|
||||
// TransferGroupOwner transfers the ownership of a group
|
||||
//
|
||||
extern void transfer_group_owner(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cNewOwnerUserID); |
||||
|
||||
// InviteUserToGroup invites users to a group
|
||||
//
|
||||
extern void invite_user_to_group(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cReason, char* cUserIDList); |
||||
|
||||
// GetGroupApplicationListAsRecipient retrieves the group application list as a recipient
|
||||
//
|
||||
extern void get_group_application_list_as_recipient(CB_S_I_S_S cCallback, char* operationID); |
||||
|
||||
// GetGroupApplicationListAsApplicant retrieves the group application list as an applicant
|
||||
//
|
||||
extern void get_group_application_list_as_applicant(CB_S_I_S_S cCallback, char* operationID); |
||||
|
||||
// AcceptGroupApplication accepts a group application
|
||||
//
|
||||
extern void accept_group_application(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cFromUserID, char* cHandleMsg); |
||||
|
||||
// RefuseGroupApplication refuses a group application
|
||||
//
|
||||
extern void refuse_group_application(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cFromUserID, char* cHandleMsg); |
||||
|
||||
// SetGroupMemberNickname sets the nickname of a group member
|
||||
//
|
||||
extern void set_group_member_nickname(CB_S_I_S_S cCallback, char* operationID, char* cGroupID, char* cUserID, char* cGroupMemberNickname); |
||||
|
||||
// SearchGroupMembers searches for group members
|
||||
//
|
||||
extern void search_group_members(CB_S_I_S_S cCallback, char* operationID, char* cSearchParam); |
||||
|
||||
// IsJoinGroup checks if the user has joined a group
|
||||
//
|
||||
extern void is_join_group(CB_S_I_S_S cCallback, char* operationID, char* cGroupID); |
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
@ -0,0 +1,18 @@ |
||||
#!/bin/bash |
||||
|
||||
|
||||
# if arg 1 is c,or is none,means test c sdk |
||||
# if arg 1 is cc,means test cpp sdk |
||||
|
||||
rm ./test |
||||
if [ "$1" == "c" ] || [ "$1" == "" ]; then |
||||
echo "test c sdk" |
||||
gcc -o test ./test.c ./openimsdk.so |
||||
./test |
||||
exit 0 |
||||
elif [ "$1" == "cc" ]; then |
||||
echo "test cpp sdk" |
||||
g++ -o test ./test.cc ./openimsdk.so ./openimsdkcc.so |
||||
./test |
||||
exit 0 |
||||
fi |
Loading…
Reference in new issue