comparison src/main.c @ 5205:fefad67de2c7

[gaim-migrate @ 5573] I had a damn good commit message, but it was eaten. Let's try it again. Announcing, Gaim Plugin API version 2.0, or GPAPIV2.0 for short. There are lots'a cool thingies here. Okay now, this isn't as cool as the previous message, but: 1) There's now a single entry function for all plugin types. It returns a detailed information structure on the plugin. This removes a lot of the ugliness from old plugins. Oh yeah, libicq wasn't converted to this, so if you use it, well, you shouldn't have used it anyway, but now you can't! bwahahaha. Use AIM/ICQ. 2) There are now 3 types of plugins: Standard, Loader, and Protocol plugins. Standard plugins are, well, standard, compiled plugins. Loader plugins load other plugins. For example, the perl support is now a loader plugin. It loads perl scripts. In the future, we'll have Ruby and Python loader plugins. Protocol plugins are, well, protocol plugins... yeah... 3) Plugins have unique IDs, so they can be referred to or automatically updated from a plugin database in the future. Neat, huh? 4) Plugins will have dependency support in the future, and can be hidden, so if you have, say, a logging core plugin, it won't have to show up, but then you load the GTK+ logging plugin and it'll auto-load the core plugin. Core/UI split plugins! 5) There will eventually be custom plugin signals and RPC of some sort, for the core/ui split plugins. So, okay, back up .gaimrc. I'd like to thank my parents for their support, javabsp for helping convert a bunch of protocol plugins, and Etan for helping convert a bunch of standard plugins. Have fun. If you have any problems, please let me know, but you probably won't have anything major happen. You will have to convert your plugins, though, and I'm not guaranteeing that all perl scripts will still work. I'll end up changing the perl script API eventually, so I know they won't down the road. Don't worry, though. It'll be mass cool. faceprint wants me to just commit the damn code already. So, here we go!!! .. .. I need a massage. From a young, cute girl. Are there any young, cute girls in the audience? IM me plz k thx. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Fri, 25 Apr 2003 06:47:33 +0000
parents cb700c07ee07
children 0241d6b6702d
comparison
equal deleted inserted replaced
5204:44de70702205 5205:fefad67de2c7
101 SIGPIPE, 101 SIGPIPE,
102 -1 102 -1
103 }; 103 };
104 #endif 104 #endif
105 105
106 STATIC_PROTO_INIT
107
106 void do_quit() 108 void do_quit()
107 { 109 {
108 /* captain's log, stardate... */ 110 /* captain's log, stardate... */
109 system_log(log_quit, NULL, NULL, OPT_LOG_BUDDY_SIGNON | OPT_LOG_MY_SIGNON); 111 system_log(log_quit, NULL, NULL, OPT_LOG_BUDDY_SIGNON | OPT_LOG_MY_SIGNON);
110 112
111 /* the self destruct sequence has been initiated */ 113 /* the self destruct sequence has been initiated */
112 plugin_event(event_quit); 114 gaim_event_broadcast(event_quit);
113 115
114 /* transmission ends */ 116 /* transmission ends */
115 signoff_all(); 117 signoff_all();
116 118
117 /* record what we have before we blow it away... */ 119 /* record what we have before we blow it away... */
118 save_prefs(); 120 save_prefs();
119 121
120 #ifdef GAIM_PLUGINS 122 debug_printf("Unloading all plugins\n");
121 /* jettison cargo */ 123 gaim_plugins_unload_all();
122 remove_all_plugins(); 124
123 #endif 125 /* XXX */
124 126 #if 0
125 #ifdef USE_PERL 127 #ifdef USE_PERL
126 /* yup, perl too */ 128 /* yup, perl too */
127 perl_end(); 129 perl_end();
130 #endif
128 #endif 131 #endif
129 132
130 #ifdef USE_SM 133 #ifdef USE_SM
131 /* unplug */ 134 /* unplug */
132 session_end(); 135 session_end();
182 * them, they just have to use the account editor to sign in 185 * them, they just have to use the account editor to sign in
183 * the second one */ 186 * the second one */
184 187
185 account = gaim_account_find(username, -1); 188 account = gaim_account_find(username, -1);
186 if (!account) 189 if (!account)
187 account = gaim_account_new(username, DEFAULT_PROTO, OPT_ACCT_REM_PASS); 190 account = gaim_account_new(username, GAIM_PROTO_DEFAULT,
191 OPT_ACCT_REM_PASS);
192
188 g_snprintf(account->password, sizeof account->password, "%s", password); 193 g_snprintf(account->password, sizeof account->password, "%s", password);
189 save_prefs(); 194 save_prefs();
190 serv_login(account); 195 serv_login(account);
191 } 196 }
192 197
435 #endif 440 #endif
436 break; 441 break;
437 default: 442 default:
438 debug_printf("caught signal %d\n", sig); 443 debug_printf("caught signal %d\n", sig);
439 signoff_all(NULL, NULL); 444 signoff_all(NULL, NULL);
440 #ifdef GAIM_PLUGINS 445
441 remove_all_plugins(); 446 gaim_plugins_unload_all();
442 #endif 447
443 if (gtk_main_level()) 448 if (gtk_main_level())
444 gtk_main_quit(); 449 gtk_main_quit();
445 core_quit(); 450 core_quit();
446 exit(0); 451 exit(0);
447 } 452 }
565 account = gaim_account_find(name, -1); 570 account = gaim_account_find(name, -1);
566 571
567 if (!account) { /* new user */ 572 if (!account) { /* new user */
568 account = g_new0(struct gaim_account, 1); 573 account = g_new0(struct gaim_account, 1);
569 g_snprintf(account->username, sizeof(account->username), "%s", name); 574 g_snprintf(account->username, sizeof(account->username), "%s", name);
570 account->protocol = DEFAULT_PROTO; 575 account->protocol = GAIM_PROTO_DEFAULT;
571 gaim_accounts = g_slist_prepend(gaim_accounts, account); 576 gaim_accounts = g_slist_prepend(gaim_accounts, account);
572 } else { /* user already exists */ 577 } else { /* user already exists */
573 gaim_accounts = g_slist_remove(gaim_accounts, account); 578 gaim_accounts = g_slist_remove(gaim_accounts, account);
574 gaim_accounts = g_slist_prepend(gaim_accounts, account); 579 gaim_accounts = g_slist_prepend(gaim_accounts, account);
575 } 580 }
607 #endif 612 #endif
608 { 613 {
609 int opt_acct = 0, opt_help = 0, opt_version = 0, opt_login = 0, opt_nologin = 0, dologin_ret = -1; 614 int opt_acct = 0, opt_help = 0, opt_version = 0, opt_login = 0, opt_nologin = 0, dologin_ret = -1;
610 char *opt_user_arg = NULL, *opt_login_arg = NULL; 615 char *opt_user_arg = NULL, *opt_login_arg = NULL;
611 char *opt_session_arg = NULL; 616 char *opt_session_arg = NULL;
617 char *plugin_search_paths[3];
612 #if HAVE_SIGNAL_H 618 #if HAVE_SIGNAL_H
613 int sig_indx; /* for setting up signal catching */ 619 int sig_indx; /* for setting up signal catching */
614 sigset_t sigset; 620 sigset_t sigset;
615 void (*prev_sig_disp)(); 621 void (*prev_sig_disp)();
616 #endif 622 #endif
852 /* show version message */ 858 /* show version message */
853 if (opt_version) { 859 if (opt_version) {
854 printf("Gaim %s\n",VERSION); 860 printf("Gaim %s\n",VERSION);
855 return 0; 861 return 0;
856 } 862 }
857 863
858 #if GAIM_PLUGINS || USE_PERL 864 plugin_search_paths[0] = LIBDIR;
859 gaim_probe_plugins(); 865 plugin_search_paths[1] = gaim_user_dir();
860 #endif 866 plugin_search_paths[2] = g_strdup_printf("%s/plugins", gaim_user_dir());
861 867
868 gaim_plugins_set_search_paths(sizeof(plugin_search_paths) /
869 sizeof(*plugin_search_paths),
870 plugin_search_paths);
871
872 g_free(plugin_search_paths[2]);
873
874 gaim_plugins_probe(NULL);
875
862 #ifdef _WIN32 876 #ifdef _WIN32
863 /* Various win32 initializations */ 877 /* Various win32 initializations */
864 wgaim_init(); 878 wgaim_init();
865 #endif 879 #endif
866 880