Changeset 68 in libcf
- Timestamp:
- 04/11/13 13:25:37 (11 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/cf_codec.c
r66 r68 51 51 hex[iter + 1] = hexchar[((*(ptr)) ) & 0x0f]; 52 52 } 53 hex[count ] = '\0';53 hex[count - 1] = '\0'; 54 54 55 55 return CF_OK; -
trunk/test/codec.c
r66 r68 10 10 int main (void) 11 11 { 12 char data[] = 13 "【 曲名 : 사랑하고 있는데 】\n" 14 "《 歌 : Kylee 》\n" 15 "『 절원의 템페스트 OP2 Theme 』\n"; 12 char data[] = "ONE OK ROCK - Nothing Helps"; 16 13 17 14 char hex[512] = {0x00,}; … … 19 16 size_t length = 0; 20 17 18 CF_DEBUG_PRINT (stderr, " = Convert binary to hex = \n"); 21 19 CF_Codec_BinaryToHex ((unsigned char *)data, strlen (data), hex); 22 CF_DEBUG_PRINT (std out, "data : \n%s\n", data);23 CF_DEBUG_PRINT (std out, "hex : \n%s\n\n", hex);24 CF_DEBUG_PRINT_BIN (stdout, (unsigned char *) data, strlen (data), "data : \n%s", data);20 CF_DEBUG_PRINT (stderr, "data : %s\n", data); 21 CF_DEBUG_PRINT (stderr, "hex : %s\n", hex); 22 CF_DEBUG_PRINT_BIN (stdout, (unsigned char *) data, strlen (data), "data : %s\n", data); 25 23 24 CF_DEBUG_PRINT (stderr, " = Convert hex to binary = \n"); 26 25 CF_Codec_HexToBinary (hex, bin, &length); 27 CF_DEBUG_PRINT (std out, "bin : \n%s\n", bin);28 CF_DEBUG_PRINT_BIN (std out, bin, length, "bin : \n%s\n", bin);26 CF_DEBUG_PRINT (stderr, "bin : %s\n", bin); 27 CF_DEBUG_PRINT_BIN (stderr, bin, length, "bin : %s\n", bin); 29 28 30 29 return 0; -
trunk/test/test.c
r66 r68 7 7 #include "cf_socket.h" 8 8 #include "cf_thread.h" 9 #include "cf_codec.h" 9 10 10 11 /* … … 37 38 int socket_echo_client (void * arg); 38 39 void test_socket (void); 40 void test_codec (void); 39 41 40 42 int main (int argc, char ** argv) … … 59 61 CF_DEBUG_PRINT (stderr, " == MULTI-THREADED SOCKET TEST ==\n"); 60 62 test_socket (); 63 64 // 5 65 CF_DEBUG_PRINT (stderr, " == CODEC TEST ==\n"); 66 test_codec (); 61 67 62 68 CF_DEBUG_PRINT (stderr, " == END OF TEST ==\n"); … … 373 379 } 374 380 381 void test_codec (void) 382 { 383 char data[] = "ONE OK ROCK - Nothing Helps"; 384 385 char hex[512] = {0x00,}; 386 unsigned char bin[512] = {0x00,}; 387 size_t length = 0; 388 389 CF_DEBUG_PRINT (stderr, " = Convert binary to hex = \n"); 390 CF_Codec_BinaryToHex ((unsigned char *)data, strlen (data), hex); 391 CF_DEBUG_PRINT (stderr, "data : %s\n", data); 392 CF_DEBUG_PRINT (stderr, "hex : %s\n", hex); 393 CF_DEBUG_PRINT_BIN (stdout, (unsigned char *) data, strlen (data), "data : %s\n", data); 394 395 CF_DEBUG_PRINT (stderr, " = Convert hex to binary = \n"); 396 CF_Codec_HexToBinary (hex, bin, &length); 397 CF_DEBUG_PRINT (stderr, "bin : %s\n", bin); 398 CF_DEBUG_PRINT_BIN (stderr, bin, length, "bin : %s\n", bin); 399 } -
trunk/windows/libcf/libcf.vcproj
r55 r68 176 176 > 177 177 <File 178 RelativePath="..\..\src\cf_codec.c" 179 > 180 </File> 181 <File 178 182 RelativePath="..\..\src\cf_debug.c" 179 183 > … … 210 214 </File> 211 215 <File 216 RelativePath="..\..\include\cf_codec.h" 217 > 218 </File> 219 <File 212 220 RelativePath="..\..\include\cf_debug.h" 213 221 >
Note:
See TracChangeset
for help on using the changeset viewer.