Mercurial > pidgin-twitter
changeset 2:53ee194b5ff5
some cleanups
author | Yoshiki Yazawa <yaz@cc.rim.or.jp> |
---|---|
date | Tue, 29 Apr 2008 21:18:00 +0900 |
parents | 799955af57ad |
children | 71241cfaef1e |
files | Makefile.in pidgin-twitter.c |
diffstat | 2 files changed, 15 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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 +
--- 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 "@<a href='http://twitter.com/%s'>%s</a>" -#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, "@<a href='http://twitter.com/%s'>%s</a>", - 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);