2010/11/27

Apache2 on Ubuntu 10.10 ... cgi-bin


For memo...


INSTALL
# sudo apt-get install apache2

TEST if Apache2 installed successfully ?


It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.

MODIFY for CGI 
# sudo vi /etc/apache2/apache2.conf
      :
  AddHandler cgi-script .cgi
      :

# sudo vi /etc/apache2/sites-enabled/000-default
      :
  ScriptAlias /cgi-bin/ /var/www/cgi-bin/ 
  <Directory /var/www/cgi-bin/>
      Options +ExecCGI 
      AddHandler cgi-script .cgi
  </Directory>
      :
RESTART Apache2 via apache2ctl
# sudo apache2ctl configtest
# sudo apache2ctl restart

PREPARE a CGI for test
# cd /var/www/cgi-bin
# vi a.cgi
#!/bin/sh
echo "Content-type: text/html\n\n"

cat <<EOF

<html><body>
Hello World !<br>
QUERY_STRING: <font color=0000ff>$QUERY_STRING</font><br>
Bye !
</body></html>

EOF

# sudo chmod 755 a.cgi

TEST if the CGI works ?
http://localhost/cgi-bin/a.cgi?a=b&c=d


Hello World !
QUERY_STRING: a=b&c=d
Bye !


ERROR ??? Very important if you got something wrong ...
# tail /var/log/apache2/error.log

2010/11/07

TimeZone setting

In our DVR, we have an option for user to decide whether Daylight Saving Time (DST) to be enabled in his machine.  When Time Zone is selected in DST field, the time in Date/Time fields will be automatically adjusted accordingly. However, once the user changed the Date/Time value, the Time Zone changed later will not effect the time in Date/Time field.

Ref:
[1] http://www.gnu.org/software/libc/manual/html_node/Time-Zone-Functions.html


[0] Find the time zone table in your system
# cat /usr/share/zoneinfo/zone.tab


# <pre>
# @(#)zone.tab 8.38
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
#
# TZ zone descriptions
#
# From Paul Eggert (1996-08-05):
#
# This file contains a table with the following columns:
# 1.  ISO 3166 2-character country code.  See the file `iso3166.tab'.
# 2.  Latitude and longitude of the zone's principal location
#     in ISO 6709 sign-degrees-minutes-seconds format,
#     either +-DDMM+-DDDMM or +-DDMMSS+-DDDMMSS,
#     first latitude (+ is north), then longitude (+ is east).
# 3.  Zone name used in value of TZ environment variable.
# 4.  Comments; present if and only if the country has multiple rows.
#
# Columns are separated by a single tab.
# The table is sorted first by country, then an order within the country that
# (1) makes some geographical sense, and
# (2) puts the most populous zones first, where that does not contradict (1).
#
# Lines beginning with `#' are comments.
#
#country-
#code coordinates TZ comments
AD +4230+00131 Europe/Andorra
AE +2518+05518 Asia/Dubai
AF +3431+06912 Asia/Kabul
AG +1703-06148 America/Antigua
AI +1812-06304 America/Anguilla
AL +4120+01950 Europe/Tirane
AM +4011+04430 Asia/Yerevan
AN +1211-06900 America/Curacao
AO -0848+01314 Africa/Luanda
AQ -7750+16636 Antarctica/McMurdo McMurdo Station, Ross Island
AQ -9000+00000 Antarctica/South_Pole Amundsen-Scott Station, South Pole
AQ -6734-06808 Antarctica/Rothera Rothera Station, Adelaide Island
AQ -6448-06406 Antarctica/Palmer Palmer Station, Anvers Island
AQ -6736+06253 Antarctica/Mawson Mawson Station, Holme Bay
AQ -6835+07758 Antarctica/Davis Davis Station, Vestfold Hills
          :
          :


What we are interested are TZ and comments :) We may show the comments in our UI timezone list for user to select his own timezone.


[1] To set your timezone

Method#1:
# export TZ=Asia/Taipei

To get timezone setting
# echo $TZ


Method#2:
If TZ is empty or not set, /etc/localtime is used.
So, we can use symbolic link as below to set timezone.
# ln -s /usr/shar/zoneinfo/Asia/Taipei /etc/localtime

