2004年08月18日

The GNU Readline library provides a set of functions for use by applications that allow users to edit command lines as they are typed in. Both Emacs and vi editing modes are available. The Readline library includes additional functions to maintain a list of previously-entered command lines, to recall and perhaps reedit those lines, and perform csh-like history expansion on previous commands.

This function gives the user the default behaviour of TAB completion: completion on file names. If you do not want Readline to complete on filenames, you can change the binding of the TAB key with rl_bind_key().

int rl_bind_key (int key, rl_command_func_t *function);

rl_bind_key() takes two arguments: key is the character that you want to bind, and function is the address of the function to call when key is pressed. Binding TAB to rl_insert() makes TAB insert itself. rl_bind_key() returns non-zero if key is not a valid ASCII character code (between 0 and 255).

Thus, to disable the default TAB behavior, the following suffices:

rl_bind_key (‘\t’, rl_insert);

This code should be executed once at the start of your program; you might write a function called initialize_readline() which performs this and other desired initializations, such as installing custom completers.

————————————————————

GNU Readline Offical Site:
http://cnswww.cns.cwru.edu/~chet/readline/rltop.html

If you want to use GNU Readline library in your program:

* 1st, include <readline/readline.h> and <readline/history.h>
* 2nd, invoke readline function such as char *readline (const char *prompt); add_history (line);
 * 3rd, link source file with -lreadline -ltermcap arguments

2004年08月10日

Wickey v0.1已经基本实现了需要的功能,但是随着对Unix网络编程的更深入了解,越来越发现以前的设计有很多不完善的地方,如果在0.1的版本上继续修改,反而得不偿失。

所以决定,重新设计整个程序的架构,通信协议,功能模块。

预计新增加的主要功能如下

  • 客户端使用伪终端方式(目前不知道怎么实现。。telnet源码?)
  • 断点续传功能(有一点思路)
  • 增量备份功能
  • Good luck to myself~~

    2004年08月03日

    Wickey的一个部分。

    详细情况如下:

    http://www.loveunix.net/index.php?showtopic=35835
    http://www.linuxfans.org/nuke/modules.php?name=Forums

    如果问题能很好解决,原因也能搞清楚的话我打算写个详细的经验之类的东东。

    2004年08月01日

    今天修改了几个有关日志记录的函数,然后segment fault就犹如梦魇一般不断出现,怎么改也改不掉,也无法恢复程序到最初的状态,好郁闷啊。

    segment fault,段错误,与Glibc库中基本所有的函数都默认型参指针为非空有着密切关系的。在程序中最好能随处检查指针是否为空。

    难道真要我把前天备份的代码拿过来重做吗??

    吃一堑,长一智,一定要记得每天备份。没有建立CVS,确实很不方便啊。

    (半小时后补记:错误找到了,有个地方我申明的char*指针,却没有初始化,faint….)

    2004年07月25日

    自己做的小项目。

    不利用FTP协议传送文件 :)

    2004年05月02日

    虽然都能在JAVA API中找到,整理一下做个备份。


    string->byte
    Byte static byte parseByte(String s) 

    byte->string
    Byte static String toString(byte b)

    char->string
    Character static String to String (char c)

    string->Short
    Short static Short parseShort(String s)

    Short->String
    Short static String toString(Short s) 

    String->Integer
    Integer static int parseInt(String s)

    Integer->String
    Integer static String tostring(int i)

    String->Long
    Long static long parseLong(String s)

    Long->String
    Long static String toString(Long i)

    String->Float
    Float static float parseFloat(String s)

    Float->String
    Float static String toString(float f)

    String->Double
    Double static double parseDouble(String s)

    Double->String
    Double static String toString(Double d)