diff --git a/test/afpcmd.c b/test/afpcmd.c index 99d8a24..48b0cc2 100644 --- a/test/afpcmd.c +++ b/test/afpcmd.c @@ -8,6 +8,7 @@ #include #include + int Quiet; /* -------------------------------------------*/ @@ -251,9 +252,12 @@ DSI *dsi; return -1; usr = p->pw_name; } +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Login Version: \"%s\" uam: \"%s\" user: \"%s\"\n\n", vers, uam, usr); - +#else + fprintf(stdout,"[%s] Login Version: \"%s\" uam: \"%s\" user: \"%s\"\n", __func__, vers, uam, usr); +#endif ret = AFPopenLogin(conn, vers, uam, usr, pwd); dump_header(dsi); return ret; @@ -275,8 +279,12 @@ DSI *dsi; return -1; usr = p->pw_name; } +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"LoginExt Version: \"%s\" uam: \"%s\" user: \"%s\"\n\n", vers, uam, usr); +#else + fprintf(stdout,"[%s] LoginExt Version: \"%s\" uam: \"%s\" user: \"%s\"\n", __func__, vers, uam, usr); +#endif ret = AFPopenLoginExt(conn,vers, uam, usr, pwd); dump_header(dsi); return ret; @@ -289,8 +297,12 @@ int ret; DSI *dsi; dsi = &conn->dsi; +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Logout\n\n"); +#else + fprintf(stdout,"[%s] Logout\n", __func__); +#endif ret = AFPLogOut(conn); dump_header(dsi); return ret; @@ -304,8 +316,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"FPzzz enter sleep mode (flag: %i)\n\n", flag); +#else + fprintf(stdout,"[%s] FPzzz enter sleep mode (flag: %i)\n", __func__, flag); +#endif } ret = AFPzzz(conn, flag); dump_header(dsi); @@ -320,8 +336,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Get Session Token type %d\n\n", type); +#else + fprintf(stdout,"[%s] Get Session Token type %d\n", __func__, type); +#endif } ret = AFPGetSessionToken(conn,type, time, len, token); dump_header(dsi); @@ -336,8 +356,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Disconnect old session type %d token len %d\n\n", type, len); +#else + fprintf(stdout,"[%s] Disconnect old session type %d token len %d\n", __func__, type, len); +#endif } ret = AFPDisconnectOldSession(conn, type, len, token); dump_header(dsi); @@ -352,8 +376,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Map ID fn %d, id %d\n\n", fn, id); +#else + fprintf(stdout,"[%s] Map ID fn %d, id %d\n", __func__, fn, id); +#endif } ret = AFPMapID(conn,fn,id); dump_header(dsi); @@ -368,8 +396,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Map Name fn %d, name <%s>\n\n", fn, name); +#else + fprintf(stdout,"[%s] Map Name fn %d, name <%s>\n", __func__, fn, name); +#endif } ret = AFPMapName(conn,fn,name); dump_header(dsi); @@ -384,8 +416,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Bad packet fn %d, name <%s>\n\n", fn, name); +#else + fprintf(stdout,"[%s] Bad packet fn %d, name <%s>\n", __func__, fn, name); +#endif } ret = AFPBadPacket(conn, fn,name); dump_header(dsi); @@ -400,9 +436,14 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Get %s User Info id %d (get %s ID)\n\n", flag?"Default":"", id, (bitmap & 1)?"User":"Group"); +#else + fprintf(stdout,"[%s] Get %s User Info id %d (get %s ID)\n", __func__, + flag?"Default":"", id, (bitmap & 1)?"User":"Group"); +#endif } ret = AFPGetUserInfo(conn,flag,id, bitmap); dump_header(dsi); @@ -417,8 +458,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"get Server info\n\n"); +#else + fprintf(stdout,"[%s] get Server info\n", __func__); +#endif } ret = AFPGetSrvrInfo(conn); dump_header(dsi); @@ -433,8 +478,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"get Server param\n\n"); +#else + fprintf(stdout,"[%s] get Server param\n", __func__); +#endif } ret = AFPGetSrvrParms(conn); dump_header(dsi); @@ -449,8 +498,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"get Server message type %d bitmap %d\n\n", type, bitmap); +#else + fprintf(stdout,"[%s] get Server message type %d bitmap %d\n", __func__, type, bitmap); +#endif } ret = AFPGetSrvrMsg(conn, type, bitmap); dump_header(dsi); @@ -468,8 +521,12 @@ u_int16_t volID = 0; DSI *dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Open Vol %s bitmap %x\n\n", vol, bitmap); +#else + fprintf(stdout,"[%s] Open Vol %s bitmap %x\n", __func__, vol, bitmap); +#endif } volID = AFPOpenVol(conn,vol, bitmap); @@ -491,8 +548,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Close Vol %d\n\n", vol); +#else + fprintf(stdout,"[%s] Close Vol %d\n", __func__, vol); +#endif } ret = AFPCloseVol(conn,vol); @@ -510,8 +571,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Open Desktop Vol %d\n\n", vol); +#else + fprintf(stdout,"[%s] Open Desktop Vol %d\n", __func__, vol); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); @@ -554,8 +619,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Get Icon Desktop %d creator %s type %s size %d\n\n", dt, creator, type, size); +#else + fprintf(stdout,"[%s] Get Icon Desktop %d creator %s type %s size %d\n", __func__, dt, creator, type, size); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); @@ -603,8 +672,12 @@ u_int16_t temp; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Add Icon Desktop %d creator %s type %s size %d\n\n", dt, creator, type, size); +#else + fprintf(stdout,"[%s] Add Icon Desktop %d creator %s type %s size %d\n", __func__, dt, creator, type, size); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); @@ -655,8 +728,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Get Icon Desktop %d creator %s itype %d\n\n", dt, creator, itype); +#else + fprintf(stdout,"[%s] Get Icon Desktop %d creator %s itype %d\n", __func__, dt, creator, itype); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); @@ -697,8 +774,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Get Volume Parameters Vol %d bitmap %x \n\n", vol, bitmap); +#else + fprintf(stdout,"[%s] Get Volume Parameters Vol %d bitmap %x \n", __func__, vol, bitmap); +#endif } ret = AFPGetVolParam(conn,vol, bitmap); dump_header(dsi); @@ -714,8 +795,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Set Volume Parameters Vol %d bitmap %x \n\n", vol, bitmap); +#else + fprintf(stdout,"[%s] Set Volume Parameters Vol %d bitmap %x \n", __func__, vol, bitmap); +#endif } ret = AFPSetVolParam(conn,vol, bitmap, parms); dump_header(dsi); @@ -730,8 +815,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Close Desktop %d\n\n", vol); +#else + fprintf(stdout,"[%s] Close Desktop %d\n", __func__, vol); +#endif } ret = AFPCloseDT(conn,vol); dump_header(dsi); @@ -746,8 +835,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Close Fork %d\n\n", vol); +#else + fprintf(stdout,"[%s] Close Fork %d\n", __func__, vol); +#endif } ret = AFPCloseFork(conn,vol); dump_header(dsi); @@ -762,8 +855,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Flush volume %d\n\n", vol); +#else + fprintf(stdout,"[%s] Flush volume %d\n", __func__, vol); +#endif } ret = AFPFlush(conn,vol); dump_header(dsi); @@ -779,9 +876,14 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Byte lock,fork %d, %s, %s, offset: %d, size: %d\n\n", fork, end ? "end" : "start", mode ? "unlock" : "lock", offset, size); +#else + fprintf(stdout,"[%s] Byte lock,fork %d, %s, %s, offset: %d, size: %d\n", + __func__, fork, end ? "end" : "start", mode ? "unlock" : "lock", offset, size); +#endif } ret = AFPByteLock(conn,fork, end, mode, offset, size); dump_header(dsi); @@ -797,9 +899,14 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"FPByteLock_ext: fork: %d, end: %d, mode: %s, offset: %jd, size: %jd\n\n", fork, end, mode ? "unlock" : "lock", (intmax_t)offset, (intmax_t)size); +#else + fprintf(stdout,"[%s] FPByteLock_ext: fork: %d, end: %d, mode: %s, offset: %jd, size: %jd\n", + __func__, fork, end, mode ? "unlock" : "lock", (intmax_t)offset, (intmax_t)size); +#endif } ret = AFPByteLock_ext(conn,fork, end, mode, offset, size); dump_header(dsi); @@ -814,8 +921,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Flush fork %d\n\n", vol); +#else + fprintf(stdout,"[%s] Flush fork %d\n", __func__, vol); +#endif } ret = AFPFlushFork(conn,vol); dump_header(dsi); @@ -832,8 +943,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Close dir vol %d dir 0x%d\n\n", vol, htonl(did)); +#else + fprintf(stdout,"[%s] Close dir vol %d dir 0x%d\n", __func__, vol, htonl(did)); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); dsi->header.dsi_flags = DSIFL_REQUEST; @@ -876,8 +991,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Enumerate Vol %d did : 0x%x <%s>\n\n", vol, ntohl(did), name); +#else + fprintf(stdout,"[%s] Enumerate Vol %d did : 0x%x <%s>\n", __func__, vol, ntohl(did), name); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); dsi->header.dsi_flags = DSIFL_REQUEST; @@ -952,8 +1071,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Enumerate Vol %d did : 0x%x <%s> sindex: %u reqcnt: %u\n\n", vol, ntohl(did), name, sindex, reqcnt); +#else + fprintf(stdout,"[%s] Enumerate Vol %d did : 0x%x <%s> sindex: %u reqcnt: %u\n", __func__, vol, ntohl(did), name, sindex, reqcnt); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); dsi->header.dsi_flags = DSIFL_REQUEST; @@ -1018,8 +1141,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"GetFileDirParams Vol %d did : 0x%x <%s>\n\n", vol, ntohl(did), name); +#else + fprintf(stdout,"[%s] GetFileDirParams Vol %d did : 0x%x <%s>\n", __func__, vol, ntohl(did), name); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); dsi->header.dsi_flags = DSIFL_REQUEST; @@ -1067,8 +1194,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Create ID Vol: %d did: 0x%x <%s>\n\n", vol, ntohl(did), name); +#else + fprintf(stdout,"[%s] Create ID Vol: %d did: 0x%x <%s>\n", __func__, vol, ntohl(did), name); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); dsi->header.dsi_flags = DSIFL_REQUEST; @@ -1108,8 +1239,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Delete ID Vol: %d id: 0x%x \n\n", vol, ntohl(did)); +#else + fprintf(stdout,"[%s] Delete ID Vol: %d id: 0x%x \n", __func__, vol, ntohl(did)); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); dsi->header.dsi_flags = DSIFL_REQUEST; @@ -1147,8 +1282,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Resolve ID Vol: %d id: 0x%x %x\n\n", vol, ntohl(did), bitmap); +#else + fprintf(stdout,"[%s] Resolve ID Vol: %d id: 0x%x %x\n", __func__, vol, ntohl(did), bitmap); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); dsi->header.dsi_flags = DSIFL_REQUEST; @@ -1193,8 +1332,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Enumerate_ext Vol %d did : 0x%x <%s>\n\n", vol, ntohl(did), name); +#else + fprintf(stdout,"[%s] Enumerate_ext Vol %d did : 0x%x <%s>\n", __func__, vol, ntohl(did), name); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); dsi->header.dsi_flags = DSIFL_REQUEST; @@ -1270,8 +1413,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Enumerate_ext2 Vol %d did : 0x%x <%s>\n\n", vol, ntohl(did), name); +#else + fprintf(stdout,"[%s] Enumerate_ext2 Vol %d did : 0x%x <%s>\n", __func__, vol, ntohl(did), name); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); dsi->header.dsi_flags = DSIFL_REQUEST; @@ -1353,9 +1500,14 @@ unsigned int FPEnumerateExt2Full(CONN *conn, dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Enumerate_ext2_idx: Vol: %d, did: 0x%x, name: \"%s\", sindex: %u, reqcount: %u\n\n", vol, ntohl(did), name, startindex, reqcount); +#else + fprintf(stdout,"[%s] Enumerate_ext2_idx: Vol: %d, did: 0x%x, name: \"%s\", sindex: %u, reqcount: %u\n", + __func__, vol, ntohl(did), name, startindex, reqcount); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); @@ -1428,8 +1580,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"FPDelete conn %x Vol %d did : 0x%x <%s>\n\n", conn, vol, ntohl(did), name); +#else + fprintf(stdout,"[%s] FPDelete conn %x Vol %d did : 0x%x <%s>\n", __func__, conn, vol, ntohl(did), name); +#endif } ret = AFPDelete(conn,vol, did , name); @@ -1447,8 +1603,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Get Comment Vol %d did : 0x%x <%s>\n\n", vol, ntohl(did), name); +#else + fprintf(stdout,"[%s] Get Comment Vol %d did : 0x%x <%s>\n", __func__, vol, ntohl(did), name); +#endif } ret = AFPGetComment(conn,vol, did , name); @@ -1466,8 +1626,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Remove Comment Vol %d did : 0x%x <%s>\n\n", vol, ntohl(did), name); +#else + fprintf(stdout,"[%s] Remove Comment Vol %d did : 0x%x <%s>\n", __func__, vol, ntohl(did), name); +#endif } ret = AFPRemoveComment(conn,vol, did , name); @@ -1485,8 +1649,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Add Comment Vol %d did : 0x%x <%s> comment <%s>\n\n", vol, ntohl(did), name, cmt); +#else + fprintf(stdout,"[%s] Add Comment Vol %d did : 0x%x <%s> comment <%s>\n", __func__, vol, ntohl(did), name, cmt); +#endif } ret = AFPAddComment(conn,vol, did , name, cmt); @@ -1506,8 +1674,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Open Directory Vol %d did : 0x%x <%s>\n\n", vol, htonl(did), name); +#else + fprintf(stdout,"[%s] Open Directory Vol %d did : 0x%x <%s>\n", __func__, vol, htonl(did), name); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); dsi->header.dsi_flags = DSIFL_REQUEST; @@ -1554,8 +1726,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Create Directory Vol %d did : 0x%x <%s>\n\n", vol, ntohl(did), name); +#else + fprintf(stdout,"[%s] Create Directory Vol %d did : 0x%x <%s>\n", __func__, vol, ntohl(did), name); +#endif } dir = AFPCreateDir(conn,vol, did , name); @@ -1575,9 +1751,14 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Open Fork %s Vol %d did : 0x%x <%s> access %x\n\n", (type == OPENFORK_DATA)?"data":"resource", vol, ntohl(did), name, access); +#else + fprintf(stdout,"[%s] Open Fork %s Vol %d did : 0x%x <%s> access %x\n", __func__, (type == OPENFORK_DATA)?"data":"resource", + vol, ntohl(did), name, access); +#endif } ofork = AFPOpenFork(conn,vol, type, bitmap, did , name, access); @@ -1598,8 +1779,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Create File %s Vol %d did : 0x%x <%s>\n\n", (type )?"HARD":"SOFT", vol, ntohl(did), name); +#else + fprintf(stdout,"[%s] Create File %s Vol %d did : 0x%x <%s>\n", __func__, (type )?"HARD":"SOFT", vol, ntohl(did), name); +#endif } ret = AFPCreateFile(conn,vol, type, did , name); dump_header(dsi); @@ -1615,8 +1800,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Get Fork param fork %d bitmap 0x%x\n\n", fork, bitmap); +#else + fprintf(stdout,"[%s] Get Fork param fork %d bitmap 0x%x\n", __func__, fork, bitmap); +#endif } ret = AFPGetForkParam(conn,fork, bitmap); dump_header(dsi); @@ -1632,8 +1821,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"GetAppl DT %d <%s>\n\n", dt, name); +#else + fprintf(stdout,"[%s] GetAppl DT %d <%s>\n", __func__, dt, name); +#endif } ret = AFPGetAPPL(conn,dt, name, index, bitmap); dump_header(dsi); @@ -1649,8 +1842,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"AddAPPL DT %d creator: %s tag %x did: 0x%x <%s>\n\n", dt, creator, tag, htonl(did), name); +#else + fprintf(stdout,"[%s] AddAPPL DT %d creator: %s tag %x did: 0x%x <%s>\n", __func__, dt, creator, tag, htonl(did), name); +#endif } ret = AFPAddAPPL(conn, dt, did, creator, tag, name); dump_header(dsi); @@ -1666,8 +1863,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"RemoveAPPL DT %d creator: %s did: 0x%x <%s>\n\n", dt, creator, htonl(did), name); +#else + fprintf(stdout,"[%s] RemoveAPPL DT %d creator: %s did: 0x%x <%s>\n", __func__, dt, creator, htonl(did), name); +#endif } ret = AFPRemoveAPPL(conn, dt, did, creator, name); dump_header(dsi); @@ -1683,8 +1884,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Set Fork param fork %d bitmap 0x%x size %lld\n\n", fork, bitmap,size); +#else + fprintf(stdout,"[%s] Set Fork param fork %d bitmap 0x%x size %lld\n", __func__, fork, bitmap,size); +#endif } ret = AFPSetForkParam(conn, fork, bitmap, size); dump_header(dsi); @@ -1702,8 +1907,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Set DirParam 0x%x %s bitmap 0x%x\n\n", ntohl(did), name, bitmap); +#else + fprintf(stdout,"[%s] Set DirParam 0x%x %s bitmap 0x%x\n", __func__, ntohl(did), name, bitmap); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); @@ -1752,8 +1961,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Set FilParam 0x%x %s bitmap 0x%x\n\n", ntohl(did), name, bitmap); +#else + fprintf(stdout,"[%s] Set FilParam 0x%x %s bitmap 0x%x\n", __func__, ntohl(did), name, bitmap); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); @@ -1801,8 +2014,12 @@ unsigned int FPSyncDir(CONN *conn, u_int16_t vol, int did) dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"FPSyncDir 0x%x\n\n", ntohl(did)); +#else + fprintf(stdout,"[%s] FPSyncDir 0x%x\n\n", __func__, ntohl(did)); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); @@ -1840,8 +2057,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"FPCatSearch vol: %d bitmap 0x%x\n\n", vol, rbitmap); +#else + fprintf(stdout,"[%s] FPCatSearch vol: %d bitmap 0x%x\n", __func__, vol, rbitmap); +#endif } ret = AFPCatSearch(conn, vol, nbe, pos, f_bitmap, d_bitmap, rbitmap, filedir, filedir2); dump_header(dsi); @@ -1858,8 +2079,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"FPCatSearchExt vol: %d bitmap 0x%x\n\n", vol, rbitmap); +#else + fprintf(stdout,"[%s] FPCatSearchExt vol: %d bitmap 0x%x\n", __func__, vol, rbitmap); +#endif } ret = AFPCatSearchExt(conn, vol, nbe, pos, f_bitmap, d_bitmap, rbitmap, filedir, filedir2); dump_header(dsi); @@ -1877,8 +2102,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Set FilDirParam 0x%x <%s> bitmap 0x%x\n\n", ntohl(did), name, bitmap); +#else + fprintf(stdout,"[%s] Set FilDirParam 0x%x <%s> bitmap 0x%x\n", __func__, ntohl(did), name, bitmap); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); @@ -1926,8 +2155,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Copy File Vol %d did : %d <%s> ==> %s\n\n", svol, ntohl(sdid), src, dst); +#else + fprintf(stdout,"[%s] Copy File Vol %d did : %d <%s> ==> %s\n", __func__, svol, ntohl(sdid), src, dst); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); dsi->header.dsi_flags = DSIFL_REQUEST; @@ -1976,9 +2209,14 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Exchange File Vol: %d did: 0x%x \"%s\" ==> 0x%x \"%s\"\n\n", vol, ntohl(sdid), src, ntohl(ddid), dst); +#else + fprintf(stdout,"[%s] Exchange File Vol: %d did: 0x%x \"%s\" ==> 0x%x \"%s\"\n", __func__, vol, ntohl(sdid), src, + ntohl(ddid), dst); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); dsi->header.dsi_flags = DSIFL_REQUEST; @@ -2022,8 +2260,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Move and rename Vol: %d did: 0x%x <%s> ==> 0x%x <%s>\n\n", svol, ntohl(sdid), src, ntohl(ddid), dst); +#else + fprintf(stdout,"[%s] Move and rename Vol: %d did: 0x%x <%s> ==> 0x%x <%s>\n", __func__, svol, ntohl(sdid), src, ntohl(ddid), dst); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); dsi->header.dsi_flags = DSIFL_REQUEST; @@ -2068,8 +2310,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Rename File Vol %d did : %d <%s> ==> %s\n\n", svol, ntohl(sdid), src, dst); +#else + fprintf(stdout,"[%s] Rename File Vol %d did : %d <%s> ==> %s\n", __func__, svol, ntohl(sdid), src, dst); +#endif } memset(dsi->commands, 0, DSI_CMDSIZ); dsi->header.dsi_flags = DSIFL_REQUEST; @@ -2107,8 +2353,12 @@ unsigned int FPReadHeader(DSI *dsi, u_int16_t fork, int offset, int size, char * int ret; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"send read header fork %d offset %d size %d\n\n", fork , offset, size); +#else + fprintf(stdout,"[%s] send read header fork %d offset %d size %d\n", __func__, fork , offset, size); +#endif } ret = AFPReadHeader(dsi,fork, offset, size, data); @@ -2122,8 +2372,12 @@ unsigned int FPReadFooter(DSI *dsi, u_int16_t fork, int offset, int size, char * int ret; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"get read reply fork %d offset %d size %d\n\n", fork , offset, size); +#else + fprintf(stdout,"[%s] get read reply fork %d offset %d size %d\n", __func__, fork , offset, size); +#endif } ret = AFPReadFooter(dsi,fork, offset, size, data); @@ -2141,8 +2395,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"read fork %d offset %d size %d\n\n", fork , offset, size); +#else + fprintf(stdout,"[%s] read fork %d offset %d size %d\n", __func__, fork , offset, size); +#endif } ret = AFPRead(conn,fork, offset, size, data); @@ -2160,8 +2418,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"read ext fork %d offset %lld size %lld\n\n", fork , offset, size); +#else + fprintf(stdout,"[%s] read ext fork %d offset %lld size %lld\n", __func__, fork , offset, size); +#endif } ret = AFPRead_ext(conn,fork, offset, size, data); @@ -2179,8 +2441,12 @@ unsigned int FPRead_ext_async(CONN *conn, u_int16_t fork, off_t offset, off_t si dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"read ext fork %d offset %lld size %lld\n\n", fork , offset, size); +#else + fprintf(stdout,"[%s] read ext fork %d offset %lld size %lld\n", __func__, fork , offset, size); +#endif } ret = AFPRead_ext_async(conn,fork, offset, size, data); @@ -2195,8 +2461,12 @@ unsigned int FPWriteHeader(DSI *dsi, u_int16_t fork, int offset, int size, char int ret; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"send write header fork %d offset %d size %d from 0x%x\n\n", fork , offset, size, (unsigned)whence); +#else + fprintf(stdout,"[%s] send write header fork %d offset %d size %d from 0x%x\n", __func__, fork , offset, size, (unsigned)whence); +#endif } ret = AFPWriteHeader(dsi ,fork, offset, size, data, whence); @@ -2210,8 +2480,12 @@ unsigned int FPWriteFooter(DSI *dsi, u_int16_t fork, int offset, int size, char int ret; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"get write footer fork %d offset %d size %d from 0x%x\n\n", fork , offset, size, (unsigned)whence); +#else + fprintf(stdout,"[%s] get write footer fork %d offset %d size %d from 0x%x\n", __func__, fork , offset, size, (unsigned)whence); +#endif } ret = AFPWriteFooter(dsi ,fork, offset, size, data, whence); @@ -2228,8 +2502,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"write fork %d offset %d size %d from 0x%x\n\n", fork , offset, size, (unsigned)whence); +#else + fprintf(stdout,"[%s] write fork %d offset %d size %d from 0x%x\n", __func__, fork , offset, size, (unsigned)whence); +#endif } ret = AFPWrite(conn,fork, offset, size, data, whence); @@ -2246,8 +2524,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"write_ext fork %d offset %lld size %lld\n\n", fork , offset, size); +#else + fprintf(stdout,"[%s] write_ext fork %d offset %lld size %lld\n", __func__, fork , offset, size); +#endif } ret = AFPWrite_ext(conn,fork, offset, size, data, whence); @@ -2264,8 +2546,12 @@ unsigned int FPWrite_ext_async(CONN *conn, u_int16_t fork, off_t offset, off_t dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"write_ext fork %d offset %lld size %lld\n\n", fork , offset, size); +#else + fprintf(stdout,"[%s] write_ext fork %d offset %lld size %lld\n", __func__, fork , offset, size); +#endif } ret = AFPWrite_ext_async(conn,fork, offset, size, data, whence); @@ -2280,8 +2566,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Get ACLs Vol: %d Did: %d <%s> bitmap 0x%x\n\n", vol, ntohl(did), name, bitmap); +#else + fprintf(stdout,"[%s] Get ACLs Vol: %d Did: %d <%s> bitmap 0x%x\n", __func__, vol, ntohl(did), name, bitmap); +#endif } ret = AFPGetACL(conn, vol, did, bitmap, name); @@ -2297,8 +2587,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Get extended attr Vol: %d Did: %d <%s> bitmap 0x%x, path: %s, attr: %s\n\n", vol, ntohl(did), name, bitmap, name, attr); +#else + fprintf(stdout,"[%s] Get extended attr Vol: %d Did: %d <%s> bitmap 0x%x, path: %s, attr: %s\n", __func__, vol, ntohl(did), name, bitmap, name, attr); +#endif } ret = AFPGetExtAttr(conn, vol, did, bitmap, maxsize, name, attr); @@ -2314,8 +2608,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Get extended attrs list Vol: %d Did: %d <%s> bitmap 0x%x, path: %s\n\n", vol, ntohl(did), name, bitmap, name); +#else + fprintf(stdout,"[%s] Get extended attrs list Vol: %d Did: %d <%s> bitmap 0x%x, path: %s\n", __func__, vol, ntohl(did), name, bitmap, name); +#endif } ret = AFPListExtAttr(conn, vol, did, bitmap, maxsize, name); @@ -2331,8 +2629,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Set extended attr Vol: %d Did: %d <%s> bitmap 0x%x, path: %s, attr: %s, data: %s\n\n", vol, ntohl(did), name, bitmap, name, attr, data); +#else + fprintf(stdout,"[%s] Set extended attr Vol: %d Did: %d <%s> bitmap 0x%x, path: %s, attr: %s, data: %s\n", __func__, vol, ntohl(did), name, bitmap, name, attr, data); +#endif } ret = AFPSetExtAttr(conn, vol, did, bitmap, name, attr, data); @@ -2349,8 +2651,12 @@ DSI *dsi; dsi = &conn->dsi; if (!Quiet) { +#if 0 fprintf(stdout,"---------------------\n"); fprintf(stdout,"Remove extended attr Vol: %d Did: %d <%s> bitmap 0x%x, path: %s, attr: %s\n\n", vol, ntohl(did), name, bitmap, name, attr); +#else + fprintf(stdout,"[%s] Remove extended attr Vol: %d Did: %d <%s> bitmap 0x%x, path: %s, attr: %s\n", __func__, vol, ntohl(did), name, bitmap, name, attr); +#endif } ret = AFPRemoveExtAttr(conn, vol, did, bitmap, name, attr);