or 
# export TZ=/etc/localtime
   /etc/localtime is a symbolic link to your timezone file.


[2] For C user:
  ...
  some UI work to get the timezone to be set....
  ...
  setenv("TZ", "Asia/Taipei", 1); /// "Asia/Taipei" is the timezone you may want to set

2010/09/09

Eclipse with BIG5 encoding codes !

The old source code files are BIG5 encoded. For some reasons, we have to keep original encoding, when using Eclipse (its default encoding is UTF-8). To use BIG-5 encoding in Eclipse, try to do in this way.


Figure 1. The Chinese characters in line 2073 are not shown properly.

TODO: Move cursor to project name, click the right button of mouse and select the Properties [Alt+Enter] , then the next window popup.

Figure 2. - In Text file encoding, field Other, type BIG. Eclipse starts detecting the encoding method automatically, and finds BIG is not supported. See top of this window.
Figure 3. - While BIG5 is completed, the unsupported message  disappeared. Then click Apply button, and OK to back to main window.

Figure 4. - The Chinese characters in line 2073 are shown properly. But line 2078 @#$!

2010/09/07

Perforce, The Fast Software Configuration Management System

As introduced by my colleague, the version he used was for Windows. The linux/unix/mac versions are also available.

As a Eclipse user, it's lucky to have the Perforce Plug-in for Eclipse :)
http://www.perforce.com/perforce/products/p4wsad.html

Keep records.

2010/06/22

LINUX KERNEL完全剖析 - 趙炯

OS: Ubuntu 10.04

We shall install both bochs and bochs-x packages first to realize further examples in this book.
# sudo apt-get install bochs bochs-x

boot.s

.globl   begtext, begdata, begbss, endtext, enddata, endbss
.text
begtext:
.data
begdata:
.bss
begbss:
.text
BOOTSEG=0x07c0

entry start
start:
      jmpi  go, BOOTSEG
go:   mov   ax, cs
      mov   ds, ax
      mov   es, ax
      mov   [msg1+17], ah
      mov   cx, #20
      mov   dx, #0x1004
      mov   bx, #0x000c
      mov   bp, #msg1
      mov   ax, #0x1301
      int   0x10
loop1: jmp   loop1
msg1: .ascii "Loading system ..."
      .byte 13, 10

.org  510
      .word 0xAA55
.text
endtext:
.data
enddata:
.bss
endbss:


# as86 -0 -a -o boot.o boot.s
# ld86 -0 -s -o boot boot.o
# dd bs=32 if=boot of=boot.img skip=1

Now we'll start bochs to test our boot image. However we shall edit the configuration before testing. I tried in this way

# bochs

========================================================================
                       Bochs x86 Emulator 2.4.2
             Build from CVS snapshot on November 12, 2009
========================================================================
00000000000i[     ] LTDL_LIBRARY_PATH not set. using compile time default '/usr/lib/bochs/plugins'
00000000000i[     ] BXSHARE not set. using compile time default '/usr/share/bochs'
00000000000e[     ] Switching off quick start, because no configuration file was found.
------------------------------
Bochs Configuration: Main Menu
------------------------------

This is the Bochs Configuration Interface, where you can describe the
machine that you want to simulate.  Bochs has already searched for a
configuration file (typically called bochsrc.txt) and loaded it if it
could be found.  When you are satisfied with the configuration, go
ahead and start the simulation.

You can also start bochs with the -q option to skip these menus.

1. Restore factory default configuration
2. Read options from...
3. Edit options
4. Save options to...
5. Restore the Bochs state from...
6. Begin simulation
7. Quit now

Please choose one: [2] 3
------------------
Bochs Options Menu
------------------
0. Return to previous menu
1. Logfile options
2. Log options for all devices
3. Log options for individual devices
4. CPU options
5. Memory options
6. Clock & CMOS options
7. PCI options
8. Bochs Display & Interface options
9. Keyboard & Mouse options
10. Disk options
11. Serial / Parallel / USB options
12. Network card options
13. Sound Blaster 16 options
14. Other options
15. User-defined options

