Mercurial > pidgin
comparison src/gaim-remote.c @ 3559:119b8950a1c8
[gaim-migrate @ 3653]
gaim-remote quit
Thanks John Silvestri.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Thu, 26 Sep 2002 21:51:34 +0000 |
parents | 6c32036050cf |
children | 43e396e94095 |
comparison
equal
deleted
inserted
replaced
3558:ea617b23ddac | 3559:119b8950a1c8 |
---|---|
33 " list Print buddy list\n" | 33 " list Print buddy list\n" |
34 " ison Show presence state of your buddy\n" | 34 " ison Show presence state of your buddy\n" |
35 " convo Open a new conversation window\n" | 35 " convo Open a new conversation window\n" |
36 " send Send message\n" | 36 " send Send message\n" |
37 " add Add buddy to buddy list\n" | 37 " add Add buddy to buddy list\n" |
38 " remove Remove buddy from list\n\n" | 38 " remove Remove buddy from list\n" |
39 " quit Close running copy of Gaim\n\n" | |
39 | 40 |
40 " OPTIONS:\n" | 41 " OPTIONS:\n" |
41 " -m, --message=MESG Message to send or show in conversation window\n" | 42 " -m, --message=MESG Message to send or show in conversation window\n" |
42 " -t, --to=SCREENNAME Select a target for command\n" | 43 " -t, --to=SCREENNAME Select a target for command\n" |
43 " -p, --protocol=PROTO Specify protocol to use\n" | 44 " -p, --protocol=PROTO Specify protocol to use\n" |
133 close(fd); | 134 close(fd); |
134 cui_packet_free(p); | 135 cui_packet_free(p); |
135 return 0; | 136 return 0; |
136 } | 137 } |
137 | 138 |
139 int command_quit() { | |
140 int fd = 0; | |
141 struct gaim_cui_packet *p = NULL; | |
142 fd = gaim_connect_to_session(0); | |
143 if (!fd) { | |
144 fprintf(stderr, "Gaim not running (on session 0)\n"); | |
145 return 1; | |
146 } | |
147 p = cui_packet_new(CUI_TYPE_META, CUI_META_QUIT); | |
148 cui_send_packet (fd, p); | |
149 close(fd); | |
150 cui_packet_free(p); | |
151 return 0; | |
152 } | |
153 | |
138 int command_info(){} | 154 int command_info(){} |
139 | 155 |
140 int main (int argc, char *argv[]) | 156 int main (int argc, char *argv[]) |
141 { | 157 { |
142 | 158 |
143 if (get_options(argc, argv)) { | 159 if (get_options(argc, argv)) { |
144 show_remote_usage(argv[0]); | 160 show_remote_usage(argv[0]); |
145 return 0; | 161 return 0; |
148 | 164 |
149 if (!strcmp(opts.command, "uri")) { | 165 if (!strcmp(opts.command, "uri")) { |
150 return command_uri(); | 166 return command_uri(); |
151 } else if (!strcmp(opts.command, "info")) { | 167 } else if (!strcmp(opts.command, "info")) { |
152 return command_info(); | 168 return command_info(); |
169 } else if (!strcmp(opts.command, "quit")) { | |
170 return command_quit(); | |
153 } else { | 171 } else { |
154 show_remote_usage(argv[0]); | 172 show_remote_usage(argv[0]); |
155 return 1; | 173 return 1; |
156 } | 174 } |
157 | 175 |