易截截图软件、单文件、免安装、纯绿色、仅160KB

Linux JNI实例及其JNI程序设计模板

简单实例说明待补充,实例源码可在此链接下载http://d.download.csdn.net/down/2389895/sanlinux
jniNative.cpp
#include "jniNative.h"
#include "mymain.h"
#include <stdio.h>
JNIEXPORT void JNICALL Java_HelloWorld_print(JNIEnv *env, jobject arg, jstring instring)
{
    const char *str = (const char *)env->GetStringUTFChars(instring, JNI_FALSE);
    printf("HELLO,%s\n",str);
    env->ReleaseStringUTFChars(instring,str);
    return;
}
JNIEXPORT void JNICALL Java_HelloWorld_test(JNIEnv *env, jobject arg, jstring instring)
{
    const jbyte *str = (const jbyte *)env->GetStringUTFChars(instring, JNI_FALSE);
    test((const char *)str);
    env->ReleaseStringUTFChars(instring, (const char *)str);
    return;
}
jniNative.h
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class HelloWorld */
//javac HelloWorld.java
//javah HelloWorld
//Copy from HelloWorld.h
#ifndef _Included_HelloWorld
#define _Included_HelloWorld
#ifdef __cplusplus
extern "C" {
#endif
/*
 * Class:     HelloWorld
 * Method:    print
 * Signature: (Ljava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_HelloWorld_print
  (JNIEnv *, jobject, jstring);
/*
 * Class:     HelloWorld
 * Method:    test
 * Signature: (Ljava/lang/String;)V
 */
JNIEXPORT void JNICALL Java_HelloWorld_test
  (JNIEnv *, jobject, jstring);
#ifdef __cplusplus
}
#endif
#endif
mymain.cpp
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "mymain.h"
void test(const char *str)
{
    char ch[50];
    int len = 0;
   
    strcat(ch,"Hello ");
&nbs


相关文档:

LINUX c++线程池框架

版权声明:原文地址及作者不详,如有侵权,请联系;
本文给出了一个通用的线程池框架,该框架将与线程执行相关的任务进行了高层次的抽象,使之与具体的执行任务无关。另外该线程池具有动态伸缩性,它能根据执行任务的轻重自动调整线程池中线程的数量。文章的最后,我们给出一个简单示例程序,通过该示例程序,我们会发现, ......

Linux Shell自动交互的三种方法


你了解Linux系统么?你是Linux系统的应用者么?如果你要学习linux,你可能会遇到Linux Shell自动交互问题,这里将介绍Linux Shell自动交互的解决方法,在这里拿出来和大家分享一下。
一、背景
shell脚本在处理自动循环或大的任务方面可节省大量的时间,通过创建一个处理任务的命令清单,使用变量、条件、算术和循环等方 ......

linux shell种类

Linux中的shell有多种类型,其中最常用的几种是Bourne   shell(sh)、C   shell(csh)和Korn   shell(ksh)。三种shell各有优缺点。Bourne   shell是UNIX最初使用的shell,并且在每种UNIX上都可以使用。Bourne   shell在shell编程方面相当优秀,但在处理与用户的交互 ......

linux远程桌面管理VNC

author:skate
time:2010-05-24
以前也用过linux的远程图形界面管理程序x-win32,地址如下:
http://blog.csdn.net/wyzxg/archive/2007/09/10/1779148.aspx  
今天介绍在介绍一个图形管理软件vnc,简单配置如下
vnc服务端os版本:centos4.7
vnc client: nvc viewer客户端
1.检查vnc服务器是否安装
[root@ ......

《Linux内核源代码情景分析》读书笔记


宏内核与微内核

P2

      宏内核(
Monolithic
Kernel
)操作系统的
kernel
中既包含管理用户进程的组件,又包含向用户进程提供服务的组件(例如进程间通信、设备驱动程序、文件系统等),从而使得用户进程与操作系统
kernel
间存在着典型的
client/server
模型,但是这 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号