Please choose one: [0] 10

------------------
Bochs Disk Options
------------------
0. Return to previous menu
1. First Floppy Drive
2. Second Floppy Drive
3. ATA channel 0
4. First HD/CD on channel 0
5. Second HD/CD on channel 0
6. ATA channel 1
7. First HD/CD on channel 1
8. Second HD/CD on channel 1
9. ATA channel 2
10. First HD/CD on channel 2 (disabled)
11. Second HD/CD on channel 2 (disabled)
12. ATA channel 3
13. First HD/CD on channel 3 (disabled)
14. Second HD/CD on channel 3 (disabled)
15. Boot Options

Please choose one: [0] 1

------------------
First Floppy Drive
------------------

What type of floppy drive? [none] ?

Type of floppy drive
Valid values are: none, 5.25" 360K, 5.25" 1.2M, 3.5" 720K, 3.5" 1.44M, 3.5" 2.88M
What type of floppy drive? [none] 3.5" 1.44M

Enter new filename, or 'none' for no disk: [none] /home/yenping/workspace/boot.img

What type of floppy media? (auto=detect) [none] ?

Type of floppy media
Valid values are: none, 1.2M, 1.44M, 2.88M, 720K, 360K, 160K, 180K, 320K, auto
What type of floppy media? (auto=detect) [none] 1.44M

Is media inserted in drive? [no] yes

------------------
Bochs Disk Options
------------------
0. Return to previous menu
1. First Floppy Drive
2. Second Floppy Drive
3. ATA channel 0
4. First HD/CD on channel 0
5. Second HD/CD on channel 0
6. ATA channel 1
7. First HD/CD on channel 1
8. Second HD/CD on channel 1
9. ATA channel 2
10. First HD/CD on channel 2 (disabled)
11. Second HD/CD on channel 2 (disabled)
12. ATA channel 3
13. First HD/CD on channel 3 (disabled)
14. Second HD/CD on channel 3 (disabled)
15. Boot Options

Please choose one: [0] 15

------------
Boot Options
------------
0. Return to previous menu
1. Boot drive #1: floppy
2. Boot drive #2: none
3. Boot drive #3: none
4. Skip Floppy Boot Signature Check: no
5. 32-bit OS Loader Hack

Please choose one: [0] 0

------------------
Bochs Disk Options
------------------
0. Return to previous menu
1. First Floppy Drive
2. Second Floppy Drive
3. ATA channel 0
4. First HD/CD on channel 0
5. Second HD/CD on channel 0
6. ATA channel 1
7. First HD/CD on channel 1
8. Second HD/CD on channel 1
9. ATA channel 2
10. First HD/CD on channel 2 (disabled)
11. Second HD/CD on channel 2 (disabled)
12. ATA channel 3
13. First HD/CD on channel 3 (disabled)
14. Second HD/CD on channel 3 (disabled)
15. Boot Options

Please choose one: [0] 0
------------------
Bochs Options Menu
------------------
0. Return to previous menu
1. Logfile options
2. Log options for all devices
3. Log options for individual devices
4. CPU options
5. Memory options
6. Clock & CMOS options
7. PCI options
8. Bochs Display & Interface options
9. Keyboard & Mouse options
10. Disk options
11. Serial / Parallel / USB options
12. Network card options
13. Sound Blaster 16 options
14. Other options
15. User-defined options

Please choose one: [0] 0
------------------------------
Bochs Configuration: Main Menu
------------------------------

This is the Bochs Configuration Interface, where you can describe the
machine that you want to simulate.  Bochs has already searched for a
configuration file (typically called bochsrc.txt) and loaded it if it
could be found.  When you are satisfied with the configuration, go
ahead and start the simulation.

You can also start bochs with the -q option to skip these menus.

1. Restore factory default configuration
2. Read options from...
3. Edit options
4. Save options to...
5. Restore the Bochs state from...
6. Begin simulation
7. Quit now

Please choose one: [6] 4
Save configuration to what file?  To cancel, type 'none'.
[none] myBochs.cfg
00000000000i[     ] write current configuration to myBochs.cfg
Wrote configuration to 'myBochs.cfg'.
------------------------------
Bochs Configuration: Main Menu
------------------------------

