liboftp.h

#include <sys/types.h>
#include <netinet/in.h>

ソースコードを見る。

構成

struct  LIBOFTP

マクロ定義

#define LIBOFTP_NOERROR   0
#define LIBOFTP_ERROR_OS   -1
#define LIBOFTP_ERROR_PROTOCOL   -2
#define LIBOFTP_ERROR   -3
#define LIBOFTP_ERROR_BUFFER   -4
#define LIBOFTP_ERROR_TIMEOUT   -5

関数

int ftp_initialize (LIBOFTP *ftp)
int ftp_open (LIBOFTP *ftp, const char *host, int port)
int ftp_user (LIBOFTP *ftp, const char *user, const char *pass)
int ftp_passive (LIBOFTP *ftp, int flag)
int ftp_timeout (LIBOFTP *ftp, int sec)
int ftp_type (LIBOFTP *ftp, const char *type)
int ftp_quit (LIBOFTP *ftp)
int ftp_reset (LIBOFTP *ftp)
int ftp_site (LIBOFTP *ftp, const char *cmdline)
int ftp_delete (LIBOFTP *ftp, const char *fname)
int ftp_rename (LIBOFTP *ftp, const char *from, const char *to)
int ftp_get_buffer (LIBOFTP *ftp, const char *fname, char *buf, int bufsiz)
int ftp_put_buffer (LIBOFTP *ftp, const char *buf, int bufsiz, const char *fname)
int ftp_append_buffer (LIBOFTP *ftp, const char *buf, int bufsiz, const char *fname)
int ftp_get_file (LIBOFTP *ftp, const char *fname, const char *local_fname)
int ftp_put_file (LIBOFTP *ftp, const char *local_fname, const char *fname)
int ftp_append_file (LIBOFTP *ftp, const char *local_fname, const char *fname)
int ftp_get_descriptor (LIBOFTP *ftp, const char *fname)
int ftp_get_descriptor_close (LIBOFTP *ftp, int desc)
int ftp_put_descriptor (LIBOFTP *ftp, const char *fname)
int ftp_put_descriptor_close (LIBOFTP *ftp, int desc)
int ftp_append_descriptor (LIBOFTP *ftp, const char *fname)
int ftp_append_descriptor_close (LIBOFTP *ftp, int desc)
int ftp_list (LIBOFTP *ftp, const char *fglob, char *buf, int bufsiz)
int ftp_nlist (LIBOFTP *ftp, const char *fglob, char *buf, int bufsiz)
int ftp_mkdir (LIBOFTP *ftp, const char *dirname)
int ftp_rmdir (LIBOFTP *ftp, const char *dirname)
int ftp_pwd (LIBOFTP *ftp, char *buf, int bufsiz)
int ftp_cd (LIBOFTP *ftp, const char *dirname)


マクロ定義

#define LIBOFTP_ERROR   -3

#define LIBOFTP_ERROR_BUFFER   -4

#define LIBOFTP_ERROR_OS   -1

#define LIBOFTP_ERROR_PROTOCOL   -2

#define LIBOFTP_ERROR_TIMEOUT   -5

#define LIBOFTP_NOERROR   0


関数

int ftp_append_buffer ( LIBOFTP ftp,
const char *  buf,
int  bufsiz,
const char *  fname 
)

バッファからファイル送信 アペンドモード

引数:
ftp LIBOFTPへのポインタ。
buf バッファへのポインタ
bufsiz バッファサイズ
fname サーバ上のファイル名
戻り値:
int エラーコード
覚え書き:

int ftp_append_descriptor ( LIBOFTP ftp,
const char *  fname 
)

ファイル送信用デスクリプタ生成 アペンドモード

引数:
ftp LIBOFTPへのポインタ。
fname サーバ上のファイル名
戻り値:
int デスクリプタ。マイナス値ならエラーコード
覚え書き:

int ftp_append_descriptor_close ( LIBOFTP ftp,
int  desc 
)

