yaubil.c
changeset 20 d6b68c5fb1c1
parent 19 78535784faa7
equal deleted inserted replaced
19:78535784faa7 20:d6b68c5fb1c1
    34 void yaubil_init   (void);
    34 void yaubil_init   (void);
    35 void yaubil_uninit (void);
    35 void yaubil_uninit (void);
    36 
    36 
    37 #define DESCRIPTION ( "Yet Another Useless Built-In Language\nProvides commands /multi, /if, /then, /else, /eval, /let" )
    37 #define DESCRIPTION ( "Yet Another Useless Built-In Language\nProvides commands /multi, /if, /then, /else, /eval, /let" )
    38 
    38 
    39 static module_info_t info_yaubil_dev = {
    39 module_info_t info_yaubil = {
    40 	.branch      = "dev",
    40 	.branch      = MCABBER_BRANCH,
    41 	.api         = 20,
    41 	.api         = MCABBER_API_VERSION,
    42 	.version     = PROJECT_VERSION,
    42 	.version     = PROJECT_VERSION,
    43 	.description = DESCRIPTION,
    43 	.description = DESCRIPTION,
    44 	.requires    = NULL,
    44 	.requires    = NULL,
    45 	.init        = yaubil_init,
    45 	.init        = yaubil_init,
    46 	.uninit      = yaubil_uninit,
    46 	.uninit      = yaubil_uninit,
    47 	.next        = NULL,
    47 	.next        = NULL,
    48 };
       
    49 
       
    50 module_info_t info_yaubil = {
       
    51 	.branch      = "0.10.1",
       
    52 	.api         = 1,
       
    53 	.version     = PROJECT_VERSION,
       
    54 	.description = DESCRIPTION,
       
    55 	.requires    = NULL,
       
    56 	.init        = yaubil_init,
       
    57 	.uninit      = yaubil_uninit,
       
    58 	.next        = &info_yaubil_dev,
       
    59 };
    48 };
    60 
    49 
    61 #ifdef MCABBER_API_HAVE_CMD_ID
    50 #ifdef MCABBER_API_HAVE_CMD_ID
    62 static gpointer yaubil_multi_cmid = NULL;
    51 static gpointer yaubil_multi_cmid = NULL;
    63 static gpointer yaubil_if_cmid    = NULL;
    52 static gpointer yaubil_if_cmid    = NULL;
   596 
   585 
   597 static void destroy_value (value_t *value)
   586 static void destroy_value (value_t *value)
   598 {
   587 {
   599 	if (value->str_value)
   588 	if (value->str_value)
   600 		g_free (value->str_value);
   589 		g_free (value->str_value);
   601 	g_free (value);
   590 	g_slice_free (value_t, value);
   602 }
   591 }
   603 
   592 
   604 static value_t *process_expression (const char *str, gsize *len)
   593 static value_t *process_expression (const char *str, gsize *len)
   605 {
   594 {
   606 	const char *strend = str + *len;
   595 	const char *strend = str + *len;
   788 		}
   777 		}
   789 	}
   778 	}
   790 
   779 
   791 	{ // return value
   780 	{ // return value
   792 		*len = p - str;
   781 		*len = p - str;
   793 		value_t *rval = g_new (value_t, 1);
   782 		value_t *rval = g_slice_new (value_t);
   794 
   783 
   795 		rval->type      = val.type;
   784 		rval->type      = val.type;
   796 		rval->int_value = val.int_value;
   785 		rval->int_value = val.int_value;
   797 		rval->str_value = val.str_value;
   786 		rval->str_value = val.str_value;
   798 
   787