]> jfr.im git - solanum.git/blobdiff - ircd/modules.c
Message handlers should return void.
[solanum.git] / ircd / modules.c
index 2985f1c206697dd2ebaf912b24c7b015dfc57022..0eade506c6d494a6e634fdef33a8234000ae55a6 100644 (file)
@@ -58,29 +58,31 @@ static const char *core_module_table[] = {
        NULL
 };
 
+#define MOD_WARN_DELTA (90 * 86400)    /* time in seconds, 86400 seconds in a day */
+
 #define MODS_INCREMENT 10
 int num_mods = 0;
 int max_mods = MODS_INCREMENT;
 
 static rb_dlink_list mod_paths;
 
-static int mo_modload(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int mo_modlist(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int mo_modreload(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int mo_modunload(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int mo_modrestart(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void mo_modload(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void mo_modlist(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void mo_modreload(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void mo_modunload(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void mo_modrestart(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
-static int me_modload(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int me_modlist(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int me_modreload(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int me_modunload(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int me_modrestart(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void me_modload(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void me_modlist(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void me_modreload(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void me_modunload(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void me_modrestart(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
-static int do_modload(struct Client *, const char *);
-static int do_modunload(struct Client *, const char *);
-static int do_modreload(struct Client *, const char *);
-static int do_modlist(struct Client *, const char *);
-static int do_modrestart(struct Client *);
+static void do_modload(struct Client *, const char *);
+static void do_modunload(struct Client *, const char *);
+static void do_modreload(struct Client *, const char *);
+static void do_modlist(struct Client *, const char *);
+static void do_modrestart(struct Client *);
 
 struct Message modload_msgtab = {
        "MODLOAD", 0, 0, 0, 0,
@@ -243,7 +245,7 @@ load_all_modules(int warn)
                if((len > 3) && !strcmp(ldirent->d_name+len-3, ".la"))
                {
                        (void) snprintf(module_fq_name, sizeof(module_fq_name), "%s/%s", AUTOMODPATH, ldirent->d_name);
-                       (void) load_a_module(module_fq_name, warn, 0);
+                       (void) load_a_module(module_fq_name, warn, MAPI_ORIGIN_CORE, 0);
                }
 
        }
@@ -268,7 +270,7 @@ load_core_modules(int warn)
                snprintf(module_name, sizeof(module_name), "%s/%s%s", MODPATH,
                            core_module_table[i], ".la");
 
-               if(load_a_module(module_name, warn, 1) == -1)
+               if(load_a_module(module_name, warn, MAPI_ORIGIN_CORE, 1) == -1)
                {
                        ilog(L_MAIN,
                             "Error loading core module %s%s: terminating ircd",
@@ -285,7 +287,7 @@ load_core_modules(int warn)
  * side effects -
  */
 int
-load_one_module(const char *path, int coremodule)
+load_one_module(const char *path, int origin, int coremodule)
 {
        char modpath[PATH_MAX];
        rb_dlink_node *pathst;
@@ -296,6 +298,12 @@ load_one_module(const char *path, int coremodule)
        if (server_state_foreground == 1)
                inotice("loading module %s ...", path);
 
+       if(coremodule != 0)
+       {
+               coremodule = 1;
+               origin = MAPI_ORIGIN_CORE;
+       }
+
        RB_DLINK_FOREACH(pathst, mod_paths.head)
        {
                mpath = pathst->data;
@@ -308,10 +316,7 @@ load_one_module(const char *path, int coremodule)
                                if(S_ISREG(statbuf.st_mode))
                                {
                                        /* Regular files only please */
-                                       if(coremodule)
-                                               return load_a_module(modpath, 1, 1);
-                                       else
-                                               return load_a_module(modpath, 1, 0);
+                                       return load_a_module(modpath, 1, origin, coremodule);
                                }
                        }
 
@@ -324,14 +329,14 @@ load_one_module(const char *path, int coremodule)
 
 
 /* load a module .. */
-static int
+static void
 mo_modload(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv)
 {
        if(!IsOperAdmin(source_p))
        {
                sendto_one(source_p, form_str(ERR_NOPRIVS),
                           me.name, source_p->name, "admin");
-               return 0;
+               return;
        }
 
        if(parc > 2)
@@ -339,54 +344,35 @@ mo_modload(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
                sendto_match_servs(source_p, parv[2], CAP_ENCAP, NOCAPS,
                                "ENCAP %s MODLOAD %s", parv[2], parv[1]);
                if (match(parv[2], me.name) == 0)
-                       return 0;
+                       return;
        }
 
-       return do_modload(source_p, parv[1]);
+       do_modload(source_p, parv[1]);
 }
 
-static int
+static void
 me_modload(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv)
 {
        if(!find_shared_conf(source_p->username, source_p->host, source_p->servptr->name, SHARED_MODULE))
        {
                sendto_one_notice(source_p, ":*** You do not have an appropriate shared block "
                                "to load modules on this server.");
-               return 0;
-       }
-
-       return do_modload(source_p, parv[1]);
-}
-
-static int
-do_modload(struct Client *source_p, const char *module)
-{
-       char *m_bn = rb_basename(module);
-
-       if(findmodule_byname(m_bn) != -1)
-       {
-               sendto_one_notice(source_p, ":Module %s is already loaded", m_bn);
-               rb_free(m_bn);
-               return 0;
+               return;
        }
 
-       load_one_module(module, 0);
-
-       rb_free(m_bn);
-
-       return 0;
+       do_modload(source_p, parv[1]);
 }
 
 
 /* unload a module .. */
-static int
+static void
 mo_modunload(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv)
 {
        if(!IsOperAdmin(source_p))
        {
                sendto_one(source_p, form_str(ERR_NOPRIVS),
                           me.name, source_p->name, "admin");
-               return 0;
+               return;
        }
 
        if(parc > 2)
@@ -394,63 +380,34 @@ mo_modunload(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *so
                sendto_match_servs(source_p, parv[2], CAP_ENCAP, NOCAPS,
                                "ENCAP %s MODUNLOAD %s", parv[2], parv[1]);
                if (match(parv[2], me.name) == 0)
-                       return 0;
+                       return;
        }
 
-       return do_modunload(source_p, parv[1]);
+       do_modunload(source_p, parv[1]);
 }
 
-static int
+static void
 me_modunload(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv)
 {
        if(!find_shared_conf(source_p->username, source_p->host, source_p->servptr->name, SHARED_MODULE))
        {
                sendto_one_notice(source_p, ":*** You do not have an appropriate shared block "
                                "to load modules on this server.");
-               return 0;
-       }
-
-       return do_modunload(source_p, parv[1]);
-}
-
-static int
-do_modunload(struct Client *source_p, const char *module)
-{
-       int modindex;
-       char *m_bn = rb_basename(module);
-
-       if((modindex = findmodule_byname(m_bn)) == -1)
-       {
-               sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
-               rb_free(m_bn);
-               return 0;
-       }
-
-       if(modlist[modindex]->core == 1)
-       {
-               sendto_one_notice(source_p, ":Module %s is a core module and may not be unloaded", m_bn);
-               rb_free(m_bn);
-               return 0;
-       }
-
-       if(unload_one_module(m_bn, 1) == -1)
-       {
-               sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
+               return;
        }
 
-       rb_free(m_bn);
-       return 0;
+       do_modunload(source_p, parv[1]);
 }
 
 /* unload and load in one! */
-static int
+static void
 mo_modreload(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv)
 {
        if(!IsOperAdmin(source_p))
        {
                sendto_one(source_p, form_str(ERR_NOPRIVS),
                           me.name, source_p->name, "admin");
-               return 0;
+               return;
        }
 
        if(parc > 2)
@@ -458,69 +415,34 @@ mo_modreload(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *so
                sendto_match_servs(source_p, parv[2], CAP_ENCAP, NOCAPS,
                                "ENCAP %s MODRELOAD %s", parv[2], parv[1]);
                if (match(parv[2], me.name) == 0)
-                       return 0;
+                       return;
        }
 
-       return do_modreload(source_p, parv[1]);
+       do_modreload(source_p, parv[1]);
 }
 
-static int
+static void
 me_modreload(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv)
 {
        if(!find_shared_conf(source_p->username, source_p->host, source_p->servptr->name, SHARED_MODULE))
        {
                sendto_one_notice(source_p, ":*** You do not have an appropriate shared block "
                                "to load modules on this server.");
-               return 0;
-       }
-
-       return do_modreload(source_p, parv[1]);
-}
-
-static int
-do_modreload(struct Client *source_p, const char *module)
-{
-       int modindex;
-       int check_core;
-       char *m_bn = rb_basename(module);
-
-       if((modindex = findmodule_byname(m_bn)) == -1)
-       {
-               sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
-               rb_free(m_bn);
-               return 0;
-       }
-
-       check_core = modlist[modindex]->core;
-
-       if(unload_one_module(m_bn, 1) == -1)
-       {
-               sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
-               rb_free(m_bn);
-               return 0;
-       }
-
-       if((load_one_module(m_bn, check_core) == -1) && check_core)
-       {
-               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
-                                    "Error reloading core module: %s: terminating ircd", m_bn);
-               ilog(L_MAIN, "Error loading core module %s: terminating ircd", m_bn);
-               exit(0);
+               return;
        }
 
-       rb_free(m_bn);
-       return 0;
+       do_modreload(source_p, parv[1]);
 }
 
 /* list modules .. */
-static int
+static void
 mo_modlist(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv)
 {
        if(!IsOperAdmin(source_p))
        {
                sendto_one(source_p, form_str(ERR_NOPRIVS),
                           me.name, source_p->name, "admin");
-               return 0;
+               return;
        }
 
        if(parc > 2)
@@ -528,65 +450,34 @@ mo_modlist(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sour
                sendto_match_servs(source_p, parv[2], CAP_ENCAP, NOCAPS,
                                "ENCAP %s MODLIST %s", parv[2], parv[1]);
                if (match(parv[2], me.name) == 0)
-                       return 0;
+                       return;
        }
 
-       return do_modlist(source_p, parc > 1 ? parv[1] : 0);
+       do_modlist(source_p, parc > 1 ? parv[1] : 0);
 }
 
-static int
+static void
 me_modlist(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv)
 {
        if(!find_shared_conf(source_p->username, source_p->host, source_p->servptr->name, SHARED_MODULE))
        {
                sendto_one_notice(source_p, ":*** You do not have an appropriate shared block "
                                "to load modules on this server.");
-               return 0;
-       }
-
-       return do_modlist(source_p, parv[1]);
-}
-
-static int
-do_modlist(struct Client *source_p, const char *pattern)
-{
-       int i;
-
-       for (i = 0; i < num_mods; i++)
-       {
-               if(pattern)
-               {
-                       if(match(pattern, modlist[i]->name))
-                       {
-                               sendto_one(source_p, form_str(RPL_MODLIST),
-                                          me.name, source_p->name,
-                                          modlist[i]->name,
-                                          (unsigned long)(uintptr_t)modlist[i]->address,
-                                          modlist[i]->version, modlist[i]->core ? "(core)" : "");
-                       }
-               }
-               else
-               {
-                       sendto_one(source_p, form_str(RPL_MODLIST),
-                                  me.name, source_p->name, modlist[i]->name,
-                                  (unsigned long)(uintptr_t)modlist[i]->address, modlist[i]->version,
-                                  modlist[i]->core ? "(core)" : "");
-               }
+               return;
        }
 
-       sendto_one(source_p, form_str(RPL_ENDOFMODLIST), me.name, source_p->name);
-       return 0;
+       do_modlist(source_p, parv[1]);
 }
 
 /* unload and reload all modules */
-static int
+static void
 mo_modrestart(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv)
 {
        if(!IsOperAdmin(source_p))
        {
                sendto_one(source_p, form_str(ERR_NOPRIVS),
                           me.name, source_p->name, "admin");
-               return 0;
+               return;
        }
 
        if(parc > 1)
@@ -594,26 +485,107 @@ mo_modrestart(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *s
                sendto_match_servs(source_p, parv[1], CAP_ENCAP, NOCAPS,
                                "ENCAP %s MODRESTART", parv[1]);
                if (match(parv[1], me.name) == 0)
-                       return 0;
+                       return;
        }
 
-       return do_modrestart(source_p);
+       do_modrestart(source_p);
 }
 
-static int
+static void
 me_modrestart(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char **parv)
 {
        if(!find_shared_conf(source_p->username, source_p->host, source_p->servptr->name, SHARED_MODULE))
        {
                sendto_one_notice(source_p, ":*** You do not have an appropriate shared block "
                                "to load modules on this server.");
-               return 0;
+               return;
        }
 
-       return do_modrestart(source_p);
+       do_modrestart(source_p);
 }
 
-static int
+static void
+do_modload(struct Client *source_p, const char *module)
+{
+       char *m_bn = rb_basename(module);
+       int origin;
+
+       if(findmodule_byname(m_bn) != -1)
+       {
+               sendto_one_notice(source_p, ":Module %s is already loaded", m_bn);
+               rb_free(m_bn);
+               return;
+       }
+
+       origin = strcmp(module, m_bn) == 0 ? MAPI_ORIGIN_CORE : MAPI_ORIGIN_EXTENSION;
+       load_one_module(module, origin, 0);
+
+       rb_free(m_bn);
+}
+
+static void
+do_modunload(struct Client *source_p, const char *module)
+{
+       int modindex;
+       char *m_bn = rb_basename(module);
+
+       if((modindex = findmodule_byname(m_bn)) == -1)
+       {
+               sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
+               rb_free(m_bn);
+               return;
+       }
+
+       if(modlist[modindex]->core == 1)
+       {
+               sendto_one_notice(source_p, ":Module %s is a core module and may not be unloaded", m_bn);
+               rb_free(m_bn);
+               return;
+       }
+
+       if(unload_one_module(m_bn, 1) == -1)
+       {
+               sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
+       }
+
+       rb_free(m_bn);
+}
+
+static void
+do_modreload(struct Client *source_p, const char *module)
+{
+       int modindex;
+       int check_core;
+       char *m_bn = rb_basename(module);
+
+       if((modindex = findmodule_byname(m_bn)) == -1)
+       {
+               sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
+               rb_free(m_bn);
+               return;
+       }
+
+       check_core = modlist[modindex]->core;
+
+       if(unload_one_module(m_bn, 1) == -1)
+       {
+               sendto_one_notice(source_p, ":Module %s is not loaded", m_bn);
+               rb_free(m_bn);
+               return;
+       }
+
+       if((load_one_module(m_bn, modlist[modindex]->origin, check_core) == -1) && check_core)
+       {
+               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
+                                    "Error reloading core module: %s: terminating ircd", m_bn);
+               ilog(L_MAIN, "Error loading core module %s: terminating ircd", m_bn);
+               exit(0);
+       }
+
+       rb_free(m_bn);
+}
+
+static void
 do_modrestart(struct Client *source_p)
 {
        int modnum;
@@ -632,9 +604,51 @@ do_modrestart(struct Client *source_p)
                             "Module Restart: %d modules unloaded, %d modules loaded",
                             modnum, num_mods);
        ilog(L_MAIN, "Module Restart: %d modules unloaded, %d modules loaded", modnum, num_mods);
-       return 0;
 }
 
+static void
+do_modlist(struct Client *source_p, const char *pattern)
+{
+       int i;
+
+       for (i = 0; i < num_mods; i++)
+       {
+               const char *origin;
+               switch (modlist[i]->origin)
+               {
+               case MAPI_ORIGIN_EXTENSION:
+                       origin = "extension";
+                       break;
+               case MAPI_ORIGIN_CORE:
+                       origin = "builtin";
+                       break;
+               default:
+                       origin = "unknown";
+                       break;
+               }
+
+               if(pattern)
+               {
+                       if(match(pattern, modlist[i]->name))
+                       {
+                               sendto_one(source_p, form_str(RPL_MODLIST),
+                                          me.name, source_p->name,
+                                          modlist[i]->name,
+                                          (unsigned long)(uintptr_t)modlist[i]->address, origin,
+                                          modlist[i]->core ? " (core)" : "", modlist[i]->version, modlist[i]->description);
+                       }
+               }
+               else
+               {
+                       sendto_one(source_p, form_str(RPL_MODLIST),
+                                  me.name, source_p->name, modlist[i]->name,
+                                  (unsigned long)(uintptr_t)modlist[i]->address, origin,
+                                  modlist[i]->core ? " (core)" : "", modlist[i]->version, modlist[i]->description);
+               }
+       }
+
+       sendto_one(source_p, form_str(RPL_ENDOFMODLIST), me.name, source_p->name);
+}
 
 static void increase_modlist(void);
 
@@ -727,7 +741,7 @@ unload_one_module(const char *name, int warn)
                                {
                                        struct CapabilityIndex *idx;
 
-                                       switch(m->cap_index)
+                                       switch (m->cap_index)
                                        {
                                        case MAPI_CAP_CLIENT:
                                                idx = cli_capindex;
@@ -777,16 +791,15 @@ unload_one_module(const char *name, int warn)
        return 0;
 }
 
-
 /*
  * load_a_module()
  *
- * inputs      - path name of module, int to notice, int of core
+ * inputs      - path name of module, int to notice, int of origin, int of core
  * output      - -1 if error 0 if success
  * side effects - loads a module if successful
  */
 int
-load_a_module(const char *path, int warn, int core)
+load_a_module(const char *path, int warn, int origin, int core)
 {
        lt_dlhandle tmpptr;
        char *mod_basename;
@@ -878,7 +891,7 @@ load_a_module(const char *path, int warn, int core)
                        if(mheader->mapi_register && (mheader->mapi_register() == -1))
                        {
                                ilog(L_MAIN, "Module %s indicated failure during load.",
-                                    mod_basename);
+                                       mod_basename);
                                sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                                     "Module %s indicated failure during load.",
                                                     mod_basename);
@@ -886,6 +899,28 @@ load_a_module(const char *path, int warn, int core)
                                rb_free(mod_basename);
                                return -1;
                        }
+
+                       /* Basic date code checks
+                        *
+                        * Don't make them fatal, but do complain about differences within a certain time frame.
+                        * Later on if there are major API changes we can add fatal checks.
+                        * -- Elizafox
+                        */
+                       if(mheader->mapi_datecode != datecode && mheader->mapi_datecode > 0)
+                       {
+                               long int delta = labs(datecode - mheader->mapi_datecode);
+                               if (delta > MOD_WARN_DELTA)
+                               {
+                                       delta /= 86400;
+                                       iwarn(L_MAIN,
+                                               "Module %s build date is out of sync with ircd build date by %ld days, expect problems",
+                                               mod_basename, delta);
+                                       sendto_realops_snomask(SNO_GENERAL, L_ALL,
+                                               "Module %s build date is out of sync with ircd build date by %ld days, expect problems",
+                                               mod_basename, delta);
+                               }
+                       }
+
                        if(mheader->mapi_command_list)
                        {
                                struct Message **m;
@@ -919,7 +954,7 @@ load_a_module(const char *path, int warn, int core)
                                        struct CapabilityIndex *idx;
                                        int result;
 
-                                       switch(m->cap_index)
+                                       switch (m->cap_index)
                                        {
                                        case MAPI_CAP_CLIENT:
                                                idx = cli_capindex;
@@ -943,6 +978,8 @@ load_a_module(const char *path, int warn, int core)
                                }
                        }
                }
+
+               break;
        default:
                ilog(L_MAIN, "Module %s has unknown/unsupported MAPI version %d.",
                     mod_basename, MAPI_VERSION(*mapi_version));
@@ -965,20 +1002,37 @@ load_a_module(const char *path, int warn, int core)
        modlist[num_mods] = rb_malloc(sizeof(struct module));
        modlist[num_mods]->address = tmpptr;
        modlist[num_mods]->version = ver;
+       modlist[num_mods]->description = description;
        modlist[num_mods]->core = core;
        modlist[num_mods]->name = rb_strdup(mod_basename);
        modlist[num_mods]->mapi_header = mapi_version;
        modlist[num_mods]->mapi_version = MAPI_VERSION(*mapi_version);
+       modlist[num_mods]->origin = origin;
        num_mods++;
 
        if(warn == 1)
        {
+               const char *o;
+
+               switch (origin)
+               {
+               case MAPI_ORIGIN_EXTENSION:
+                       o = "extension";
+                       break;
+               case MAPI_ORIGIN_CORE:
+                       o = "core";
+                       break;
+               default:
+                       o = "unknown";
+                       break;
+               }
+
                sendto_realops_snomask(SNO_GENERAL, L_ALL,
-                                    "Module %s [version: %s; MAPI version: %d; description: \"%s\"] loaded at 0x%lx",
-                                    mod_basename, ver, MAPI_VERSION(*mapi_version), description,
+                                    "Module %s [version: %s; MAPI version: %d; origin: %s; description: \"%s\"] loaded at 0x%lx",
+                                    mod_basename, ver, MAPI_VERSION(*mapi_version), o, description,
                                     (unsigned long) tmpptr);
-               ilog(L_MAIN, "Module %s [version: %s; MAPI version: %d; description: \"%s\"] loaded at 0x%lx",
-                    mod_basename, ver, MAPI_VERSION(*mapi_version), description, (unsigned long) tmpptr);
+               ilog(L_MAIN, "Module %s [version: %s; MAPI version: %d; origin: %s; description: \"%s\"] loaded at 0x%lx",
+                    mod_basename, ver, MAPI_VERSION(*mapi_version), o, description, (unsigned long) tmpptr);
        }
        rb_free(mod_basename);
        return 0;