ファイル送信用デスクリプタクローズ アペンドモード

引数:
ftp LIBOFTPへのポインタ。
desc デスクリプタ
戻り値:
int エラーコード
覚え書き:

int ftp_append_file ( LIBOFTP ftp,
const char *  local_fname,
const char *  fname 
)

ファイル送信 アペンドモード

引数:
ftp LIBOFTPへのポインタ。
local_fname ローカルファイル名
fname サーバ上のファイル名
戻り値:
int エラーコード
覚え書き:

int ftp_cd ( LIBOFTP ftp,
const char *  dirname 
)

CWDコマンド

引数:
ftp LIBOFTPへのポインタ。
dirname 対象ディレクトリ名
戻り値:
int エラーコード
覚え書き:

int ftp_delete ( LIBOFTP ftp,
const char *  fname 
)

DELEコマンド

引数:
ftp LIBOFTPへのポインタ。
fname 対象ファイル名
戻り値:
int エラーコード
覚え書き:

int ftp_get_buffer ( LIBOFTP ftp,
const char *  fname,
char *  buf,
int  bufsiz 
)

バッファへファイル取得

引数:
ftp LIBOFTPへのポインタ。
fname サーバ上のファイル名
buf バッファへのポインタ
bufsiz バッファサイズ
戻り値:
int 取得したバイト数 マイナス値ならエラーコード
覚え書き:

int ftp_get_descriptor ( LIBOFTP ftp,
const char *  fname 
)

ファイル取得用デスクリプタ生成

引数:
ftp LIBOFTPへのポインタ。
fname サーバ上のファイル名
戻り値:
int デスクリプタ。マイナス値ならエラーコード
覚え書き:

int ftp_get_descriptor_close ( LIBOFTP ftp,
int  desc 
)

ファイル取得用デスクリプタクローズ

引数:
ftp LIBOFTPへのポインタ。
desc デスクリプタ
戻り値:
int エラーコード
覚え書き:

int ftp_get_file ( LIBOFTP ftp,
const char *  fname,
const char *  local_fname 
)

ファイル取得してローカルファイルへ

引数:
ftp LIBOFTPへのポインタ。
fname サーバ上のファイル名
local_fname ローカルファイル名
戻り値:
int エラーコード
覚え書き:

int ftp_initialize ( LIBOFTP ftp  ) 

ftp構造体初期化

引数:
ftp LIBOFTPへのポインタ。
戻り値:
int エラーコード
覚え書き:
ftp構造体は、呼出側で確保する。

int ftp_list ( LIBOFTP ftp,
const char *  fglob,
char *  buf,
int  bufsiz 
)

ディレクトリリスト(LIST) 取得

引数:
ftp LIBOFTPへのポインタ。
fglob ファイルリストグロブ (ex: *.txt) or NULL
buf バッファへのポインタ
bufsiz バッファサイズ
戻り値:
int エラーコード
覚え書き:

int ftp_mkdir ( LIBOFTP ftp,
const char *  dirname 
)

MKDコマンド

引数:
ftp LIBOFTPへのポインタ。
dirname 対象ディレクトリ名
戻り値:
int エラーコード
覚え書き:

int ftp_nlist ( LIBOFTP ftp,
const char *  fglob,
char *  buf,
int  bufsiz 
)

ディレクトリリスト(NLST) 取得

引数:
ftp LIBOFTPへのポインタ。
fglob ファイルリストグロブ (ex: *.txt) or NULL
buf バッファへのポインタ
bufsiz バッファサイズ
戻り値:
int エラーコード
覚え書き:

int ftp_open ( LIBOFTP ftp,
const char *  host,
int  port 
)

ftpサーバへ接続

引数:
ftp LIBOFTPへのポインタ。
host ホスト名または、IPアドレス文字列。
port ポート番号。ゼロならデフォルトを使用する。
戻り値:
int エラーコード
覚え書き:
ftp構造体は、呼出側で確保する。

int ftp_passive ( LIBOFTP ftp,
int  flag 
)