This is the Bochs Configuration Interface, where you can describe the
machine that you want to simulate.  Bochs has already searched for a
configuration file (typically called bochsrc.txt) and loaded it if it
could be found.  When you are satisfied with the configuration, go
ahead and start the simulation.

You can also start bochs with the -q option to skip these menus.

1. Restore factory default configuration
2. Read options from...
3. Edit options
4. Save options to...
5. Restore the Bochs state from...
6. Begin simulation
7. Quit now

Please choose one: [6] 6




Next time, we can start bochs with our config as below.
# bochs -f myBochs.cfg

2010/05/21

Qt - phonon

VideoPlayback in Qt via Phonon

1. create a new Qt project with module Phonon
















...
2. Add some codes in mainwindow.h & mainwindow.cpp


--- mainwindow.h ---

class MainWindow : public QMainWindow {
      :
private:
    Ui::MainWindow *ui;
    QString m_mediaFile;
    Phonon::VideoPlayer *player;
};
--- mainwindow.cpp ---

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    player = new Phonon::VideoPlayer(Phonon::VideoCategory, this);
    /// TODO: shall be a smart way to resize the playback area
    player->move(0,63);
    player->resize(width(), height()-63);
}

void MainWindow::on_action_Open_triggered()
{
    QStringList filters;
    filters << "Image files (*.mpg *.avi)"
            << "Any files (*)";

    QFileDialog dialog(this);
    dialog.setNameFilters(filters);

    if (dialog.exec())
    {
        QStringList fileNames;
        fileNames   = dialog.selectedFiles();
        m_mediaFile = fileNames.at(0);

        setWindowTitle(m_mediaFile);
        /// Load media file.
        player->load(Phonon::MediaSource(m_mediaFile));
        player->play();
    }
}

...

The simple program can play video, mp3 and jpeg.

[] video : rmvb, mpg, vob ...
[] image : jpg ...
[] music : mp3 ...

2010/05/20

Hello World mips version with eclipse.

Project -> Properties 

[ C/C++ Build ] -> [ Environment ] -> [ Select... ]



Select PATH.


Edit the PATH
Append your toolchain binary path in value field.


[ C/C++ Build ] -> [ Settings ] 

modify [ Command ] fields in GCC C++ Compiler/C Compiler/C++ Linker/Assembler respectively.
ex:  g++  -> mipsel-linux-g++



Project -> Build Project



























The mips version Hello World is built !!!
















Don't forget to export the c++ lib before execute the HelloMips binary :)


2010/05/19

CMake - my first experience (1)

REFERENCE:
http://andescore.blogspot.com/2009/08/cmake-andes-toolchains3.html

To run mySrv and myCli on mipsel platform. Add below lines in src/CMakeLists.txt and lib/CMakeLists.txt.

SET(CMAKE_C_COMPILER mipsel-linux-gcc)
SET(CMAKE_CXX_COMPILER mipsel-linux-g++)
SET(AS mipsel-linux-as)
SET(AR mipsel-linux-ar)
SET(LD mipsel-linux-ld)
SET(NM mipsel-linux-nm)
SET(OBJCOPY mipsel-linux-objcopy)
SET(OBJDUMP mipsel-linux-objdump)
SET(READELF mipsel-linux-readelf)


$ cat src/CMakeLists.txt 
SET(CMAKE_C_COMPILER mipsel-linux-gcc)
SET(CMAKE_CXX_COMPILER mipsel-linux-g++)
SET(AS mipsel-linux-as)
SET(AR mipsel-linux-ar)
SET(LD mipsel-linux-ld)
SET(NM mipsel-linux-nm)
SET(OBJCOPY mipsel-linux-objcopy)
SET(OBJDUMP mipsel-linux-objdump)
SET(READELF mipsel-linux-readelf)

INCLUDE_DIRECTORIES(${MYSOCKET_SOURCE_DIR}/lib)
LINK_DIRECTORIES(${MYSOCKET_BINARY_DIR}/lib)
ADD_EXECUTABLE(mySrv tcpSrvDemo.c)
ADD_EXECUTABLE(myCli tcpCliDemo.c)
TARGET_LINK_LIBRARIES(mySrv myTcpSocket)
TARGET_LINK_LIBRARIES(myCli myTcpSocket)

