auto_tool:源起及定義

  
 *Author  : DavidLin      
 *Date    : 2014-12-11pm      
 *Email   : [email protected] or [email protected]      
 *world   : the city of SZ, in China      
 *Ver     : 000.000.001      
 *history :     editor      time            do      
 *          1)LinPeng       2014-12-11      created this file!      
 *          2)      
 */  


        關於auto_tool的由來:

auto_tool系列輔助工具集是筆者本人在工作學習中,深感零碎重複邊角工作佔去太多開發時間,所以根據自身需要,編寫的shell,make,bat,teraterm等適合某一需求的自動工具,讓自身得以從分分秒秒的碎片化時間中拯救出來,節約時間,專注於更重要的事情。


auto_tool的數據結構定義

typedef char name_t;
typedef unsigned int ver_t;
typedef unsigned int sn_t;

struct auto_tool_t {   
    name_t    tool[24];
     ver_t    master;
     ver_t    salve;
      sn_t    sn;
};

#define INIT_AUTO_TOOL(name)  \
{                             \
    .tool    =    name,       \
    .master  =    0000,       \
    .slave   =    0000,       \  
    .sn_t    =    0000,       \
};

static auto_tool_t    make     =     INIT_AUTO_TOOL(make);         //用於標識Makefile文件
static auto_tool_t    shell    =     INIT_AUTO_TOOL(shell);        //用於標識shell腳本
static auto_tool_t    bat      =     INIT_AUTO_TOOL(bat);          //用於標識bat腳本
static auto_tool_t    teraterm =     INIT_AUTO_TOOL(teraterm);     //用於標識teraterm腳本



example 1:

 file number:make-0014-1209-0001
 .name     =    make,
 .master   =    0014,
 .slave    =    1209,
 .sn       =    0001,



思想:小就是美

           一個模塊只做一個功能,假如需要更多的功能,那麼它應該是這些小模塊的結合體。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章