パッシブモード設定/解除

引数:
ftp LIBOFTPへのポインタ。
flag パッシブモードON/OFF
戻り値:
int 0
覚え書き:

int ftp_put_buffer ( LIBOFTP ftp,
const char *  buf,
int  bufsiz,
const char *  fname 
)

バッファからファイル送信

引数:
ftp LIBOFTPへのポインタ。
buf バッファへのポインタ
bufsiz バッファサイズ
fname サーバ上のファイル名
戻り値:
int エラーコード
覚え書き:

int ftp_put_descriptor ( LIBOFTP ftp,
const char *  fname 
)

ファイル送信用デスクリプタ生成

引数:
ftp LIBOFTPへのポインタ。
fname サーバ上のファイル名
戻り値:
int デスクリプタ。マイナス値ならエラーコード
覚え書き:

int ftp_put_descriptor_close ( LIBOFTP ftp,
int  desc 
)

ファイル送信用デスクリプタクローズ

引数:
ftp LIBOFTPへのポインタ。
desc デスクリプタ
戻り値:
int エラーコード
覚え書き:

int ftp_put_file ( LIBOFTP ftp,
const char *  local_fname,
const char *  fname 
)

ファイル送信

引数:
ftp LIBOFTPへのポインタ。
local_fname ローカルファイル名
fname サーバ上のファイル名
戻り値:
int エラーコード
覚え書き:

int ftp_pwd ( LIBOFTP ftp,
char *  buf,
int  bufsiz 
)

PWDコマンド

引数:
ftp LIBOFTPへのポインタ。
buf 結果代入先バッファ
bufsiz バッファサイズ
戻り値:
int エラーコード
覚え書き:

int ftp_quit ( LIBOFTP ftp  ) 

QUITコマンド

引数:
ftp LIBOFTPへのポインタ。
戻り値:
int エラーコード
覚え書き:

int ftp_rename ( LIBOFTP ftp,
const char *  from,
const char *  to 
)

ファイルリネーム

引数:
ftp LIBOFTPへのポインタ。
from 対象ファイル名
to 変更後ファイル名
戻り値:
int エラーコード
覚え書き:

int ftp_reset ( LIBOFTP ftp  ) 

エラー回復

引数:
ftp LIBOFTPへのポインタ。
戻り値:
int エラーコード
覚え書き:
エラー等によりftpコマンドシーケンスが乱れたとき、再同期を試みるために リプライキューをクリアします。

int ftp_rmdir ( LIBOFTP ftp,
const char *  dirname 
)

RMDコマンド

引数:
ftp LIBOFTPへのポインタ。
dirname 対象ディレクトリ名
戻り値:
int エラーコード
覚え書き:

int ftp_site ( LIBOFTP ftp,
const char *  cmdline 
)

SITEコマンド

引数:
ftp LIBOFTPへのポインタ。
cmdline コマンドライン
戻り値:
int エラーコード
覚え書き:

int ftp_timeout ( LIBOFTP ftp,
int  sec 
)

タイムアウト時間設定

引数:
ftp LIBOFTPへのポインタ。
sec タイムアウト時間(秒)
戻り値:
int エラーコード
覚え書き:

int ftp_type ( LIBOFTP ftp,
const char *  type 
)

タイプコマンド

引数:
ftp LIBOFTPへのポインタ。
type {ascii|binary|image}
戻り値:
int エラーコード
覚え書き:
FTPのTYPEコマンドを発行するだけで、データ転送は常に無変換で行う。 CR => CRLF 変換などは、必要ならユーザ側で行う。

int ftp_user ( LIBOFTP ftp,
const char *  user,
const char *  pass 
)

ユーザ認証

引数:
ftp LIBOFTPへのポインタ。
user ユーザ名
pass パスワード
戻り値:
int エラーコード
覚え書き:
認証後、定型的なコマンドも送信する。


libOftpに対してSun Mar 8 16:24:02 2009に生成されました。  doxygen 1.5.8