Changeset ecf8fa8
- Timestamp:
- 2006-05-09T07:20:05Z (19 years ago)
- Branches:
- master
- Children:
- 67b6766
- Parents:
- a0d04d6
- Location:
- protocols
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/Makefile
ra0d04d6 recf8fa8 10 10 11 11 # [SH] Program variables 12 objects = http_client.o md5.o nogaim.o proxy.o sha.o $(SSL_CLIENT)12 objects = events_glib.o http_client.o md5.o nogaim.o proxy.o sha.o $(SSL_CLIENT) 13 13 14 14 # [SH] The next two lines should contain the directory name (in $(subdirs)) -
protocols/nogaim.c
ra0d04d6 recf8fa8 2 2 * BitlBee -- An IRC to other IM-networks gateway * 3 3 * * 4 * Copyright 2002-200 4Wilmer van der Gaast and others *4 * Copyright 2002-2006 Wilmer van der Gaast and others * 5 5 \********************************************************************/ 6 6 … … 13 13 * from scratch for BitlBee and doesn't contain any code from Gaim anymore 14 14 * (except for the function names). 15 *16 * Copyright 2002-2006 Wilmer van der Gaast <wilmer@gaast.net> and others17 15 */ 18 16 -
protocols/proxy.c
ra0d04d6 recf8fa8 21 21 */ 22 22 23 /* this is a little piece of code to handle proxy connection */24 /* it is intended to : 1st handle http proxy, using the CONNECT command25 , 2nd provide an easy way to add socks support */26 27 23 #define BITLBEE_CORE 28 24 #include <stdio.h> … … 46 42 #include "proxy.h" 47 43 48 #define GAIM_READ_COND (G_IO_IN | G_IO_HUP | G_IO_ERR)49 #define GAIM_WRITE_COND (G_IO_OUT | G_IO_HUP | G_IO_ERR | G_IO_NVAL)50 #define GAIM_ERR_COND (G_IO_HUP | G_IO_ERR | G_IO_NVAL)51 52 44 char proxyhost[128] = ""; 53 45 int proxyport = 0; … … 64 56 gint inpa; 65 57 }; 66 67 typedef struct _GaimIOClosure {68 GaimInputFunction function;69 guint result;70 gpointer data;71 } GaimIOClosure;72 58 73 59 … … 90 76 91 77 return &sin; 92 }93 94 static void gaim_io_destroy(gpointer data)95 {96 g_free(data);97 }98 99 static gboolean gaim_io_invoke(GIOChannel *source, GIOCondition condition, gpointer data)100 {101 GaimIOClosure *closure = data;102 GaimInputCondition gaim_cond = 0;103 104 if (condition & GAIM_READ_COND)105 gaim_cond |= GAIM_INPUT_READ;106 if (condition & GAIM_WRITE_COND)107 gaim_cond |= GAIM_INPUT_WRITE;108 109 closure->function(closure->data, g_io_channel_unix_get_fd(source), gaim_cond);110 111 return TRUE;112 78 } 113 79 … … 542 508 /* Export functions */ 543 509 544 gint gaim_input_add(gint source, GaimInputCondition condition, GaimInputFunction function, gpointer data)545 {546 GaimIOClosure *closure = g_new0(GaimIOClosure, 1);547 GIOChannel *channel;548 GIOCondition cond = 0;549 550 closure->function = function;551 closure->data = data;552 553 if (condition & GAIM_INPUT_READ)554 cond |= GAIM_READ_COND;555 if (condition & GAIM_INPUT_WRITE)556 cond |= GAIM_WRITE_COND;557 558 channel = g_io_channel_unix_new(source);559 closure->result = g_io_add_watch_full(channel, G_PRIORITY_DEFAULT, cond,560 gaim_io_invoke, closure, gaim_io_destroy);561 562 g_io_channel_unref(channel);563 return closure->result;564 }565 566 void gaim_input_remove(gint tag)567 {568 if (tag > 0)569 g_source_remove(tag);570 }571 572 510 int proxy_connect(const char *host, int port, GaimInputFunction func, gpointer data) 573 511 { -
protocols/proxy.h
ra0d04d6 recf8fa8 1 1 /* 2 * gaim2 * nogaim 3 3 * 4 4 * Copyright (C) 1998-1999, Mark Spencer <markster@marko.net> … … 36 36 #include <gmodule.h> 37 37 38 #include "events.h" 39 38 40 #define PROXY_NONE 0 39 41 #define PROXY_HTTP 1 … … 47 49 extern char proxypass[128]; 48 50 49 typedef enum {50 GAIM_INPUT_READ = 1 << 0,51 GAIM_INPUT_WRITE = 1 << 152 } GaimInputCondition;53 typedef void (*GaimInputFunction)(gpointer, gint, GaimInputCondition);54 55 G_MODULE_EXPORT gint gaim_input_add(int, GaimInputCondition, GaimInputFunction, gpointer);56 G_MODULE_EXPORT void gaim_input_remove(gint);57 58 51 G_MODULE_EXPORT int proxy_connect(const char *host, int port, GaimInputFunction func, gpointer data); 59 52
Note: See TracChangeset
for help on using the changeset viewer.