随笔分类 -  linux-app

linux下app开发
取消putty右键粘贴功能
摘要:还是非常喜欢putty的。就是右键默认的粘贴功能比较讨人厌。 阅读全文
posted @ 2013-11-07 14:52 J.evan 阅读(754) 评论(0) 推荐(0)
【转贴】android 添加新的键值,自定义按键
摘要:转自:http://hi.baidu.com/excalibur/item/ce90e99f3ad18acbb6253136 在android中,上层可使用的键值默认情况下是92个,从0-91;一般情况下,这些键值是够用的,但是如果想扩充的话,还是需要添加新的键值的,那么如何将一个新的键值从驱动的设置映射到上层,使应用可以对我们自定义的键值进行相应的处理呢? 对keypad来说,涉及到的文件有以下几个: 1,/vendor/qcom/7k_ffa_keypad.kl 首先在此文件中,添加新的键值信息:Example: key ... 阅读全文
posted @ 2012-11-15 16:52 J.evan 阅读(559) 评论(0) 推荐(0)
NanoHTTPD学习笔记 --未完成。
摘要:NanoHTTPD 1 // ================================================== 2 // Socket & server code 3 // ================================================== 4 5 /** 6 * Starts a HTTP server to given port.<p> 7 * Throws an IOException if the socket is already in use 8 */ 9 ... 阅读全文
posted @ 2012-11-03 11:39 J.evan 阅读(1338) 评论(0) 推荐(0)
strtok_r函数学习
摘要:上次使用strtok来取硬盘分区信息,感觉这个函数很好用。今天发现有bug,详见:http://www.cnblogs.com/hoys/archive/2011/09/19/2180999.html然后发现了strtok_r,写了个学习例子。代码如下: 1 /* 2 * Author : jevan 3 * Date : 2012.09.04 4 * Filename : strsep.c 5 */ 6 #include <stdlib.h> 7 #include <stdio.h> 8 #include <string.h> 9 10 int main( 阅读全文
posted @ 2012-09-04 15:54 J.evan 阅读(265) 评论(0) 推荐(0)
给定一个硬盘标识,umout掉所有相关挂载
摘要:1 #include <fcntl.h> 2 #include <string.h> 3 #include <assert.h> 4 #include <pthread.h> 5 #include <unistd.h> 6 #include <stdlib.h> 7 #include <sys/stat.h> 8 #include <sys/time.h> 9 #include <errno.h> 10 #include <stdio.h> 11 #include <l 阅读全文
posted @ 2012-08-30 15:23 J.evan 阅读(368) 评论(0) 推荐(0)
开发板上挂载NTFS分区
摘要:1 #使用ufsd通用分区格式来挂载ntfs分区2 mount -t ufsd /dev/sda5 /opt/ 为啥能使用ufsd来挂载NTFS分区呢???找到一篇文章:TP_UFSD_Data_Sheet.doc文章大概内容如下:波尔冈 通用文件系统驱动 UFSD 数据手册近年来,由于市面上各种操作系统和版本的流行,我们日常接触到的文件系统也变得越来越多样化了。我们这里提及的“文件系统”就是我们通常所说的磁盘格式。它是操作系统非常重要的一部分。所有文件的存储,管理和处理都离不开它。操作系统要依靠它来在硬盘上寻找、读取和使用所存储的文件。每种文件系统都有它自己的特点,而通常在推出一个新的操作系 阅读全文
posted @ 2012-08-29 16:31 J.evan 阅读(1399) 评论(0) 推荐(0)
一些自用的c函数
摘要:删除字符串中多余的空格,这个代码很烂,将就吧。1voiddel_multi_space(char*src)2{3if(!src)return;45intsrc_len=strlen(src);6char*dest=(char*)malloc(src_len+1);7memset(dest,0,src_len+1);89inti,j=0;10for(i=0;i<src_len;i++)11{12if(!((src[i]==32)&&(src[i+1]==32)))13dest[j++]=src[i];1415}16dest[j]='\0';17memset( 阅读全文
posted @ 2012-08-24 16:36 J.evan 阅读(167) 评论(0) 推荐(0)
c调用Api设置linux时间
摘要:抄自:http://baike.baidu.com/view/1983936.htm直接修改了编码和删除dos.h头文件,使其能在linux下运行。1#include<stdio.h>2#include<time.h>3intmain(void){4time_tt;5structtm*area;6t=time(NULL);7area=localtime(&t);8printf("Numberofsecondssince1/1/1970is:%ld\n",t);9printf("Localtimeis:%s",asctime 阅读全文
posted @ 2012-08-21 14:06 J.evan 阅读(307) 评论(0) 推荐(0)
write error:file too large!!!
摘要:这个错误出现在开发板中,文件系统为ext3 无ulimit 解决方案有2种:方案一 :limit1#include<sys/time.h>2#include<sys/resource.h>3intmodify_limit()4{5structrlimitlimitf;6if(getrlimit(RLIMIT_CORE,&limitf)==0){7printf("limitf.rlim_cur=0x%x,limitf.rlim_max=0x%x\n",limitf.rlim_cur,limitf.rlim_max);8limitf.rlim_c 阅读全文
posted @ 2012-08-16 12:28 J.evan 阅读(1837) 评论(0) 推荐(0)
mount的api使用笔记
摘要:命令下的mount使用时带各种参数,我在写c代码时却不知道参数加在什么地方,查了下资料,自己再做个记录:命令行:1mount-oiocharset=gb2312/dev/sdb1/mnt对应的c:1rest=mount(devPath,mntPath,"vfat",S_WRITE,"iocharset=gb2312");2//如果有多个options,以“,”分开 阅读全文
posted @ 2012-08-10 16:53 J.evan 阅读(494) 评论(0) 推荐(0)
不完全总结linux下c访问http
摘要:linux下纯C简单的HTTP POST请求 客户端模型 ---经典收藏,源代码打包httppost.tar,感谢博主c直接访问网页 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 #include <stdarg.h> 5 #include <sys/socket.h> 6 #include <netinet/in.h> 7 #include <netdb.h> 8 9 int htconnect(char *host, i 阅读全文
posted @ 2012-07-16 22:24 J.evan 阅读(923) 评论(0) 推荐(0)