$ cat lib/CMakeLists.txt 
SET(CMAKE_C_COMPILER mipsel-linux-gcc)
SET(CMAKE_CXX_COMPILER mipsel-linux-g++)
SET(AS mipsel-linux-as)
SET(AR mipsel-linux-ar)
SET(LD mipsel-linux-ld)
SET(NM mipsel-linux-nm)
SET(OBJCOPY mipsel-linux-objcopy)
SET(OBJDUMP mipsel-linux-objdump)
SET(READELF mipsel-linux-readelf)

FIND_LIBRARY(PTHREAD pthread)
ADD_LIBRARY(myLL myLL.c)
ADD_LIBRARY(myTcpSocket myTcpSocket.c)
TARGET_LINK_LIBRARIES(myTcpSocket myLL ${PTHREAD}) 

$ cd build
$ cmake ..
$ make
[ 25%] Built target myLL
[ 50%] Built target myTcpSocket
[ 75%] Building C object src/CMakeFiles/myCli.dir/tcpCliDemo.c.o
Linking C executable myCli
[ 75%] Built target myCli
[100%] Building C object src/CMakeFiles/mySrv.dir/tcpSrvDemo.c.o
Linking C executable mySrv
[100%] Built target mySrv

$ file src/my*
src/myCli: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), dynamically linked (uses shared libs), not stripped
src/mySrv: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV), dynamically linked (uses shared libs), not stripped























mySrc is running on mips platform with Linux kernel 2.6.12.
[packet] [inform] [close] are receiving status.
[status] is the server status report.

The last UI programming work - Virtual Keyboard for RTK1073/1283

This may be my last UI programming works on Realtek 1073/1283. Because default virtual keyboard developed by Realtek is not good to us. Therefore, the boss decided to develop one for ourselves. It is a virtual keyboard for user to input his own PPPoE account and password.

Major functions as below:
0. Key moved by direction buttons, and selected by [OK] button on RC.
1. Two input text fields (ACCOUNT/PASSWORD). Switched by [Next Focus]
2. Upper/Lower case switched by [Caps]
3. Erase by [Delete]
4. Move cursor by [<--] or [-->]
5. Clear current input field by [Clear]
6. Cancel input by [Cancel]
7. Save inputs by [Save]
8. Support multi-language. (EN/SC/TC)

2010/05/18

CMake - my first experience

Reference:
0.  Jserv's 貓也會的 CMake http://blog.linux.org.tw/~jserv/archives/001987.html   and http://jserv.sayya.org/cmake/cmake-overview.pdf
1. Drake's 把玩 CMake 的第一步 http://drakeguan.org/my_first_trial_of_cmake

This is my first time with CMake. Before it starts, I have to install cmake in my Ubuntu.
$ sudo apt-get install cmake
Then prepare some files and directories per Drake's suggestions.

*note:
myLL.c - a linked list library in 2009-07
myTcpSocket.c - a multi-thread tcp socket library in 2009-08


$ tree
.
├── build
├── CMakeLists.txt
├── lib
│   ├── CMakeLists.txt
│   ├── myLL.c
│   ├── myLL.h
│   ├── myTcpSocket.c
│   └── myTcpSocket.h
└── src
      ├── CMakeLists.txt
      ├── tcpCliDemo.c
      └── tcpSrvDemo.c

3 directories, 10 files


$ cat CMakeLists.txt 
cmake_minimum_required(VERSION 2.8)

PROJECT(MYSOCKET)
ADD_SUBDIRECTORY(lib)
ADD_SUBDIRECTORY(src)

$ cat src/CMakeLists.txt 
INCLUDE_DIRECTORIES(${MYSOCKET_SOURCE_DIR}/lib)
LINK_DIRECTORIES(${MYSOCKET_BINARY_DIR}/lib)
ADD_EXECUTABLE(mySrv tcpSrvDemo.c)
ADD_EXECUTABLE(myCli tcpCliDemo.c)
TARGET_LINK_LIBRARIES(mySrv myTcpSocket)
TARGET_LINK_LIBRARIES(myCli myTcpSocket)

