Changeset 14575 for trunk/FACT++/dim
- Timestamp:
- 11/07/12 10:47:40 (12 years ago)
- Location:
- trunk/FACT++/dim
- Files:
-
- 1 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/dim/README_v19.txt
r14403 r14575 1 1 2 DIM version 19.3 8Release Notes2 DIM version 19.39 Release Notes 3 3 4 4 Notes 1 and 2 for Unix Users only … … 17 17 Dns </dev/null >& dns.log & 18 18 19 NOTE 3: The Version Number service provided by servers is now set to 1938. 19 NOTE 3: The Version Number service provided by servers is now set to 1939. 20 21 04/10/2012 22 Changes for version 19.39: 23 - Unfortunately Windows, unlike Linux, does not use LP64 convention for 64 bits, 24 i.e. the type long is a 32 bit variable (?!?!?!) 25 So created a dim_long type which can always hold a pointer 26 20 27 21 28 09/08/2012 -
trunk/FACT++/dim/dim/dic.h
r11071 r14575 25 25 int req_timeout, void *service_address, 26 26 int service_size, void (*usr_routine)(void*, void*, int*), 27 long tag, void *fill_addr, int fill_size) );27 dim_long tag, void *fill_addr, int fill_size) ); 28 28 _DIM_PROTOE( unsigned dic_info_service_stamped, (char *service_name, int req_type, 29 29 int req_timeout, void *service_address, 30 30 int service_size, void (*usr_routine)(void*, void*, int*), 31 long tag, void *fill_addr, int fill_size) );31 dim_long tag, void *fill_addr, int fill_size) ); 32 32 _DIM_PROTOE( int dic_cmnd_callback, (char *service_name, void *service_address, 33 33 int service_size, void (*usr_routine)(void*, int*), 34 long tag) );34 dim_long tag) ); 35 35 _DIM_PROTOE( int dic_cmnd_service, (char *service_name, void *service_address, 36 36 int service_size) ); -
trunk/FACT++/dim/dim/dim.h
r14403 r14575 14 14 #include "dim_common.h" 15 15 16 #define DIM_VERSION_NUMBER 193816 #define DIM_VERSION_NUMBER 2001 17 17 18 18 … … 375 375 int time_left; 376 376 void (*user_routine)(); 377 long tag;377 dim_long tag; 378 378 } TIMR_ENT; 379 379 … … 471 471 int fill_size; 472 472 void (*user_routine)(); 473 long tag;473 dim_long tag; 474 474 TIMR_ENT *timer_ent; 475 475 int conn_id; … … 517 517 _DIM_PROTOE( int dtq_delete, (int queue_id) ); 518 518 _DIM_PROTOE( TIMR_ENT *dtq_add_entry, (int queue_id, int time, 519 void (*user_routine)(), long tag) );519 void (*user_routine)(), dim_long tag) ); 520 520 _DIM_PROTOE( int dtq_clear_entry, (TIMR_ENT *entry) ); 521 521 _DIM_PROTOE( int dtq_rem_entry, (int queue_id, TIMR_ENT *entry) ); -
trunk/FACT++/dim/dim/dim_common.h
r13135 r14575 43 43 #endif 44 44 45 #if def WIN3245 #if defined (_WIN64) 46 46 typedef __int64 longlong; 47 typedef longlong dim_long; 48 #elif defined(WIN32) 49 typedef __int64 longlong; 50 typedef long dim_long; 47 51 #elif defined(__linux__) 48 52 typedef long long int longlong; 53 typedef long dim_long; 49 54 #else 50 55 #include <sys/types.h> 51 56 typedef int64_t longlong; 57 typedef long dim_long; 52 58 #endif 53 59 … … 182 188 _DIM_PROTOE( int dim_set_scheduler_class, (int sched_class) ); 183 189 _DIM_PROTOE( int dim_get_scheduler_class, (int *sched_class) ); 184 _DIM_PROTOE( long dim_start_thread, (void(*rout)(void*), void *tag) );190 _DIM_PROTOE( dim_long dim_start_thread, (void(*rout)(void*), void *tag) ); 185 191 _DIM_PROTOE( int dic_set_dns_node, (char *node) ); 186 192 _DIM_PROTOE( int dic_get_dns_node, (char *node) ); … … 192 198 _DIM_PROTOE( int dis_get_dns_port, () ); 193 199 _DIM_PROTOE( void dim_stop, () ); 194 _DIM_PROTOE( int dim_stop_thread, ( long tid) );195 _DIM_PROTOE( long dis_add_dns, (char *node, int port) );196 _DIM_PROTOE( long dic_add_dns, (char *node, int port) );200 _DIM_PROTOE( int dim_stop_thread, (dim_long tid) ); 201 _DIM_PROTOE( dim_long dis_add_dns, (char *node, int port) ); 202 _DIM_PROTOE( dim_long dic_add_dns, (char *node, int port) ); 197 203 _DIM_PROTOE( int dim_get_env_var, (char *env_var, char *value, int value_size) ); 198 204 _DIM_PROTOE( int dim_set_write_buffer_size, (int bytes) ); -
trunk/FACT++/dim/dim/dis.h
r11071 r14575 27 27 _DIM_PROTOE( int dis_start_serving, (char *task_name) ); 28 28 _DIM_PROTOE( void dis_stop_serving, () ); 29 _DIM_PROTOE( int dis_get_next_cmnd, ( long *tag, int *buffer, int *size ) );29 _DIM_PROTOE( int dis_get_next_cmnd, (dim_long *tag, int *buffer, int *size ) ); 30 30 _DIM_PROTOE( int dis_get_client, (char *name ) ); 31 31 _DIM_PROTOE( int dis_get_conn_id, () ); 32 32 _DIM_PROTOE( unsigned dis_add_service, (char *service_name, char *service_type, 33 33 void *service_address, int service_size, 34 void (*usr_routine)(void*,void**,int*,int*), long tag) );34 void (*usr_routine)(void*,void**,int*,int*), dim_long tag) ); 35 35 _DIM_PROTOE( unsigned dis_add_cmnd, (char *service_name, char *service_type, 36 void (*usr_routine)(void*,void*,int*), long tag) );36 void (*usr_routine)(void*,void*,int*), dim_long tag) ); 37 37 _DIM_PROTOE( void dis_add_client_exit_handler,(void (*usr_routine)(int*)) ); 38 38 _DIM_PROTOE( void dis_set_client_exit_handler,(int conn_id, int tag) ); … … 54 54 _DIM_PROTOE( char *dis_get_error_services, () ); 55 55 _DIM_PROTOE( char *dis_get_client_services, (int conn_id) ); 56 _DIM_PROTOE( int dis_start_serving_dns, ( long dns_id, char *task_name/*, int *id_list*/) );57 _DIM_PROTOE( void dis_stop_serving_dns, ( long dns_id) );58 _DIM_PROTOE( unsigned dis_add_service_dns, ( long dns_id, char *service_name, char *service_type,56 _DIM_PROTOE( int dis_start_serving_dns, (dim_long dns_id, char *task_name/*, int *id_list*/) ); 57 _DIM_PROTOE( void dis_stop_serving_dns, (dim_long dns_id) ); 58 _DIM_PROTOE( unsigned dis_add_service_dns, (dim_long dns_id, char *service_name, char *service_type, 59 59 void *service_address, int service_size, 60 void (*usr_routine)(void*,void**,int*,int*), long tag) );61 _DIM_PROTOE( unsigned dis_add_cmnd_dns, ( long dns_id, char *service_name, char *service_type,62 void (*usr_routine)(void*,void*,int*), long tag) );60 void (*usr_routine)(void*,void**,int*,int*), dim_long tag) ); 61 _DIM_PROTOE( unsigned dis_add_cmnd_dns, (dim_long dns_id, char *service_name, char *service_type, 62 void (*usr_routine)(void*,void*,int*), dim_long tag) ); 63 63 _DIM_PROTOE( int dis_get_n_clients, (unsigned service_id) ); 64 64 _DIM_PROTOE( int dis_get_timestamp, (unsigned service_id, -
trunk/FACT++/dim/dim/dis.hxx
r11695 r14575 64 64 ~DimServerDns(); 65 65 void init(const char *node, int port); 66 long getDnsId();66 dim_long getDnsId(); 67 67 void setName(const char *name); 68 68 char *getName(); … … 76 76 char *itsNode; 77 77 int itsPort; 78 long itsDnsId;78 dim_long itsDnsId; 79 79 char *itsName; 80 80 int autoStart; … … 119 119 static int setDnsNode(const char *node); 120 120 static int setDnsNode(const char *node, int port); 121 static long addDns(const char *node, int port);122 static void stopDns( long dnsid);121 static dim_long addDns(const char *node, int port); 122 static void stopDns(dim_long dnsid); 123 123 static char *getDnsNode(); 124 124 static int getDnsPort(); -
trunk/FACT++/dim/src/dic.c
r13995 r14575 64 64 int req_timeout, void *service_address, 65 65 int service_size, void (*usr_routine)(void*,void*,int*), 66 long tag, void *fill_addr, int fill_size, int stamped) );66 dim_long tag, void *fill_addr, int fill_size, int stamped) ); 67 67 _DIM_PROTO( int request_command, (char *service_name, void *service_address, 68 68 int service_size, void (*usr_routine)(void*,int*), 69 long tag, int stamped) );69 dim_long tag, int stamped) ); 70 70 _DIM_PROTO( DIC_SERVICE *insert_service, (int type, int timeout, char *name, 71 71 int *address, int size, void (*routine)(), 72 long tag, int *fill_addr, int fill_size,72 dim_long tag, int *fill_addr, int fill_size, 73 73 int pending, int stamped ) ); 74 74 _DIM_PROTO( void modify_service, (DIC_SERVICE *servp, int timeout, 75 75 int *address, int size, void (*routine)(), 76 long tag, int *fill_addr, int fill_size, int stamped) );76 dim_long tag, int *fill_addr, int fill_size, int stamped) ); 77 77 _DIM_PROTO( DIC_SERVICE *locate_command, (char *serv_name) ); 78 78 _DIM_PROTO( DIC_SERVICE *locate_pending, (char *serv_name) ); … … 586 586 587 587 unsigned dic_info_service( char *serv_name, int req_type, int req_timeout, void *serv_address, 588 int serv_size, void (*usr_routine)(), long tag, void *fill_addr, int fill_size )588 int serv_size, void (*usr_routine)(), dim_long tag, void *fill_addr, int fill_size ) 589 589 { 590 590 unsigned ret; … … 598 598 599 599 unsigned dic_info_service_stamped( char *serv_name, int req_type, int req_timeout, void *serv_address, 600 int serv_size, void (*usr_routine)(), long tag, void *fill_addr, int fill_size )600 int serv_size, void (*usr_routine)(), dim_long tag, void *fill_addr, int fill_size ) 601 601 { 602 602 unsigned ret; … … 610 610 611 611 unsigned request_service( char *serv_name, int req_type, int req_timeout, void *serv_address, 612 int serv_size, void (*usr_routine)(), long tag, void *fill_addr, int fill_size, int stamped )612 int serv_size, void (*usr_routine)(), dim_long tag, void *fill_addr, int fill_size, int stamped ) 613 613 { 614 614 register DIC_SERVICE *servp; … … 701 701 702 702 int dic_cmnd_callback( char *serv_name, void *serv_address, int serv_size, 703 void (*usr_routine)(), long tag )703 void (*usr_routine)(), dim_long tag ) 704 704 { 705 705 int ret; … … 711 711 712 712 int dic_cmnd_callback_stamped( char *serv_name, void *serv_address, int serv_size, 713 void (*usr_routine)(), long tag )713 void (*usr_routine)(), dim_long tag ) 714 714 { 715 715 int ret; … … 721 721 722 722 int request_command(char *serv_name, void *serv_address, int serv_size, 723 void (*usr_routine)(), long tag, int stamped)723 void (*usr_routine)(), dim_long tag, int stamped) 724 724 { 725 725 int conn_id, ret; … … 795 795 796 796 DIC_SERVICE *insert_service( int type, int timeout, char *name, int *address, int size, 797 void (*routine)(), long tag, int *fill_addr, int fill_size,797 void (*routine)(), dim_long tag, int *fill_addr, int fill_size, 798 798 int pending, int stamped) 799 799 { … … 869 869 870 870 void modify_service( DIC_SERVICE *servp, int timeout, int *address, int size, void (*routine)(), 871 long tag, int *fill_addr, int fill_size, int stamped)871 dim_long tag, int *fill_addr, int fill_size, int stamped) 872 872 { 873 873 int *fillp; … … 1153 1153 int locate_service( DIC_SERVICE *servp ) 1154 1154 { 1155 extern int open_dns( long, void (*)(), void (*)(), int, int, int);1155 extern int open_dns(dim_long, void (*)(), void (*)(), int, int, int); 1156 1156 1157 1157 if(!strcmp(servp->serv_name,"DIS_DNS/SERVER_INFO")) … … 1517 1517 if(tmout == 0) 1518 1518 tmout = 1; 1519 dtq_start_timer(tmout, retry_bad_connection, ( long)bad_connp);1519 dtq_start_timer(tmout, retry_bad_connection, (dim_long)bad_connp); 1520 1520 if(( servp->type == COMMAND )||( servp->type == ONCE_ONLY )) 1521 1521 return(0); … … 1987 1987 id = id_get((void *)itemp, SRC_DIC); 1988 1988 */ 1989 dtq_start_timer(0, do_cmnd_callback, ( long)itemp);1989 dtq_start_timer(0, do_cmnd_callback, (dim_long)itemp); 1990 1990 /* 1991 1991 (servp->user_routine)( &servp->tag, &ret ); -
trunk/FACT++/dim/src/diccpp.cxx
r13995 r14575 20 20 if(DimClient::getNoDataCopy() == 0) 21 21 { 22 if(!t->itsDataSize) 23 { 24 t->itsData = new char[*size]; 25 t->itsDataSize = *size; 26 } 27 else if(t->itsDataSize < *size) 28 { 29 delete[] (char *)(t->itsData); 30 t->itsData = new char[*size]; 31 t->itsDataSize = *size; 32 } 33 memcpy(t->itsData, buf, *size); 22 if(*size > 0) 23 { 24 if(!t->itsDataSize) 25 { 26 t->itsData = new char[*size]; 27 t->itsDataSize = *size; 28 } 29 else if(t->itsDataSize < *size) 30 { 31 delete[] (char *)(t->itsData); 32 t->itsData = new char[*size]; 33 t->itsDataSize = *size; 34 } 35 memcpy(t->itsData, buf, *size); 36 } 37 else if (*size == 0) 38 { 39 if(t->itsDataSize) 40 { 41 delete[] (char *)(t->itsData); 42 t->itsDataSize = 0; 43 } 44 t->itsData = buf; 45 } 34 46 } 35 47 else … … 83 95 itsId = dic_info_service(itsName,itsType,itsTime, 0, 0, 84 96 // user_routine, itsTagId, 85 user_routine, ( long)this,97 user_routine, (dim_long)this, 86 98 itsNolinkBuf, itsNolinkSize); 87 99 ENABLE_AST … … 134 146 itsId = dic_info_service(itsName,itsType,itsTime, 0, 0, 135 147 // user_routine, itsTagId, 136 user_routine, ( long)this,148 user_routine, (dim_long)this, 137 149 itsNolinkBuf, itsNolinkSize); 138 150 } … … 218 230 itsId = dic_info_service_stamped(itsName,itsType,itsTime, 0, 0, 219 231 // user_routine, itsTagId, 220 user_routine, ( long)this,232 user_routine, (dim_long)this, 221 233 itsNolinkBuf, itsNolinkSize); 222 234 ENABLE_AST … … 276 288 itsId = dic_info_service_stamped(itsName,itsType,itsTime, 0, 0, 277 289 // user_routine, itsTagId, 278 user_routine, ( long)this,290 user_routine, (dim_long)this, 279 291 itsNolinkBuf, itsNolinkSize); 280 292 ENABLE_AST … … 332 344 // t = (DimCurrentInfo *)id_get_ptr(id, SRC_DIC); 333 345 t = * (DimCurrentInfo **)tagp; 334 if(!t->itsDataSize) 335 { 336 t->itsData = new char[*size]; 337 t->itsDataSize = *size; 338 } 339 else if(t->itsDataSize < *size) 340 { 341 delete[] (char *)(t->itsData); 342 t->itsData = new char[*size]; 343 t->itsDataSize = *size; 344 } 345 memcpy(t->itsData, buf, *size); 346 if(*size > 0) 347 { 348 if(!t->itsDataSize) 349 { 350 t->itsData = new char[*size]; 351 t->itsDataSize = *size; 352 } 353 else if(t->itsDataSize < *size) 354 { 355 delete[] (char *)(t->itsData); 356 t->itsData = new char[*size]; 357 t->itsDataSize = *size; 358 } 359 memcpy(t->itsData, buf, *size); 360 } 361 else if (*size == 0) 362 { 363 if(t->itsDataSize) 364 { 365 delete[] (char *)(t->itsData); 366 t->itsDataSize = 0; 367 } 368 t->itsData = buf; 369 } 346 370 t->itsSize = *size; 347 371 t->wakeUp = 1; … … 390 414 dic_info_service(itsName,ONCE_ONLY,timeout, 0, 0, 391 415 // data_user_routine, itsTagId, 392 data_user_routine, ( long)this,416 data_user_routine, (dim_long)this, 393 417 itsNolinkBuf, itsNolinkSize); 394 418 } … … 464 488 dic_cmnd_callback(name, data, datasize, 465 489 // cmnd_done, id); 466 cmnd_done, ( long)this);490 cmnd_done, (dim_long)this); 467 491 while(!wakeUp) 468 492 { … … 503 527 if(DimClient::getNoDataCopy() == 0) 504 528 { 505 if(!t->itsDataSize) 506 { 507 t->itsData = new char[size]; 508 t->itsDataSize = size; 509 } 510 else if(t->itsDataSize < size) 511 { 512 delete[] (char *)(t->itsData); 513 t->itsData = new char[size]; 514 t->itsDataSize = size; 529 if(size > 0) 530 { 531 if(!t->itsDataSize) 532 { 533 t->itsData = new char[size]; 534 t->itsDataSize = size; 535 } 536 else if(t->itsDataSize < size) 537 { 538 delete[] (char *)(t->itsData); 539 t->itsData = new char[size]; 540 t->itsDataSize = size; 541 } 542 } 543 else if (size == 0) 544 { 545 if(t->itsDataSize) 546 { 547 delete[] (char *)(t->itsData); 548 t->itsDataSize = 0; 549 } 515 550 } 516 551 } … … 525 560 //printf("DIM RPC: Stopped Timer, Data Received for %s\n", t->getName()); 526 561 if(DimClient::getNoDataCopy() == 0) 527 memcpy(t->itsData, buf, size); 562 { 563 if(size > 0) 564 memcpy(t->itsData, buf, size); 565 else 566 t->itsData = buf; 567 } 528 568 else 529 569 t->itsData = buf; … … 557 597 if(DimClient::getNoDataCopy() == 0) 558 598 { 559 if(!itsDataSize) 560 { 561 itsData = new char[size]; 562 itsDataSize = size; 563 } 564 else if(itsDataSize < size) 565 { 566 delete[] (char *)(itsData); 567 itsData = new char[size]; 568 itsDataSize = size; 599 if(size > 0) 600 { 601 if(!itsDataSize) 602 { 603 itsData = new char[size]; 604 itsDataSize = size; 605 } 606 else if(itsDataSize < size) 607 { 608 delete[] (char *)(itsData); 609 itsData = new char[size]; 610 itsDataSize = size; 611 } 612 } 613 else if (size == 0) 614 { 615 if(itsDataSize) 616 { 617 delete[] (char *)(itsData); 618 itsDataSize = 0; 619 } 569 620 } 570 621 } … … 572 623 { 573 624 if(DimClient::getNoDataCopy() == 0) 574 memcpy(itsData, buf, size); 625 { 626 if(size > 0) 627 memcpy(itsData, buf, size); 628 else 629 itsData = buf; 630 } 575 631 else 576 632 itsData = buf; … … 653 709 0, 0, 654 710 // rpc_user_routine, itsTagId, 655 rpc_user_routine, ( long)itsHandler,711 rpc_user_routine, (dim_long)itsHandler, 656 712 itsNolinkBuf, itsNolinkSize); 657 713 // dim_usleep(200000); … … 704 760 //printf("DIM RPC: Stopped Timer, Command failed for %s\n", itsName); 705 761 // rpc_user_routine((int *)&itsTagId, itsNolinkBuf, &itsNolinkSize); 706 rpc_user_routine(( long *)&itsHandler, itsNolinkBuf, &itsNolinkSize);762 rpc_user_routine((dim_long *)&itsHandler, itsNolinkBuf, &itsNolinkSize); 707 763 } 708 764 /* -
trunk/FACT++/dim/src/dim_jni.c
r11071 r14575 417 417 int doit; 418 418 419 DBGe(dim_Dbg_SEND_CALLBACK) printf("DimJNI: client SEND_CALLBACK status %08lx:%d\n", ( unsignedlong)_status, *_status);419 DBGe(dim_Dbg_SEND_CALLBACK) printf("DimJNI: client SEND_CALLBACK status %08lx:%d\n", (dim_long)_status, *_status); 420 420 421 421 doit = dim_jni_attachThread(&env); … … 443 443 jobject theSendSynchronizer; 444 444 445 extern int request_command(char *, void *, int , void (*)(), long, int);445 extern int request_command(char *, void *, int , void (*)(), dim_long, int); 446 446 447 447 const char* cmnd = (*env)->GetStringUTFChars(env, name, 0); … … 471 471 472 472 // Send the request 473 ret = request_command((char *)cmnd, data_address, data_size, callback_funct, ( long)callback_param, stamped);473 ret = request_command((char *)cmnd, data_address, data_size, callback_funct, (dim_long)callback_param, stamped); 474 474 DBGx(dim_Dbg_SEND_NATIVE) printf("DimJNI: Client.Send(%s,(%s) 0x%x) returns %d \n", cmnd, send_data_format, * (int*) data_address, ret); 475 475 … … 868 868 void info_service_callback(jobject* _theDataDecoder, void* dataAddress, int* _dataSize) 869 869 { 870 DBGe(dim_Dbg_INFO_CALLBACK) printf("DimJNI: INFO_CALLBACK(data: %08lx(%08x))\n", ( unsignedlong) dataAddress, *_dataSize);870 DBGe(dim_Dbg_INFO_CALLBACK) printf("DimJNI: INFO_CALLBACK(data: %08lx(%08x))\n", (dim_long) dataAddress, *_dataSize); 871 871 872 872 decodeData(_theDataDecoder, dataAddress, _dataSize, 0); … … 877 877 void info_service_callback_with_cleanup(jobject* _theDataDecoder, void* dataAddress, int* _dataSize) 878 878 { 879 DBGe(dim_Dbg_INFO_CALLBACK) printf("DimJNI: INFO_CALLBACK/ONCE_ONLY(data: %08lx(%08x))\n", ( unsignedlong)dataAddress, *_dataSize);879 DBGe(dim_Dbg_INFO_CALLBACK) printf("DimJNI: INFO_CALLBACK/ONCE_ONLY(data: %08lx(%08x))\n", (dim_long)dataAddress, *_dataSize); 880 880 881 881 decodeData(_theDataDecoder, dataAddress, _dataSize, 1); … … 986 986 const char* info = (*env)->GetStringUTFChars(env, name, 0); 987 987 extern unsigned request_service(char *, int, int , void *, int , void (*)(), 988 long, void *, int, int);988 dim_long, void *, int, int); 989 989 990 990 // DBGe(dim_Dbg_INFO_SERVICE); /* trap only, we report on exit */ … … 1009 1009 1010 1010 1011 ret = request_service((char *)info, service_type, timeout, 0, 0, callback_function, ( long)callback_param, &no_link, 0, stamped);1012 DBGx(dim_Dbg_INFO_SERVICE) printf("DimJNI: client infoService(%s, DataDecoder@0x%08lx, mode=%d, timeout=%d ) returns %d\n", info, ( unsignedlong)theNativeDataDecoder, mode, timeout, ret);1011 ret = request_service((char *)info, service_type, timeout, 0, 0, callback_function, (dim_long)callback_param, &no_link, 0, stamped); 1012 DBGx(dim_Dbg_INFO_SERVICE) printf("DimJNI: client infoService(%s, DataDecoder@0x%08lx, mode=%d, timeout=%d ) returns %d\n", info, (dim_long)theNativeDataDecoder, mode, timeout, ret); 1013 1013 (*env)->ReleaseStringUTFChars(env, name, info); 1014 1014 … … 1062 1062 1063 1063 //printf("Stopping timer %08x %08X\n", callback_param, aDimTimer); 1064 ret = dtq_stop_timer(( long)callback_param);1064 ret = dtq_stop_timer((dim_long)callback_param); 1065 1065 //printf("ret = %d\n", ret); 1066 1066 … … 1263 1263 // printf("data address = %x, data size = %d\n",*address, *size); 1264 1264 } 1265 DBGx(dim_Dbg_SERVICE_CALLBACK) printf("DimJNI: server_SERVICE_CALLBACK(dataEncoder=%08lx)\n ==> data: %08lx size %08x\n", ( unsigned long)dataEncoder, (unsignedlong) *address, *size);1265 DBGx(dim_Dbg_SERVICE_CALLBACK) printf("DimJNI: server_SERVICE_CALLBACK(dataEncoder=%08lx)\n ==> data: %08lx size %08x\n", (dim_long)dataEncoder, (dim_long) *address, *size); 1266 1266 1267 1267 if ((*env)->ExceptionOccurred(env)) (*env)->ExceptionDescribe(env); // clear any possible exception, if we do not do this, all further methods will fail!! … … 1409 1409 sid = dis_add_service(serviceNameUTF, serviceTypeUTF, 0, 0, server_getInfo_callback, dataEncoder); 1410 1410 1411 DBGx(dim_Dbg_ADD_SERVICE) printf("DimJNI: Server.addService(%s,%s, @%08lx)=%d\n",serviceNameUTF, serviceTypeUTF, ( unsignedlong)dataEncoder, sid);1411 DBGx(dim_Dbg_ADD_SERVICE) printf("DimJNI: Server.addService(%s,%s, @%08lx)=%d\n",serviceNameUTF, serviceTypeUTF, (dim_long)dataEncoder, sid); 1412 1412 1413 1413 (*env)->ReleaseStringUTFChars(env, serviceName, serviceNameUTF); … … 1420 1420 { 1421 1421 1422 DBGe(dim_Dbg_CMND_CALLBACK) printf("DimJNI: server CMND_CALLBACK(data: %08lx(%08x))\n", ( unsignedlong) dataAddress, *_dataSize);1422 DBGe(dim_Dbg_CMND_CALLBACK) printf("DimJNI: server CMND_CALLBACK(data: %08lx(%08x))\n", (dim_long) dataAddress, *_dataSize); 1423 1423 1424 1424 decodeData(_theDataDecoder, dataAddress, _dataSize, 0); … … 1443 1443 sid = dis_add_cmnd(serviceNameUTF, serviceTypeUTF, server_cmnd_callback, dataDecoder); 1444 1444 1445 DBGx(dim_Dbg_ADD_CMND) printf("DimJNI: Server.addCmnd(%s,%s, @%08lx) = %d\n",serviceNameUTF, serviceTypeUTF, ( unsignedlong) dataDecoder, sid);1445 DBGx(dim_Dbg_ADD_CMND) printf("DimJNI: Server.addCmnd(%s,%s, @%08lx) = %d\n",serviceNameUTF, serviceTypeUTF, (dim_long) dataDecoder, sid); 1446 1446 1447 1447 (*env)->ReleaseStringUTFChars(env, serviceName, serviceNameUTF); … … 2396 2396 descriptor->maxEntries = maxEntries; 2397 2397 2398 DBGx(dim_Dbg_DESCRIPTORS) printf("DimJNI: Native.newObjectDescriptor %08lx\n", ( long)descriptor);2399 return ( long) descriptor;2398 DBGx(dim_Dbg_DESCRIPTORS) printf("DimJNI: Native.newObjectDescriptor %08lx\n", (dim_long)descriptor); 2399 return (dim_long) descriptor; 2400 2400 } 2401 2401 … … 2432 2432 // TODO throw an error if there is no such FieldID 2433 2433 2434 DBGe(dim_Dbg_DESCRIPTORS) printf("DimJNI: Native.addFieldToObjectDescriptor %08lx Field %s Type %s\n", ( long) desc, name, type);2434 DBGe(dim_Dbg_DESCRIPTORS) printf("DimJNI: Native.addFieldToObjectDescriptor %08lx Field %s Type %s\n", (dim_long) desc, name, type); 2435 2435 // TODO: if(entry==NULL) throw out-of-memory exception, set length to 0 2436 2436 … … 2530 2530 2531 2531 if(nativeClass){} 2532 DBGe(dim_Dbg_DESCRIPTORS) printf("DimJNI: Native.deleteObjectDescriptor %08lx\n", ( long)desc);2532 DBGe(dim_Dbg_DESCRIPTORS) printf("DimJNI: Native.deleteObjectDescriptor %08lx\n", (dim_long)desc); 2533 2533 (*env)->DeleteGlobalRef(env, descriptor->objectClass); 2534 2534 //printf("free descriptor\n"); … … 2554 2554 jclass objectClass = descriptor->objectClass; 2555 2555 2556 DBGe(dim_Dbg_DESCRIPTORS) printf("DimJNI: Native.copyIntoObject %08lx\n", ( long)desc);2556 DBGe(dim_Dbg_DESCRIPTORS) printf("DimJNI: Native.copyIntoObject %08lx\n", (dim_long)desc); 2557 2557 2558 2558 if(nativeClass){} -
trunk/FACT++/dim/src/dim_thr.c
r13135 r14575 225 225 } 226 226 227 long dim_start_thread(void *(*thread_ast)(void *),long tag)227 dim_long dim_start_thread(void *(*thread_ast)(void *), dim_long tag) 228 228 { 229 229 pthread_t t_id; … … 237 237 pthread_create(&t_id, &attr, thread_ast, (void *)tag); 238 238 #endif 239 return(( long)t_id);239 return((dim_long)t_id); 240 240 } 241 241 242 int dim_stop_thread( long t_id)242 int dim_stop_thread(dim_long t_id) 243 243 { 244 244 int ret; … … 533 533 } 534 534 535 long dim_start_thread(void (*thread_ast)(),long tag)535 dim_long dim_start_thread(void (*thread_ast)(), dim_long tag) 536 536 537 537 { 538 538 printf("dim_start_thread: not available\n"); 539 return ( long)0;540 } 541 542 int dim_stop_thread( long t_id)539 return (dim_long)0; 540 } 541 542 int dim_stop_thread(dim_long t_id) 543 543 { 544 544 printf("dim_stop_thread: not available\n"); … … 563 563 typedef struct{ 564 564 void (*thread_ast)(); 565 long tag;565 dim_long tag; 566 566 567 567 }THREAD_PARAMS; 568 568 569 569 #ifndef STDCALL 570 long dim_start_thread(void (*thread_ast)(),long tag)571 #else 572 long dim_start_thread(unsignedlong (*thread_ast)(void *), void *tag)570 dim_long dim_start_thread(void (*thread_ast)(), dim_long tag) 571 #else 572 dim_long dim_start_thread(dim_long (*thread_ast)(void *), void *tag) 573 573 #endif 574 574 { … … 593 593 &threadid); /* returns the thread identifier */ 594 594 #endif 595 return ( long)hthread;596 } 597 598 599 int dim_stop_thread( long thread_id)595 return (dim_long)hthread; 596 } 597 598 599 int dim_stop_thread(dim_long thread_id) 600 600 { 601 601 int ret; -
trunk/FACT++/dim/src/dis.c
r14286 r14575 37 37 struct dis_dns_ent *next; 38 38 struct dis_dns_ent *prev; 39 long dnsid;39 dim_long dnsid; 40 40 char task_name[MAX_NAME]; 41 41 TIMR_ENT *dns_timr_ent; … … 78 78 int size; 79 79 void (*user_routine)(); 80 long tag;80 dim_long tag; 81 81 int registered; 82 82 int quality; … … 163 163 _DIM_PROTO( void register_dns_services, (int flag) ); 164 164 _DIM_PROTO( void register_services, (DIS_DNS_CONN *dnsp, int flag, int dns_flag) ); 165 _DIM_PROTO( void std_cmnd_handler, ( long *tag, int *cmnd_buff, int *size) );166 _DIM_PROTO( void client_info, ( long *tag, int **bufp, int *size) );167 _DIM_PROTO( void service_info, ( long *tag, int **bufp, int *size) );165 _DIM_PROTO( void std_cmnd_handler, (dim_long *tag, int *cmnd_buff, int *size) ); 166 _DIM_PROTO( void client_info, (dim_long *tag, int **bufp, int *size) ); 167 _DIM_PROTO( void service_info, (dim_long *tag, int **bufp, int *size) ); 168 168 _DIM_PROTO( void add_exit_handler, (int *tag, int *bufp, int *size) ); 169 169 _DIM_PROTO( static void exit_handler, (int *tag, int *bufp, int *size) ); … … 176 176 _DIM_PROTO( SERVICE *dis_hash_service_get_next, (int *start, SERVICE *prev, int flag) ); 177 177 _DIM_PROTO( static unsigned do_dis_add_service_dns, (char *name, char *type, void *address, int size, 178 void (*user_routine)(), long tag,long dnsid ) );179 _DIM_PROTO( static DIS_DNS_CONN *create_dns, ( long dnsid) );178 void (*user_routine)(), dim_long tag, dim_long dnsid ) ); 179 _DIM_PROTO( static DIS_DNS_CONN *create_dns, (dim_long dnsid) ); 180 180 181 181 void dis_set_debug_on() … … 232 232 233 233 static unsigned do_dis_add_service_dns( char *name, char *type, void *address, int size, 234 void (*user_routine)(), long tag,long dnsid )234 void (*user_routine)(), dim_long tag, dim_long dnsid ) 235 235 { 236 236 register SERVICE *new_serv; … … 239 239 int dis_hash_service_insert(); 240 240 DIS_DNS_CONN *dnsp; 241 extern DIS_DNS_CONN *dis_find_dns( long);241 extern DIS_DNS_CONN *dis_find_dns(dim_long); 242 242 243 243 dis_init(); … … 324 324 325 325 static unsigned do_dis_add_service( char *name, char *type, void *address, int size, 326 void (*user_routine)(), long tag )326 void (*user_routine)(), dim_long tag ) 327 327 { 328 328 return do_dis_add_service_dns( name, type, address, size, … … 369 369 370 370 unsigned dis_add_service( char *name, char *type, void *address, int size, 371 void (*user_routine)(), long tag)371 void (*user_routine)(), dim_long tag) 372 372 { 373 373 unsigned ret; … … 389 389 } 390 390 391 unsigned dis_add_service_dns( long dnsid, char *name, char *type, void *address, int size,392 void (*user_routine)(), long tag)391 unsigned dis_add_service_dns( dim_long dnsid, char *name, char *type, void *address, int size, 392 void (*user_routine)(), dim_long tag) 393 393 { 394 394 unsigned ret; … … 410 410 } 411 411 412 static unsigned do_dis_add_cmnd_dns( char *name, char *type, void (*user_routine)(), long tag,long dnsid )412 static unsigned do_dis_add_cmnd_dns( char *name, char *type, void (*user_routine)(), dim_long tag, dim_long dnsid ) 413 413 { 414 414 register SERVICE *new_serv; … … 417 417 int dis_hash_service_insert(); 418 418 DIS_DNS_CONN *dnsp; 419 extern DIS_DNS_CONN *dis_find_dns( long);419 extern DIS_DNS_CONN *dis_find_dns(dim_long); 420 420 421 421 dis_init(); … … 488 488 } 489 489 490 static unsigned do_dis_add_cmnd( char *name, char *type, void (*user_routine)(), long tag)490 static unsigned do_dis_add_cmnd( char *name, char *type, void (*user_routine)(), dim_long tag) 491 491 { 492 492 return do_dis_add_cmnd_dns(name, type, user_routine, tag, 0); 493 493 } 494 494 495 unsigned dis_add_cmnd( char *name, char *type, void (*user_routine)(), long tag )495 unsigned dis_add_cmnd( char *name, char *type, void (*user_routine)(), dim_long tag ) 496 496 { 497 497 unsigned ret; … … 507 507 } 508 508 509 unsigned dis_add_cmnd_dns( long dnsid, char *name, char *type, void (*user_routine)(),long tag )509 unsigned dis_add_cmnd_dns( dim_long dnsid, char *name, char *type, void (*user_routine)(), dim_long tag ) 510 510 { 511 511 unsigned ret; … … 643 643 int dns_timr_time; 644 644 extern int rand_tmout(int, int); 645 extern int open_dns( long, void (*)(), void (*)(), int, int, int);645 extern int open_dns(dim_long, void (*)(), void (*)(), int, int, int); 646 646 extern DIS_DNS_CONN *find_dns_by_conn_id(int); 647 647 extern void do_register_services(DIS_DNS_CONN *); … … 1044 1044 } 1045 1045 1046 static DIS_DNS_CONN *create_dns( long dnsid)1046 static DIS_DNS_CONN *create_dns(dim_long dnsid) 1047 1047 { 1048 1048 DIS_DNS_CONN *dnsp; … … 1090 1090 } 1091 1091 1092 int dis_start_serving_dns( long dnsid, char *task/*, int *idlist*/)1092 int dis_start_serving_dns(dim_long dnsid, char *task/*, int *idlist*/) 1093 1093 { 1094 1094 char str0[MAX_NAME], str1[MAX_NAME],str2[MAX_NAME], … … 1096 1096 char task_name_aux[MAX_TASK_NAME]; 1097 1097 extern int open_dns(); 1098 extern DIS_DNS_CONN *dis_find_dns( long);1098 extern DIS_DNS_CONN *dis_find_dns(dim_long); 1099 1099 DIS_DNS_CONN *dnsp; 1100 1100 int more_ids[10] = {0}; … … 1161 1161 sizeof(Version_number), 0, 0, dnsid ); 1162 1162 1163 more_ids[1] = do_dis_add_service_dns( str1, "C", 0, 0, client_info, ( long)dnsp, dnsid );1163 more_ids[1] = do_dis_add_service_dns( str1, "C", 0, 0, client_info, (dim_long)dnsp, dnsid ); 1164 1164 dnsp->dis_client_id = more_ids[1]; 1165 more_ids[2] = do_dis_add_service_dns( str2, "C", 0, 0, service_info, ( long)dnsp, dnsid );1165 more_ids[2] = do_dis_add_service_dns( str2, "C", 0, 0, service_info, (dim_long)dnsp, dnsid ); 1166 1166 dnsp->dis_service_id = more_ids[2]; 1167 1167 more_ids[3] = do_dis_add_cmnd_dns( str3, "L:1", add_exit_handler, 0, dnsid ); … … 1757 1757 dim_print_date_time(); 1758 1758 printf("Updating %s (id = %d, ptr = %08lX) for %s@%s (req_id = %d, req_ptr = %08lX)\n", 1759 servp->name, (int)service_id, (unsigned long)servp,1760 Net_conns[reqp->conn_id].task, Net_conns[reqp->conn_id].node, reqp->req_id, (unsigned long)reqp);1759 servp->name, (int)service_id, (unsigned dim_long)servp, 1760 Net_conns[reqp->conn_id].task, Net_conns[reqp->conn_id].node, reqp->req_id, (unsigned dim_long)reqp); 1761 1761 } 1762 1762 */ … … 2225 2225 int dis_no_dns(); 2226 2226 int hash_index, old_index; 2227 extern int close_dns( long, int);2227 extern int close_dns(dim_long, int); 2228 2228 CLIENT *clip, *cprevp; 2229 2229 … … 2332 2332 } 2333 2333 2334 void dis_stop_serving_dns( long dnsid)2334 void dis_stop_serving_dns(dim_long dnsid) 2335 2335 { 2336 2336 DIS_DNS_CONN *dnsp, *dis_find_dns(); … … 2726 2726 typedef struct cmnds{ 2727 2727 struct cmnds *next; 2728 long tag;2728 dim_long tag; 2729 2729 int size; 2730 2730 int buffer[1]; … … 2733 2733 static DIS_CMND *Cmnds_head = (DIS_CMND *)0; 2734 2734 2735 void std_cmnd_handler( long *tag, int *cmnd_buff, int *size)2735 void std_cmnd_handler(dim_long *tag, int *cmnd_buff, int *size) 2736 2736 { 2737 2737 register DIS_CMND *new_cmnd; … … 2751 2751 } 2752 2752 2753 int dis_get_next_cmnd( long *tag, int *buffer, int *size)2753 int dis_get_next_cmnd(dim_long *tag, int *buffer, int *size) 2754 2754 { 2755 2755 register DIS_CMND *cmndp; … … 2829 2829 #endif 2830 2830 2831 void client_info( long *tag, int **bufp, int *size, int *first_time)2831 void client_info(dim_long *tag, int **bufp, int *size, int *first_time) 2832 2832 { 2833 2833 register CLIENT *clip; … … 2953 2953 } 2954 2954 2955 void service_info( long *tag, int **bufp, int *size, int *first_time)2955 void service_info(dim_long *tag, int **bufp, int *size, int *first_time) 2956 2956 { 2957 2957 register SERVICE *servp; … … 3334 3334 } 3335 3335 3336 DIS_DNS_CONN *dis_find_dns( long dnsid)3336 DIS_DNS_CONN *dis_find_dns(dim_long dnsid) 3337 3337 { 3338 3338 DIS_DNS_CONN *dnsp; … … 3369 3369 { 3370 3370 DIS_DNS_CONN *dnsp; 3371 extern long dns_get_dnsid();3372 long dnsid;3371 extern dim_long dns_get_dnsid(); 3372 dim_long dnsid; 3373 3373 3374 3374 dnsid = dns_get_dnsid(conn_id, SRC_DIS); -
trunk/FACT++/dim/src/discpp.cxx
r13135 r14575 61 61 itsId = dis_add_service( name, format, NULL, 0, 62 62 // user_routine, itsTagId); 63 user_routine, ( long)this);63 user_routine, (dim_long)this); 64 64 DimServer::start(); 65 65 } … … 68 68 itsId = dis_add_service_dns( itsDns->getDnsId(), name, format, NULL, 0, 69 69 // user_routine, itsTagId); 70 user_routine, ( long)this);70 user_routine, (dim_long)this); 71 71 // itsDns->addServiceId(itsId); 72 72 DimServer::start(itsDns); … … 139 139 itsId = dis_add_cmnd( name, format, command_routine, 140 140 // itsTagId); 141 ( long)this);141 (dim_long)this); 142 142 DimServer::start(); 143 143 } … … 146 146 itsId = dis_add_cmnd_dns( itsDns->getDnsId(), name, format, command_routine, 147 147 // itsTagId); 148 ( long)this);148 (dim_long)this); 149 149 // itsDns->addServiceId(itsId); 150 150 DimServer::start(itsDns); … … 248 248 itsIdIn = dis_add_cmnd( itsNameIn, formatin, 249 249 // rpcin_routine, itsTagId); 250 rpcin_routine, ( long)this);250 rpcin_routine, (dim_long)this); 251 251 itsIdOut = dis_add_service( itsNameOut, formatout, 0,0, 252 252 // rpcout_routine, itsTagId); 253 rpcout_routine, ( long)this);253 rpcout_routine, (dim_long)this); 254 254 DimServer::start(); 255 255 } … … 258 258 itsIdIn = dis_add_cmnd_dns( itsDns->getDnsId(), itsNameIn, formatin, 259 259 // rpcin_routine, itsTagId); 260 rpcin_routine, ( long)this);260 rpcin_routine, (dim_long)this); 261 261 itsIdOut = dis_add_service_dns( itsDns->getDnsId(), itsNameOut, formatout, 0,0, 262 262 // rpcout_routine, itsTagId); 263 rpcout_routine, ( long)this);263 rpcout_routine, (dim_long)this); 264 264 // itsDns->addServiceId(itsIdIn); 265 265 // itsDns->addServiceId(itsIdOut); … … 369 369 } 370 370 371 long DimServerDns::getDnsId()371 dim_long DimServerDns::getDnsId() 372 372 { 373 373 return itsDnsId; … … 445 445 void DimServer::start(DimServerDns *dns, const char *name) 446 446 { 447 long dnsid;447 dim_long dnsid; 448 448 449 449 DISABLE_AST … … 487 487 void DimServer::start(DimServerDns *dns) 488 488 { 489 long dnsid;489 dim_long dnsid; 490 490 char *name; 491 491 int isAuto; … … 669 669 } 670 670 671 long DimServer::addDns(const char *node, int port)671 dim_long DimServer::addDns(const char *node, int port) 672 672 { 673 673 return dis_add_dns((char *)node, port); -
trunk/FACT++/dim/src/dtq.c
r13135 r14575 389 389 } 390 390 391 TIMR_ENT *dtq_add_entry(int queue_id, int time, void (*user_routine)(), long tag)391 TIMR_ENT *dtq_add_entry(int queue_id, int time, void (*user_routine)(), dim_long tag) 392 392 { 393 393 TIMR_ENT *new_entry, *queue_head, *auxp, *prevp; … … 780 780 } 781 781 782 void dtq_start_timer(int time, void (*user_routine)(), long tag)782 void dtq_start_timer(int time, void (*user_routine)(), dim_long tag) 783 783 { 784 784 extern void dim_init_threads(); … … 796 796 797 797 798 int dtq_stop_timer( long tag)798 int dtq_stop_timer(dim_long tag) 799 799 { 800 800 TIMR_ENT *entry, *queue_head; … … 816 816 static int Dtq_sleeping = 0; 817 817 818 void dtq_sleep_rout( long tag)818 void dtq_sleep_rout(dim_long tag) 819 819 { 820 820 if(tag){} -
trunk/FACT++/dim/src/examples/rpc_client.cxx
r11071 r14575 41 41 int out, in; 42 42 43 sprintf(name,"TESTRPC%d/INT",( long)tag);43 sprintf(name,"TESTRPC%d/INT",(dim_long)tag); 44 44 myRpc = new DimRpcInfo(name, 10, -1); 45 45 // myRpc = new Rpc(name); … … 54 54 dim_lock(); 55 55 dim_print_date_time(); 56 cout << "Instance "<<( long)tag<<" sent "<<out<< " got "<<in <<endl;56 cout << "Instance "<<(dim_long)tag<<" sent "<<out<< " got "<<in <<endl; 57 57 dim_unlock(); 58 58 out++; -
trunk/FACT++/dim/src/examples/test_client.c
r13339 r14575 57 57 { 58 58 if(tag){} 59 printf("Received VERSION %lx, %d\n", ( long)buf, *size);59 printf("Received VERSION %lx, %d\n", (dim_long)buf, *size); 60 60 } 61 61 -
trunk/FACT++/dim/src/examples/test_server.c
r13135 r14575 70 70 int on = 0; 71 71 */ 72 long dnsid = 0;72 dim_long dnsid = 0; 73 73 char extra_dns[128]; 74 74 int new_dns = 0; -
trunk/FACT++/dim/src/open_dns.c
r14403 r14575 173 173 char node[MAX_DNS_NODE]; 174 174 int port; 175 long sid, cid;175 dim_long sid, cid; 176 176 177 177 DISABLE_AST … … 235 235 } 236 236 237 long dis_add_dns(char *node_name, int port_number)237 dim_long dis_add_dns(char *node_name, int port_number) 238 238 { 239 239 DNS_CONN *connp; … … 253 253 dll_insert_queue( (DLL *) DNS_conn_head, (DLL *) connp ); 254 254 } 255 return ( long)connp;256 } 257 258 long dic_add_dns(char *node_name, int port_number)255 return (dim_long)connp; 256 } 257 258 dim_long dic_add_dns(char *node_name, int port_number) 259 259 { 260 260 DNS_CONN *connp; … … 274 274 dll_insert_queue( (DLL *) DNS_conn_head, (DLL *) connp ); 275 275 } 276 return ( long)connp;276 return (dim_long)connp; 277 277 } 278 278 … … 296 296 } 297 297 298 int close_dns( long dnsid, SRC_TYPES src_type)298 int close_dns(dim_long dnsid, SRC_TYPES src_type) 299 299 { 300 300 DNS_CONN *connp; … … 311 311 } 312 312 313 int open_dns( long dnsid, void (*recv_rout)(), void (*error_rout)(), int tmout_min, int tmout_max, SRC_TYPES src_type )313 int open_dns(dim_long dnsid, void (*recv_rout)(), void (*error_rout)(), int tmout_min, int tmout_max, SRC_TYPES src_type ) 314 314 { 315 315 char nodes[MAX_DNS_NODE]; … … 424 424 } 425 425 426 long dns_get_dnsid(int conn_id, SRC_TYPES src_type)426 dim_long dns_get_dnsid(int conn_id, SRC_TYPES src_type) 427 427 { 428 428 DNS_CONN *connp; … … 449 449 if(connp == DNS_ids[src_type]) 450 450 { 451 return ( long)0;451 return (dim_long)0; 452 452 } 453 453 else 454 454 { 455 return ( long)connp;456 } 457 } 458 return ( long)-1;459 } 455 return (dim_long)connp; 456 } 457 } 458 return (dim_long)-1; 459 }
Note:
See TracChangeset
for help on using the changeset viewer.