Changeset be0a79f for zephyr.c


Ignore:
Timestamp:
Jun 21, 2003, 1:54:20 PM (21 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
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
Message:
Started work making owl build without zephyr.  Long way left to go though.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • zephyr.c

    r65ad073 rbe0a79f  
    1212Code_t ZResetAuthentication();
    1313
     14int 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
     29int owl_zephyr_zpending()
     30{
     31#ifdef HAVE_LIBZEPHYR
     32  return(ZPending());
     33#else
     34  return(0);
     35#endif
     36}
     37
    1438int owl_zephyr_loadsubs(char *filename)
    1539{
     40#ifdef HAVE_LIBZEPHYR
    1641  /* return 0  on success
    1742   *        -1 on file error
     
    83108
    84109  return(ret);
     110#else
     111  return(0);
     112#endif
    85113}
    86114
    87115int owl_zephyr_loadloginsubs(char *filename)
    88116{
     117#ifdef HAVE_LIBZEPHYR
    89118  FILE *file;
    90119  ZSubscription_t subs[3001];
     
    139168
    140169  return(ret);
     170#else
     171  return(0);
     172#endif
    141173}
    142174
    143175void unsuball()
    144176{
     177#if HAVE_LIBZEPHYR
    145178  int ret;
    146179
     
    150183    com_err("owl",ret,"while unsubscribing");
    151184  }
     185#endif
    152186}
    153187
    154188int owl_zephyr_sub(char *class, char *inst, char *recip)
    155189{
     190#ifdef HAVE_LIBZEPHYR
    156191  ZSubscription_t subs[5];
    157192  int ret;
     
    167202  }
    168203  return(0);
     204#else
     205  return(0);
     206#endif
    169207}
    170208
     
    172210int owl_zephyr_unsub(char *class, char *inst, char *recip)
    173211{
     212#ifdef HAVE_LIBZEPHYR
    174213  ZSubscription_t subs[5];
    175214  int ret;
     
    185224  }
    186225  return(0);
    187 }
    188 
    189 
     226#else
     227  return(0);
     228#endif
     229}
     230
     231#ifdef HAVE_LIBZEPHYR
    190232char *owl_zephyr_get_field(ZNotice_t *n, int j, int *k)
    191233{
     
    216258  return("");
    217259}
    218 
    219 
     260#endif
     261
     262#ifdef HAVE_LIBZEPHYR
    220263int owl_zephyr_get_num_fields(ZNotice_t *n)
    221264{
     
    229272  return(fields);
    230273}
    231 
    232 
     274#endif
     275
     276#ifdef HAVE_LIBZEPHYR
    233277char *owl_zephyr_get_message(ZNotice_t *n, int *k)
    234278{
     
    241285  return(owl_zephyr_get_field(n, 2, k));
    242286}
    243 
    244 
     287#endif
     288
     289#ifdef HAVE_LIBZEPHYR
    245290char *owl_zephyr_get_zsig(ZNotice_t *n, int *k)
    246291{
     
    254299  return(n->z_message);
    255300}
    256 
     301#endif
    257302
    258303int send_zephyr(char *opcode, char *zsig, char *class, char *instance, char *recipient, char *message)
    259304{
     305#ifdef HAVE_LIBZEPHYR
    260306  int ret;
    261307  ZNotice_t notice;
     
    293339    return(ret);
    294340  }
    295 
    296   return(0);
    297 }
    298 
     341  return(0);
     342#else
     343  return(0);
     344#endif
     345}
     346
     347#ifdef HAVE_LIBZEPHYR
    299348Code_t send_zephyr_helper(ZNotice_t *notice, char *buf, int len, int wait)
    300349{
    301350  return(ZSendPacket(buf, len, 0));
    302351}
     352#endif
    303353
    304354void send_ping(char *to)
    305355{
     356#ifdef HAVE_LIBZEPHYR
    306357  send_zephyr("PING", "", "MESSAGE", "PERSONAL", to, "");
    307 }
    308 
     358#endif
     359}
     360
     361#ifdef HAVE_LIBZEPHYR
    309362void owl_zephyr_handle_ack(ZNotice_t *retnotice)
    310363{
     
    343396  }
    344397}
    345 
     398#endif
     399
     400#ifdef HAVE_LIBZEPHYR
    346401int owl_zephyr_notice_is_ack(ZNotice_t *n)
    347402{
     
    352407  return(0);
    353408}
     409#endif
    354410 
    355411void owl_zephyr_zaway(owl_message *m)
    356412{
     413#ifdef HAVE_LIBZEPHYR
    357414  char *tmpbuff, *myuser, *to;
    358415 
     
    392449  owl_function_make_outgoing_zephyr(owl_global_get_zaway_msg(&g), tmpbuff, "Automated reply:");
    393450  owl_free(tmpbuff);
    394 }
    395 
    396 
     451#endif
     452}
     453
     454#ifdef HAVE_LIBZEPHYR
    397455void owl_zephyr_hackaway_cr(ZNotice_t *n)
    398456{
     
    406464  }
    407465}
     466#endif
    408467
    409468void owl_zephyr_zlocate(char *user, char *out, int auth)
    410469{
     470#ifdef HAVE_LIBZEPHYR
    411471  int ret, numlocs;
    412472  int one = 1;
     
    434494    owl_free(myuser);
    435495  }
     496#endif
    436497}
    437498
    438499void owl_zephyr_addsub(char *filename, char *class, char *inst, char *recip)
    439500{
     501#ifdef HAVE_LIBZEPHYR
    440502  char *line, subsfile[LINE], buff[LINE];
    441503  FILE *file;
     
    477539 
    478540  owl_free(line);
     541#endif
    479542}
    480543
    481544void owl_zephyr_delsub(char *filename, char *class, char *inst, char *recip)
    482545{
     546#ifdef HAVE_LIBZEPHYR
    483547  char *line, subsfile[LINE], buff[LINE], *text;
    484548  char backupfilename[LINE];
     
    544608
    545609  owl_function_makemsg("Subscription removed");
     610#endif
    546611}
    547612
     
    559624void owl_zephyr_zlog_in(void)
    560625{
     626#ifdef HAVE_LIBZEPHYR
    561627  char *exposure, *eset;
    562628  int ret;
     
    590656    */
    591657  }
     658#endif
    592659}
    593660
    594661void owl_zephyr_zlog_out(void)
    595662{
     663#ifdef HAVE_LIBZEPHYR
    596664  int ret;
    597665
     
    605673    */
    606674  }
     675#endif
    607676}
    608677
Note: See TracChangeset for help on using the changeset viewer.