- Timestamp:
- Jul 2, 2003, 6:15:24 PM (21 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- 373b7e7
- Parents:
- 7c9c847
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zephyr.c
rb2a91b6 r09489b89 4 4 #include <sys/wait.h> 5 5 #include <string.h> 6 #include <zephyr/zephyr.h>7 6 #include <com_err.h> 8 7 #include "owl.h" … … 10 9 static const char fileIdent[] = "$Id$"; 11 10 11 #ifdef HAVE_LIBZEPHYR 12 12 Code_t ZResetAuthentication(); 13 #endif 13 14 14 15 int owl_zephyr_initialize() 15 16 { 17 #ifdef HAVE_LIBZEPHYR 16 18 int ret; 17 19 … … 24 26 return(1); 25 27 } 28 #endif 29 return(0); 30 } 31 32 33 int owl_zephyr_shutdown() 34 { 35 #ifdef HAVE_LIBZEPHYR 36 unsuball(); 37 ZClosePort(); 38 #endif 26 39 return(0); 27 40 } … … 33 46 #else 34 47 return(0); 48 #endif 49 } 50 51 char *owl_zephyr_get_realm() 52 { 53 #ifdef HAVE_LIBZEPHYR 54 return(ZGetRealm()); 55 #else 56 return(""); 57 #endif 58 } 59 60 char *owl_zephyr_get_sender() 61 { 62 #ifdef HAVE_LIBZEPHYR 63 return(ZGetSender()); 64 #else 65 return(""); 35 66 #endif 36 67 } … … 258 289 return(""); 259 290 } 291 #else 292 char *owl_zephyr_get_field(void *n, int j, int *k) 293 { 294 return(""); 295 } 260 296 #endif 261 297 … … 271 307 272 308 return(fields); 309 } 310 #else 311 int owl_zephyr_get_num_fields(void *n) 312 { 313 return(0); 273 314 } 274 315 #endif … … 298 339 *k=strlen(n->z_message); 299 340 return(n->z_message); 341 } 342 #else 343 char *owl_zephyr_get_zsig(void *n, int *k) 344 { 345 return(""); 300 346 } 301 347 #endif … … 396 442 } 397 443 } 444 #else 445 void owl_zephyr_handle_ack(void *retnotice) 446 { 447 } 398 448 #endif 399 449 … … 405 455 return(1); 406 456 } 457 return(0); 458 } 459 #else 460 int owl_zephyr_notice_is_ack(void *n) 461 { 407 462 return(0); 408 463 } … … 654 709 655 710 /* return auth string */ 711 #ifdef HAVE_LIBZEPHYR 656 712 char *owl_zephyr_get_authstr(ZNotice_t *n) 657 713 { … … 669 725 } 670 726 } 671 672 727 #else 728 char *owl_zephyr_get_authstr(void *n) 729 { 730 return(""); 731 } 732 #endif 733 734 735 /* returns a buffer of subscriptions or an error message. 736 * Caller must free the return. 737 */ 738 char *owl_zephyr_getsubs() 739 { 740 #ifdef HAVE_LIBZEPHYR 741 int ret, num, i, one; 742 ZSubscription_t sub; 743 char *out, *tmpbuff; 744 one=1; 745 746 ret=ZRetrieveSubscriptions(0, &num); 747 if (ret==ZERR_TOOMANYSUBS) { 748 out=owl_strdup("Zephyr: too many subscriptions\n"); 749 return(out); 750 } 751 752 out=owl_malloc(num*500); 753 tmpbuff=owl_malloc(num*500); 754 strcpy(out, ""); 755 for (i=0; i<num; i++) { 756 if ((ret = ZGetSubscriptions(&sub, &one)) != ZERR_NONE) { 757 owl_free(out); 758 owl_free(tmpbuff); 759 ZFlushSubscriptions(); 760 out=owl_strdup("Error while getting subscriptions\n"); 761 return(out); 762 } else { 763 sprintf(tmpbuff, "<%s,%s,%s>\n%s", sub.zsub_class, sub.zsub_classinst, sub.zsub_recipient, buff); 764 strcpy(out, tmpbuff); 765 } 766 } 767 768 owl_free(tmpbuff); 769 ZFlushSubscriptions(); 770 return(out); 771 #else 772 return(""); 773 #endif 774 } 775 776 char *owl_zephyr_get_variable(char *var) 777 { 778 #ifdef HAVE_LIBZEPHYR 779 return(ZGetVariable(var)); 780 #else 781 return(""); 782 #endif 783 } 784 785 void owl_zephyr_set_locationinfo(char *host, char *val) 786 { 787 #ifdef HAVE_LIBZEPHYR 788 ZInitLocationInfo(host, val); 789 #endif 790 } 791
Note: See TracChangeset
for help on using the changeset viewer.