home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume35 / ncftp / part03 / cmdtab.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-25  |  5.6 KB  |  134 lines

  1. /* cmdtab.c */
  2.  
  3. #include "sys.h"
  4. #include <sys/types.h>
  5. #include <sys/time.h>
  6. #include "ftpdefs.h"
  7. #include "cmds.h"
  8. #include "main.h"
  9. #include "ftp.h"
  10. #include "ftprc.h"
  11. #include "glob.h"
  12. #include "copyright.h"
  13.  
  14. char    asciihelp[] =     "transfer as text files";
  15. char    binaryhelp[] =    "transfer as binary files";
  16. char    cdhelp[] =        "change remote working directory";
  17. char    cduphelp[] =     "change remote working directory to parent directory";
  18. char    createhelp[] =    "create an empty file on the remote host";
  19. char    deletehelp[] =    "delete remote file";
  20. char    debughelp[] =    "toggle/set debugging mode";
  21. char    dirhelp[] =        "list contents of remote directory";
  22. char    disconhelp[] =    "terminate ftp session";
  23. char    domachelp[] =     "execute macro";
  24. char    helphelp[] =    "print local help information";
  25. char    lcdhelp[] =        "change local working directory";
  26. char    lshelp[] =        "list contents of remote directory";
  27. char    lookuphelp[] =    "print IP addr given name, or name given IP";
  28. char    macdefhelp[] =  "define a macro";
  29. char    mdeletehelp[] =    "delete multiple files";
  30. char    mdirhelp[] =    "list contents of multiple remote directories";
  31. char    mgethelp[] =    "get multiple files";
  32. char    mkdirhelp[] =    "make directory on the remote machine";
  33. char    mlshelp[] =        "nlist contents of multiple remote directories";
  34. char    modtimehelp[] = "show last modification time of remote file";
  35. char    mputhelp[] =    "send multiple files";
  36. char    openhelp[] =    "connect to remote ftp server (type 'open' for usage)";
  37. char    pagehelp[] =    "display a remote file on your terminal";
  38. char    plshelp[] =     "view contents of remote directory using your PAGER";
  39. char    prompthelp[] =    "force interactive prompting on multiple commands";
  40. char    pwdhelp[] =        "print working directory on remote machine";
  41. char    quithelp[] =    "terminate ftp session and exit";
  42. char    quotehelp[] =    "send arbitrary ftp command";
  43. char    receivehelp[] =    "receive file";
  44. #ifdef REDIR
  45. char    predirhelp[] =    "view last ls, dir, list, or nlist with your PAGER";
  46. char     redirhelp[] =     "re-show last ls, dir, list, or nlist.";
  47. #endif
  48. char    remotehelp[] =    "get help from remote server";
  49. char    renamehelp[] =    "rename file";
  50. char    rmdirhelp[] =    "remove directory on the remote machine";
  51. char    rmtstatushelp[]="show status of remote machine";
  52. char    sendhelp[] =    "send one file";
  53. char    sethelp[] =        "set a variable's value; set alone shows all variables";
  54. char    shellhelp[] =    "escape to the shell";
  55. char    sizecmdhelp[] = "show size of remote file";
  56. char    systemhelp[] =  "show remote system type";
  57. char    typehelp[] =    "specify how to transfer files (ascii/binary)";
  58. char    unsethelp[] =    "undefine a variable's value";
  59. char    userhelp[] =    "send new user information";
  60. char    verbosehelp[] =    "toggle verbose mode";
  61. char    versionhelp[] =    "shows version information";
  62.  
  63. struct cmd cmdtab[] = {
  64.     /* name ; help ; bell-when-done ; must-be-connected ; proxy can ; hidden */
  65.     { "!",            shellhelp,            0,    0,    0,    0,    shell },
  66.     { "$",            domachelp,            1,    0,    0,    0,    domacro },
  67.     { "ascii",        asciihelp,            0,    1,    0,    1,    setascii },
  68.     { "binary",        binaryhelp,            0,    1,    0,    1,    setbinary },
  69.     { "bye",        quithelp,            0,    0,    0,    1,    quit },
  70.     { "cd",            cdhelp,                0,    1,    1,    0,    cd },
  71.     { "cdup",        cduphelp,            0,    1,    1,    0,    cdup },
  72.     { "chdir",        cdhelp,                0,    1,    1,    1,    cd },
  73.     { "close",        disconhelp,            0,    1,    1,    1,    disconnect },
  74.     { "connect",    openhelp,            0,    0,    1,    1,    setpeer },
  75.     { "create",        createhelp,            0,    1,    0,    0,    create },
  76.     { "delete",        deletehelp,            0,    1,    1,    0,    do_delete },
  77.     { "debug",        debughelp,            0,    0,    0,    1,    setdebug },
  78.     { "erase",        deletehelp,            0,    1,    1,    1,    do_delete },
  79.     { "exit",        quithelp,            0,    0,    0,    1,    quit },
  80.     { "dir",        dirhelp,            1,    1,    1,    0,    ls },
  81.     { "get",        receivehelp,        1,    1,    1,    0,    get },
  82.     { "help",        helphelp,            0,    0,    1,    0,    help },
  83.     { "image",        binaryhelp,            0,    1,    0,    1,    setbinary },
  84.     { "lcd",        lcdhelp,            0,    0,    0,    0,    lcd },
  85.     { "lookup",     lookuphelp,         0,    0,    0,    0,  lookup },
  86.     { "ls",            lshelp,                1,    1,    1,    0,    ls },
  87.     { "macdef",        macdefhelp,            0,    0,    0,    0,    macdef },
  88.     { "mdelete",    mdeletehelp,        1,    1,    1,    0,    mdelete },
  89.     { "mdir",        mdirhelp,            1,    1,    1,    0,    mls },
  90.     { "mget",        mgethelp,            1,    1,    1,    0,    mget },
  91.     { "mkdir",        mkdirhelp,            0,    1,    1,    0,    makedir },
  92.     { "mls",        mlshelp,            1,    1,    1,    0,    mls },
  93.     { "modtime",    modtimehelp,        0,    1,    1,    0,    modtime },
  94.     { "more",       pagehelp,           1,  1,  1,  1,  get },
  95.     { "mput",        mputhelp,            1,    1,    1,    0,    mput },
  96.     { "nlist",        lshelp,                1,    1,    1,    1,    ls },
  97.     { "open",        openhelp,            0,    0,    1,    0,    setpeer },
  98.     { "page",        pagehelp,            1,    1,    1,    0,    get },
  99.     { "pdir",        plshelp,            1,    1,    1,    0,    ls },
  100.     { "pls",        plshelp,            1,    1,    1,    0,    ls },
  101. #ifdef REDIR
  102.     { "predir",      predirhelp,          0,     1,     0,    0,    showlsbuffer },
  103. #endif
  104.     { "prompt",        prompthelp,            0,    0,    0,    1,    setprompt },
  105.     { "put",        sendhelp,            1,    1,    1,    0,    put },
  106.     { "pwd",        pwdhelp,            0,    1,    1,    0,    pwd },
  107.     { "quit",        quithelp,            0,    0,    0,    0,    quit },
  108.     { "quote",        quotehelp,            1,    1,    1,    0,    quote },
  109. #ifdef REDIR
  110.     { "redir",      redirhelp,          0,     1,     0,    0,    showlsbuffer },
  111. #endif
  112.     { "remotehelp",    remotehelp,            0,    1,    1,    0,    rmthelp },
  113.     { "rm",            deletehelp,            0,    1,    1,    1,    do_delete },
  114.     { "rstatus",    rmtstatushelp,        0,    1,    1,    0,    rmtstatus },
  115.     { "rhelp",        remotehelp,            0,    1,    1,    0,    rmthelp },
  116.     { "rename",        renamehelp,            0,    1,    1,    0,    renamefile },
  117.     { "rmdir",        rmdirhelp,            0,    1,    1,    0,    removedir },
  118.     { "send",        sendhelp,            1,    1,    1,    1,    put },
  119.     { "set",        sethelp,            0,    0,    0,    0,    set },
  120.     { "size",        sizecmdhelp,        1,    1,    1,    0,    sizecmd },
  121.     { "system",        systemhelp,            0,    1,    1,    0,    syst },
  122.     { "unset",        unsethelp,            0,    0,    0,    0,    set },
  123.     { "user",        userhelp,            0,    1,    1,    0,    do_user },
  124.     { "type",        typehelp,            0,    1,    0,    0,    settype },
  125.     { "verbose",    verbosehelp,        0,    0,    0,    0,    setverbose },
  126.     { "version",    versionhelp,        0,    0,    0,    0,    show_version },
  127.     { "?",            helphelp,            0,    0,    1,    0,    help },
  128.     { NULL,            NULL,                0,    0,    0,    0,    NULL }
  129. };
  130.  
  131. int    NCMDS = (sizeof (cmdtab) / sizeof (cmdtab[0])) - 1;
  132.  
  133. /* eof cmdtab.c */
  134.