# HG changeset patch # User Yoshiki Yazawa # Date 1209471480 -32400 # Node ID 53ee194b5ff5555a50583ce2725405a1e874f0d9 # Parent 799955af57ad7c49b22aafed76d8554bbf7ddd06 some cleanups diff -r 799955af57ad -r 53ee194b5ff5 Makefile.in --- a/Makefile.in Tue Apr 29 20:59:37 2008 +0900 +++ b/Makefile.in Tue Apr 29 21:18:00 2008 +0900 @@ -1,3 +1,6 @@ +OBJECTIVE = pidgin-twitter.so +SRC = pidgin-twitter.c + PIDGIN_CFLAGS = @PIDGIN_CFLAGS@ GLIB_CFLAGS = @GLIB_CFLAGS@ CFLAGS = -fPIC -shared -Wall $(PIDGIN_CFLAGS) $(GLIB_CFLAGS) @@ -8,20 +11,22 @@ PIDGIN_LIB_DIR = @PIDGIN_LIB_DIR@ -default: pidgin-twitter.so +default: $(OBJECTIVE) -pidgin-twitter.so: pidgin-twitter.c + +$(OBJECTIVE): $(SRC) gcc -o $@ $< $(CFLAGS) $(LDFLAGS) -g -install: pidgin-twitter.so - install -m 755 pidgin-twitter.so $(PIDGIN_LIB_DIR)/pidgin +install: $(OBJECTIVE) + install -m 755 $(OBJECTIVE) $(PIDGIN_LIB_DIR)/pidgin clean: - rm -f pidgin-twitter.so + rm -f $(OBJECTIVE) distclean: clean rm -f Makefile config.log config.status *~ rm -rf autom4te.cache + diff -r 799955af57ad -r 53ee194b5ff5 pidgin-twitter.c --- a/pidgin-twitter.c Tue Apr 29 20:59:37 2008 +0900 +++ b/pidgin-twitter.c Tue Apr 29 21:18:00 2008 +0900 @@ -37,10 +37,11 @@ #define OPT_TRANSLATE OPT_PIDGINTWITTER "/translate" #define OPT_PLAYSOUND OPT_PIDGINTWITTER "/playsound" #define OPT_USERLIST OPT_PIDGINTWITTER "/userlist" +#define TWITTER_FORMAT "@%s" -#define twitter_debug(fmt, ...) purple_debug(PURPLE_DEBUG_INFO, "Pidgin-Twitter", \ +#define twitter_debug(fmt, ...) purple_debug(PURPLE_DEBUG_INFO, PIDGINTWITTER_PLUGIN_ID, \ fmt, ## __VA_ARGS__); -#define twitter_error(fmt, ...) purple_debug(PURPLE_DEBUG_ERROR, "Pidgin-Twitter", \ +#define twitter_error(fmt, ...) purple_debug(PURPLE_DEBUG_ERROR, PIDGINTWITTER_PLUGIN_ID, \ fmt, ## __VA_ARGS__); /* globals */ @@ -52,8 +53,8 @@ gchar sub[128]; gchar *match = g_match_info_fetch(match_info, 0); - snprintf(sub, 128, "@%s", - match + 1, //+1 is to strip preceding '@'. + snprintf(sub, 128, TWITTER_FORMAT, + match + 1, // +1 is to strip preceding '@'. match + 1); twitter_debug("sub = %s\n", sub); g_string_append(result, sub);