$ cat lib/CMakeLists.txt
FIND_LIBRARY(PTHREAD pthread)
ADD_LIBRARY(myLL myLL.c)
ADD_LIBRARY(myTcpSocket myTcpSocket.c)
TARGET_LINK_LIBRARIES(myTcpSocket myLL ${PTHREAD})

$ cd build
$ cmake ..
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/yenping/workspace/test333/build

$ ls -al
總計 44
drwxr-xr-x 5 yenping yenping  4096 2010-05-18 17:20 .
drwxr-xr-x 5 yenping yenping  4096 2010-05-18 17:15 ..
-rw-r--r-- 1 yenping yenping 10833 2010-05-18 17:20 CMakeCache.txt
drwxr-xr-x 5 yenping yenping  4096 2010-05-18 17:20 CMakeFiles
-rw-r--r-- 1 yenping yenping  1890 2010-05-18 17:20 cmake_install.cmake
drwxr-xr-x 3 yenping yenping  4096 2010-05-18 17:20 lib
-rw-r--r-- 1 yenping yenping  5292 2010-05-18 17:20 Makefile
drwxr-xr-x 3 yenping yenping  4096 2010-05-18 17:20 src

$ make
Scanning dependencies of target myLL
[ 25%] Building C object lib/CMakeFiles/myLL.dir/myLL.c.o
Linking C static library libmyLL.a
[ 25%] Built target myLL
Scanning dependencies of target myTcpSocket
[ 50%] Building C object lib/CMakeFiles/myTcpSocket.dir/myTcpSocket.c.o
Linking C static library libmyTcpSocket.a
[ 50%] Built target myTcpSocket
Scanning dependencies of target myCli
[ 75%] Building C object src/CMakeFiles/myCli.dir/tcpCliDemo.c.o
Linking C executable myCli
[ 75%] Built target myCli
Scanning dependencies of target mySrv
[100%] Building C object src/CMakeFiles/mySrv.dir/tcpSrvDemo.c.o
Linking C executable mySrv
[100%] Built target mySrv

$ ls -al lib/ src/
lib/:
總計 48
drwxr-xr-x 3 yenping yenping  4096 2010-05-18 17:22 .
drwxr-xr-x 5 yenping yenping  4096 2010-05-18 17:20 ..
drwxr-xr-x 4 yenping yenping  4096 2010-05-18 17:20 CMakeFiles
-rw-r--r-- 1 yenping yenping  1159 2010-05-18 17:20 cmake_install.cmake
-rw-r--r-- 1 yenping yenping  4638 2010-05-18 17:22 libmyLL.a
-rw-r--r-- 1 yenping yenping 12496 2010-05-18 17:22 libmyTcpSocket.a
-rw-r--r-- 1 yenping yenping  6711 2010-05-18 17:20 Makefile

src/:
總計 80
drwxr-xr-x 3 yenping yenping  4096 2010-05-18 17:22 .
drwxr-xr-x 5 yenping yenping  4096 2010-05-18 17:20 ..
drwxr-xr-x 4 yenping yenping  4096 2010-05-18 17:20 CMakeFiles
-rw-r--r-- 1 yenping yenping  1159 2010-05-18 17:20 cmake_install.cmake
-rw-r--r-- 1 yenping yenping  6731 2010-05-18 17:20 Makefile
-rwxr-xr-x 1 yenping yenping 27179 2010-05-18 17:22 myCli
-rwxr-xr-x 1 yenping yenping 27360 2010-05-18 17:22 mySrv

