Changeset b9d22f7 for functions.c
- Timestamp:
- Jun 11, 2011, 6:31:32 PM (14 years ago)
- Children:
- 7df7be2
- Parents:
- 89fe67e
- git-author:
- David Benjamin <davidben@mit.edu> (05/24/11 00:33:34)
- git-committer:
- David Benjamin <davidben@mit.edu> (06/11/11 18:31:32)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r259e60a8 rb9d22f7 92 92 owl_function_popless_fmtext(&fm); 93 93 owl_list_cleanup(&l, g_free); 94 owl_fmtext_cleanup(&fm);95 }96 97 static void _owl_function_timer_append_fmtext(gpointer data, gpointer user_data) {98 owl_fmtext *fm = user_data;99 owl_timer *timer = data;100 char *str = g_strdup_printf("- %s: in %d seconds",101 timer->name ? timer->name : "(unnamed)",102 (int)(timer->time - time(NULL)));103 owl_fmtext_append_normal(fm, str);104 g_free(str);105 if (timer->interval) {106 str = g_strdup_printf(", repeat every %d seconds", timer->interval);107 owl_fmtext_append_normal(fm, str);108 g_free(str);109 }110 owl_fmtext_append_normal(fm, "\n");111 }112 113 void owl_function_show_timers(void) {114 owl_fmtext fm;115 GList **timers;116 117 owl_fmtext_init_null(&fm);118 owl_fmtext_append_bold(&fm, "Active timers:\n");119 120 timers = owl_global_get_timerlist(&g);121 g_list_foreach(*timers, _owl_function_timer_append_fmtext, &fm);122 123 owl_function_popless_fmtext(&fm);124 94 owl_fmtext_cleanup(&fm); 125 95 }
Note: See TracChangeset
for help on using the changeset viewer.