例 D-3 は、このコールバックの典型的なアルゴリズムの例です。
Tt_message myLoadMsgCB( Tt_message msg, void *clientData, Tttk_op op, unsigned char *contents, int len, char *file ) { if (len > 0) { // Replace data with len bytes in contents } else if (file != 0) { // Replace data with data read from file } if (op == TTME_DEPOSIT) { tt_message_reply( msg ); } tttk_message_destroy( msg ); return 0; }