$ tree
.
├── build
│   ├── CMakeCache.txt
│   ├── CMakeFiles
│   │   ├── CMakeCCompiler.cmake
│   │   ├── cmake.check_cache
│   │   ├── CMakeCXXCompiler.cmake
│   │   ├── CMakeDetermineCompilerABI_C.bin
│   │   ├── CMakeDetermineCompilerABI_CXX.bin
│   │   ├── CMakeDirectoryInformation.cmake
│   │   ├── CMakeOutput.log
│   │   ├── CMakeSystem.cmake
│   │   ├── CMakeTmp
│   │   │   └── CMakeFiles
│   │   │       └── cmTryCompileExec.dir
│   │   ├── CompilerIdC
│   │   │   ├── a.out
│   │   │   └── CMakeCCompilerId.c
│   │   ├── CompilerIdCXX
│   │   │   ├── a.out
│   │   │   └── CMakeCXXCompilerId.cpp
│   │   ├── Makefile2
│   │   ├── Makefile.cmake
│   │   ├── progress.marks
│   │   └── TargetDirectories.txt
│   ├── cmake_install.cmake
│   ├── lib
│   │   ├── CMakeFiles
│   │   │   ├── CMakeDirectoryInformation.cmake
│   │   │   ├── myLL.dir
│   │   │   │   ├── build.make
│   │   │   │   ├── C.includecache
│   │   │   │   ├── cmake_clean.cmake
│   │   │   │   ├── cmake_clean_target.cmake
│   │   │   │   ├── DependInfo.cmake
│   │   │   │   ├── depend.internal
│   │   │   │   ├── depend.make
│   │   │   │   ├── flags.make
│   │   │   │   ├── link.txt
│   │   │   │   ├── myLL.c.o
│   │   │   │   └── progress.make
│   │   │   ├── myTcpSocket.dir
│   │   │   │   ├── build.make
│   │   │   │   ├── C.includecache
│   │   │   │   ├── cmake_clean.cmake
│   │   │   │   ├── cmake_clean_target.cmake
│   │   │   │   ├── DependInfo.cmake
│   │   │   │   ├── depend.internal
│   │   │   │   ├── depend.make
│   │   │   │   ├── flags.make
│   │   │   │   ├── link.txt
│   │   │   │   ├── myTcpSocket.c.o
│   │   │   │   └── progress.make
│   │   │   └── progress.marks
│   │   ├── cmake_install.cmake
│   │   ├── libmyLL.a
│   │   ├── libmyTcpSocket.a
│   │   └── Makefile
│   ├── Makefile
│   └── src
│       ├── CMakeFiles
│       │   ├── CMakeDirectoryInformation.cmake
│       │   ├── myCli.dir
│       │   │   ├── build.make
│       │   │   ├── C.includecache
│       │   │   ├── cmake_clean.cmake
│       │   │   ├── DependInfo.cmake
│       │   │   ├── depend.internal
│       │   │   ├── depend.make
│       │   │   ├── flags.make
│       │   │   ├── link.txt
│       │   │   ├── progress.make
│       │   │   └── tcpCliDemo.c.o
│       │   ├── mySrv.dir
│       │   │   ├── build.make
│       │   │   ├── C.includecache
│       │   │   ├── cmake_clean.cmake
│       │   │   ├── DependInfo.cmake
│       │   │   ├── depend.internal
│       │   │   ├── depend.make
│       │   │   ├── flags.make
│       │   │   ├── link.txt
│       │   │   ├── progress.make
│       │   │   └── tcpSrvDemo.c.o
│       │   └── progress.marks
│       ├── cmake_install.cmake
│       ├── Makefile
│       ├── myCli
│       └── mySrv
├── CMakeLists.txt
├── lib
│   ├── CMakeLists.txt
│   ├── myLL.c
│   ├── myLL.h
│   ├── myTcpSocket.c
│   └── myTcpSocket.h
└── src
    ├── CMakeLists.txt
    ├── tcpCliDemo.c
    └── tcpSrvDemo.c

17 directories, 82 files (<--- 3 directories, 10 files)
At final, test mySrv and myCli. They seem work fine.
FINISHED.

2010/05/12

warning: array subscript has type `char'

A 'char' may be 'signed' or 'unsigned'. Most regular compilers will default to 'signed'.
So if you have an array with index 127, you increment the index and it becomes -128.
This may of course be your intention.
A 'safe' type to use for an array 

index is 'int' or 'unsigned char'.


char idx;  /// limited range
somedata[idx] = otherdata;


==> (to eliminate the warning...)


unsigned char idx;
int idx;


memo.