
C/C++
文章平均质量分 84
zbryan
这个作者很懒,什么都没留下…
展开
-
Android JNI实例
Android的SDK中没有包括JNI的支持,而且对如何支持JNI也没有任何文档说明。不过既然整个Android平台是开源的,我们可以通过Google发布的源代码来找到一些线索(比如frameworks/base/media/jni/目录),依葫芦画瓢的实现上层JAVA程序通过JNI来调用Native C程序中的函数。 依照下面的步骤可以实现一个非常简单的JNI的实例程序:转载 2013-05-14 16:57:13 · 790 阅读 · 0 评论 -
《Linux程序设计第四版》读书笔记 - 第一章 入门
1. UNIX Philosophy:SimplicityFocusReusable ComponentsFiltersOpen File Formats2. Directories:/bin: Binaries, programs used in booting the system/usr/bin: User binaries, st原创 2014-03-10 13:43:30 · 1083 阅读 · 0 评论 -
《Linux程序设计第四版》读书笔记 - 第二章 Shell程序设计
1. File descriptorinput 0output 1error output 2 2. RedirectRedirect output: ls -l > lsoutput.txtRedirect output(append): ps >> lsoutput.txtRedirect error output: kill 2325 >killout.txt原创 2014-03-10 13:46:34 · 978 阅读 · 0 评论 -
C语言string.h常用函数总结
转载请注明出处:http://blog.youkuaiyun.com/zhubin215130/article/details/8993403void *memcpy(void *dest, const void *src, size_t n);从源src所指的内存地址的起始位置开始拷贝n个字节到目标dest所指的内存地址的起始位置中.void *memmove( void*原创 2013-05-30 11:17:31 · 22876 阅读 · 0 评论 -
The reason to use void pointer
1) So the external program does not need all of the header files for all of the fields in the structure tDec_Int_File 2) To hide data and the implementation of the program. Even knowing how data is原创 2012-11-14 15:26:46 · 433 阅读 · 0 评论 -
select()函数以及FD_ZERO、FD_SET、FD_CLR、FD_ISSET
select函数用于在非阻塞中,当一个套接字或一组套接字有信号时通知你,系统提供select函数来实现多路复用输入/输出模型,原型: #include sys/time.h> #include unistd.h> int select(int maxfd,fd_set *rdset,fd_set *wrset,fd_set *exset,s转载 2012-08-15 10:15:57 · 1176 阅读 · 0 评论 -
对pthread_cond_wait()函数的理解
原文:了解 pthread_cond_wait() 的作用非常重要 -- 它是 POSIX 线程信号发送系统的核心,也是最难以理解的部分。 首先,让我们考虑以下情况:线程为查看已链接列表而锁定了互斥对象,然而该列表恰巧是空的。这一特定线程什么也干不了 -- 其设计意图是从列表中除去节点,但是现在却没有节点。因此,它只能: 锁定互斥对象时,线程将调用 pthread_co转载 2012-05-16 14:56:34 · 921 阅读 · 0 评论 -
Android编译环境 - 编译Native C的helloworld模块
Android编译环境本身比较复杂,且不像普通的编译环境:只有顶层目录下才有Makefile文件,而其他的每个component都使用统一标准的Android.mk. Android.mk文件本身是比较简单的,不过它并不是我们熟悉的Makefile,而是经过了Android自身编译系统的很多处理,因此要真正理清楚其中的联系还比较复杂,不过这种方式的好处在于,编写一个新的Android.mk来给An转载 2013-05-14 16:57:11 · 938 阅读 · 0 评论 -
How to port native (C/C++) library into android.
Android official documents don’t have supports for writing native (C/C++) applications or libraries on android. But after all, android is a new platform, a lots of useful software are unavailable on a转载 2013-05-14 16:57:15 · 1521 阅读 · 0 评论 -
《Linux程序设计第四版》读书笔记 - 第三章 文件操作
1. In Linux, everything is a file.Programs can use disk files, serial ports, printers, and other devices in exactly the same way they would use a file. 2. File’s inodeA special block of原创 2014-03-24 16:15:11 · 1330 阅读 · 0 评论