
1月27日にせんだいメディアテークで催された「オープンソースソフトウェアの世界」というイベントに行ってきました。内容は、IPAの三浦広志氏とRubyの作者であるまつもとゆきひろ氏(Matz)の講演。
買ったばかりの、というか出版されたばかりのオライリーのRuby本にサインしていただきました。
軽く緊張してて、帽子被ったままサインを貰いに行ったのは良い(?)思い出。
$ sudo apt-get remove pulseaudio*
$ sudo rm /etc/X11/Xsession.d/70pulseaudio
while ((ch = getopt(argc, argv, "ab:")) != -1){
switch (ch){
case 'a':
-aオプションの処理
break;
case 'b':
-bオプションの処理
この時、-bの次の引数へのポインタがoptargに収まっている
break;
}
}
$ sudo apt-get install libmtp-dev
こんな感じでlibmtpのdevelopmentパッケージをインストールしておく。rockbox-3.1/utils/MTP$ make
gcc -Wall -lmtp -o sendfirm sendfirm.c
sendfirm.c: In function ‘sendfile_function’:
sendfirm.c:94: error: too many arguments to function ‘LIBMTP_Send_File_From_File’
make: *** [sendfirm] エラー 1
$
ret = LIBMTP_Send_File_From_File(device, from_path, genfile, progress,
NULL, parent_id);
となっていて、6つ引数が与えられているのが分かる。int LIBMTP_Send_File_From_File(
LIBMTP_mtpdevice_t * device,
char const *const path,
LIBMTP_file_t *const filedata,
LIBMTP_progressfunc_t const callback,
void const *const data
)
与えるべき引数の数は5つだ。そりゃエラーになる筈。int LIBMTP_Send_File_From_File(
LIBMTP_mtpdevice_t * device,
char const *const path,
LIBMTP_file_t *const filedata,
LIBMTP_progressfunc_t const callback,
void const *const data,
uint32_t const parenthandle
)
こっちは6つになってる。rockbox-3.1/utils/MTP$ make
gcc -Wall -lmtp -o sendfirm sendfirm.c
sendfirm.c: In function ‘sendfile_function’:
sendfirm.c:67: 警告: unused variable ‘parent_id’
$
警告出たけど、案の定parent_idが宣言されたけど一度も使われてないよ、ということなのでキニシナイ。