- Timestamp:
- Jun 21, 2003, 1:54:20 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:
- 0c502e9
- Parents:
- 5639bf2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zephyr.c
r65ad073 rbe0a79f 12 12 Code_t ZResetAuthentication(); 13 13 14 int owl_zephyr_initialize() 15 { 16 int ret; 17 18 if ((ret = ZInitialize()) != ZERR_NONE) { 19 com_err("owl",ret,"while initializing"); 20 return(1); 21 } 22 if ((ret = ZOpenPort(NULL)) != ZERR_NONE) { 23 com_err("owl",ret,"while opening port"); 24 return(1); 25 } 26 return(0); 27 } 28 29 int owl_zephyr_zpending() 30 { 31 #ifdef HAVE_LIBZEPHYR 32 return(ZPending()); 33 #else 34 return(0); 35 #endif 36 } 37 14 38 int owl_zephyr_loadsubs(char *filename) 15 39 { 40 #ifdef HAVE_LIBZEPHYR 16 41 /* return 0 on success 17 42 * -1 on file error … … 83 108 84 109 return(ret); 110 #else 111 return(0); 112 #endif 85 113 } 86 114 87 115 int owl_zephyr_loadloginsubs(char *filename) 88 116 { 117 #ifdef HAVE_LIBZEPHYR 89 118 FILE *file; 90 119 ZSubscription_t subs[3001]; … … 139 168 140 169 return(ret); 170 #else 171 return(0); 172 #endif 141 173 } 142 174 143 175 void unsuball() 144 176 { 177 #if HAVE_LIBZEPHYR 145 178 int ret; 146 179 … … 150 183 com_err("owl",ret,"while unsubscribing"); 151 184 } 185 #endif 152 186 } 153 187 154 188 int owl_zephyr_sub(char *class, char *inst, char *recip) 155 189 { 190 #ifdef HAVE_LIBZEPHYR 156 191 ZSubscription_t subs[5]; 157 192 int ret; … … 167 202 } 168 203 return(0); 204 #else 205 return(0); 206 #endif 169 207 } 170 208 … … 172 210 int owl_zephyr_unsub(char *class, char *inst, char *recip) 173 211 { 212 #ifdef HAVE_LIBZEPHYR 174 213 ZSubscription_t subs[5]; 175 214 int ret; … … 185 224 } 186 225 return(0); 187 } 188 189 226 #else 227 return(0); 228 #endif 229 } 230 231 #ifdef HAVE_LIBZEPHYR 190 232 char *owl_zephyr_get_field(ZNotice_t *n, int j, int *k) 191 233 { … … 216 258 return(""); 217 259 } 218 219 260 #endif 261 262 #ifdef HAVE_LIBZEPHYR 220 263 int owl_zephyr_get_num_fields(ZNotice_t *n) 221 264 { … … 229 272 return(fields); 230 273 } 231 232 274 #endif 275 276 #ifdef HAVE_LIBZEPHYR 233 277 char *owl_zephyr_get_message(ZNotice_t *n, int *k) 234 278 { … … 241 285 return(owl_zephyr_get_field(n, 2, k)); 242 286 } 243 244 287 #endif 288 289 #ifdef HAVE_LIBZEPHYR 245 290 char *owl_zephyr_get_zsig(ZNotice_t *n, int *k) 246 291 { … … 254 299 return(n->z_message); 255 300 } 256 301 #endif 257 302 258 303 int send_zephyr(char *opcode, char *zsig, char *class, char *instance, char *recipient, char *message) 259 304 { 305 #ifdef HAVE_LIBZEPHYR 260 306 int ret; 261 307 ZNotice_t notice; … … 293 339 return(ret); 294 340 } 295 296 return(0); 297 } 298 341 return(0); 342 #else 343 return(0); 344 #endif 345 } 346 347 #ifdef HAVE_LIBZEPHYR 299 348 Code_t send_zephyr_helper(ZNotice_t *notice, char *buf, int len, int wait) 300 349 { 301 350 return(ZSendPacket(buf, len, 0)); 302 351 } 352 #endif 303 353 304 354 void send_ping(char *to) 305 355 { 356 #ifdef HAVE_LIBZEPHYR 306 357 send_zephyr("PING", "", "MESSAGE", "PERSONAL", to, ""); 307 } 308 358 #endif 359 } 360 361 #ifdef HAVE_LIBZEPHYR 309 362 void owl_zephyr_handle_ack(ZNotice_t *retnotice) 310 363 { … … 343 396 } 344 397 } 345 398 #endif 399 400 #ifdef HAVE_LIBZEPHYR 346 401 int owl_zephyr_notice_is_ack(ZNotice_t *n) 347 402 { … … 352 407 return(0); 353 408 } 409 #endif 354 410 355 411 void owl_zephyr_zaway(owl_message *m) 356 412 { 413 #ifdef HAVE_LIBZEPHYR 357 414 char *tmpbuff, *myuser, *to; 358 415 … … 392 449 owl_function_make_outgoing_zephyr(owl_global_get_zaway_msg(&g), tmpbuff, "Automated reply:"); 393 450 owl_free(tmpbuff); 394 } 395 396 451 #endif 452 } 453 454 #ifdef HAVE_LIBZEPHYR 397 455 void owl_zephyr_hackaway_cr(ZNotice_t *n) 398 456 { … … 406 464 } 407 465 } 466 #endif 408 467 409 468 void owl_zephyr_zlocate(char *user, char *out, int auth) 410 469 { 470 #ifdef HAVE_LIBZEPHYR 411 471 int ret, numlocs; 412 472 int one = 1; … … 434 494 owl_free(myuser); 435 495 } 496 #endif 436 497 } 437 498 438 499 void owl_zephyr_addsub(char *filename, char *class, char *inst, char *recip) 439 500 { 501 #ifdef HAVE_LIBZEPHYR 440 502 char *line, subsfile[LINE], buff[LINE]; 441 503 FILE *file; … … 477 539 478 540 owl_free(line); 541 #endif 479 542 } 480 543 481 544 void owl_zephyr_delsub(char *filename, char *class, char *inst, char *recip) 482 545 { 546 #ifdef HAVE_LIBZEPHYR 483 547 char *line, subsfile[LINE], buff[LINE], *text; 484 548 char backupfilename[LINE]; … … 544 608 545 609 owl_function_makemsg("Subscription removed"); 610 #endif 546 611 } 547 612 … … 559 624 void owl_zephyr_zlog_in(void) 560 625 { 626 #ifdef HAVE_LIBZEPHYR 561 627 char *exposure, *eset; 562 628 int ret; … … 590 656 */ 591 657 } 658 #endif 592 659 } 593 660 594 661 void owl_zephyr_zlog_out(void) 595 662 { 663 #ifdef HAVE_LIBZEPHYR 596 664 int ret; 597 665 … … 605 673 */ 606 674 } 675 #endif 607 676 } 608 677
Note: See TracChangeset
for help on using the changeset viewer.