-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
97 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,42 @@ | ||
#define MAX_PATH 1024 | ||
#include <string.h> | ||
|
||
#ifndef COMMON_HEAD | ||
#define COMMON_HEAD | ||
/** | ||
* 定义返回结果 | ||
*/ | ||
typedef struct OutputInfo{ | ||
int result; | ||
int size; | ||
char* output; | ||
} OutputInfo; | ||
|
||
|
||
/** | ||
* 定义一个缓存字符数组长度和指针的节点 | ||
*/ | ||
struct OutputNode { | ||
int size; | ||
char* buffer; | ||
struct OutputNode* next; | ||
} ; | ||
|
||
/** | ||
* 通过一个队列来缓存所有的字符数组,这样在最后可以拼接起来复制成一个字符数组 | ||
*/ | ||
struct OutputQueue { | ||
struct OutputNode* firstNode; | ||
struct OutputNode* endNode; | ||
int allSize; | ||
}; | ||
|
||
struct OutputQueue* initOutputQueue(); | ||
|
||
void addOutputNode(struct OutputQueue *queue,int size,char* buffer); | ||
|
||
void output(struct OutputQueue *queue,OutputInfo *result); | ||
|
||
void freeQueue(struct OutputQueue *queue); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
#include "jattach.c" | ||
|
||
int main(int argc,char ** argv){ | ||
size_t length; | ||
char source[81920] ; | ||
jattach(&source,&length,atoi(argv[1]),argv[2],"",1); | ||
return 0; | ||
OutputInfo outputInfo; | ||
int result=jattach(&outputInfo,atoi(argv[1]),argv[2],"",1); | ||
return result; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters