Exemplo n.º 1
0
static gboolean ril_radio_settings_get_config(struct ril_radio_settings *rsd)
{
	gboolean needsconfig = FALSE;
	gboolean value = FALSE;

	/* Hmm... One file shared by all modems... Why?? */

	GKeyFile *keyfile = storage_open(NULL, RIL_STORE);
	char **alreadyset = g_key_file_get_groups(keyfile, NULL);

	if (alreadyset[0])
		value = g_key_file_get_boolean(
			keyfile, alreadyset[0], LTE_FLAG, NULL);
	else if (rsd->ratmode == PREF_NET_TYPE_GSM_WCDMA_AUTO)
		value = TRUE;

	if (!value && rsd->ratmode == PREF_NET_TYPE_LTE_GSM_WCDMA) {
			g_key_file_set_boolean(keyfile,
				LTE_FLAG, LTE_FLAG, TRUE);
			needsconfig = TRUE;
	} else if (value && rsd->ratmode == PREF_NET_TYPE_GSM_WCDMA_AUTO) {
			g_key_file_set_boolean(keyfile,
				LTE_FLAG, LTE_FLAG, FALSE);
			needsconfig = TRUE;
	}

	g_strfreev(alreadyset);
	storage_close(NULL, RIL_STORE, keyfile, TRUE);

	DBG("needsconfig %d, rat mode %d", needsconfig, rsd->ratmode);
	return needsconfig;
}
Exemplo n.º 2
0
void init_socials() {
  // create the social table
  social_table = newHashtable();

  // open up the storage set
  STORAGE_SET       *set = storage_read(SOCIALS_FILE);
  STORAGE_SET_LIST *list = read_list(set, "socials");
  STORAGE_SET    *social = NULL;

  // parse all of the socials
  while( (social = storage_list_next(list)) != NULL)
    add_social(socialRead(social));
  
  // close the storage set
  storage_close(set);

  // add all of the socials to the command table
  HASH_ITERATOR *hash_i = newHashIterator(social_table);
  const char       *cmd = NULL;
  SOCIAL_DATA     *data = NULL;

  ITERATE_HASH(cmd, data, hash_i) {
    add_cmd(cmd, NULL, cmd_social, "player", FALSE);
    if(data->min_pos == POS_SITTING)
      add_cmd_check(cmd, chk_conscious);
    else if(data->min_pos == POS_STANDING)
      add_cmd_check(cmd, chk_can_move);
    else if(data->max_pos == POS_STANDING)
      add_cmd_check(cmd, chk_grounded);
  } deleteHashIterator(hash_i);
Exemplo n.º 3
0
//
// store a room in the persistent database
void worldStorePersistentRoom(WORLD_DATA *world, const char *key,
			      ROOM_DATA *room) {
  static char fname[MAX_BUFFER];
  static char  dir1[SMALL_BUFFER];
  static char  dir2[SMALL_BUFFER];
  if(!*key)
    return;

  unsigned long hash1 = pearson_hash8_1(key) % WORLD_BINS;
  unsigned long hash2 = pearson_hash8_2(key) % WORLD_BINS;
  *fname = '\0';
  *dir1  = '\0';
  *dir2  = '\0';

  // make sure our hash bins exist
  sprintf(dir1, "%s/persistent/%lu", 
	  worldGetPath(world), hash1);
  if(!dir_exists(dir1))
    mkdir(dir1, S_IRWXU | S_IRWXG);

  // and the second one as well
  sprintf(dir2, "%s/persistent/%lu/%lu", 
	  worldGetPath(world), hash1, hash2);
  if(!dir_exists(dir2))
    mkdir(dir2, S_IRWXU | S_IRWXG);

  // now, store the room
  sprintf(fname, "%s/persistent/%lu/%lu/%s", 
	  worldGetPath(world), hash1, hash2, key);
  STORAGE_SET *set = roomStore(room);
  storage_write(set, fname);
  storage_close(set);

  // log_string("stored persistent room :: %s", fname);
}
Exemplo n.º 4
0
void post_server_shutdown(int status)
{
    switch (status)
    {
	case 0:
	    topiclist_unload();
    	    realmlist_destroy();
	    teamlist_unload();
            clanlist_unload();
	    tournament_destroy();
	    anongame_infos_unload();
	    trans_unload();
	    aliasfile_unload();
	    command_groups_unload();
	    tracker_set_servers(NULL);
	    characterlist_destroy();
            ladder_destroyxptable();
        case STATUS_WAR3XPTABLES_FAILURE:

	case STATUS_LADDERLIST_FAILURE:
	    ladder_update_all_accounts();
    	    ladders_destroy();
	    output_dispose_filename();
	    accountlist_destroy();
    	    attrlayer_cleanup();
    	    watchlist_destroy();
	    news_unload();
    	    versioncheck_unload();
    	    autoupdate_unload();
    	    adbannerlist_destroy();
    	    ipbanlist_save(prefs_get_ipbanfile());
    	    ipbanlist_destroy();
    	    helpfile_unload();
    	    channellist_destroy();
	    server_clear_hostname();
    	    timerlist_destroy();
	    gamelist_destroy();
	    connlist_destroy();
	    fdwatch_close();
	case STATUS_FDWATCH_FAILURE:
	    anongame_matchlists_destroy();
	case STATUS_MATCHLISTS_FAILURE:
	    anongame_maplists_destroy();
	case STATUS_MAPLISTS_FAILURE:
	case STATUS_SUPPORT_FAILURE:
	    if (psock_deinit())
		eventlog(eventlog_level_error, __FUNCTION__, "got error from psock_deinit()");
	case STATUS_PSOCK_FAILURE:
	    storage_close();
	case STATUS_STORAGE_FAILURE:
	    oom_free();
	case STATUS_OOM_FAILURE:
	case -1:
	    break;
	default:
	    eventlog(eventlog_level_error,__FUNCTION__,"got bad status \"%d\" during shutdown",status);
    }
    return;
}    
Exemplo n.º 5
0
static gboolean ril_get_net_config(struct radio_data *rsd)
{
	GKeyFile *keyfile;
	GError *err = NULL;
	char *path = RIL_CONFIG;
	char **alreadyset = NULL;
	gboolean needsconfig = FALSE;
	gboolean value = FALSE;
	rsd->ratmode = PREF_NET_TYPE_GSM_WCDMA_AUTO;

	/*
	 * First we need to check should the LTE be on
	 * or not
	 */

	keyfile = g_key_file_new();

	g_key_file_set_list_separator(keyfile, ',');

	if (g_key_file_load_from_file(keyfile, path, 0, &err)) {
		if (g_key_file_has_group(keyfile, LTE_FLAG))
			rsd->ratmode = PREF_NET_TYPE_LTE_GSM_WCDMA;
	} else {
		g_error_free(err);
		needsconfig = TRUE;
	}

	g_key_file_free(keyfile);

	/* Then we need to check if it already set */

	keyfile = storage_open(NULL, RIL_STORE);
	alreadyset = g_key_file_get_groups(keyfile, NULL);

	if (alreadyset[0])
		value = g_key_file_get_boolean(
			keyfile, alreadyset[0], LTE_FLAG, NULL);
	else if (rsd->ratmode == PREF_NET_TYPE_GSM_WCDMA_AUTO)
		value = TRUE;

	if (!value && rsd->ratmode == PREF_NET_TYPE_LTE_GSM_WCDMA) {
			g_key_file_set_boolean(keyfile,
				LTE_FLAG, LTE_FLAG, TRUE);
			needsconfig = TRUE;
	} else if (value && rsd->ratmode == PREF_NET_TYPE_GSM_WCDMA_AUTO) {
			g_key_file_set_boolean(keyfile,
				LTE_FLAG, LTE_FLAG, FALSE);
			needsconfig = TRUE;
	}

	g_strfreev(alreadyset);

	storage_close(NULL, RIL_STORE, keyfile, TRUE);

	return needsconfig;
}
Exemplo n.º 6
0
Arquivo: sms.c Projeto: AndriusA/ofono
static void sms_remove(struct ofono_atom *atom)
{
	struct ofono_sms *sms = __ofono_atom_get_data(atom);

	DBG("atom: %p", atom);

	if (sms == NULL)
		return;

	if (sms->driver && sms->driver->remove)
		sms->driver->remove(sms);

	if (sms->tx_source) {
		g_source_remove(sms->tx_source);
		sms->tx_source = 0;
	}

	if (sms->assembly) {
		sms_assembly_free(sms->assembly);
		sms->assembly = NULL;
	}

	if (sms->txq) {
		g_queue_foreach(sms->txq, tx_queue_entry_destroy_foreach, NULL);
		g_queue_free(sms->txq);
		sms->txq = NULL;
	}

	if (sms->settings) {
		g_key_file_set_integer(sms->settings, SETTINGS_GROUP,
					"NextReference", sms->ref);
		g_key_file_set_boolean(sms->settings, SETTINGS_GROUP,
					"UseDeliveryReports",
					sms->use_delivery_reports);
		g_key_file_set_integer(sms->settings, SETTINGS_GROUP,
					"Bearer", sms->bearer);
		g_key_file_set_integer(sms->settings, SETTINGS_GROUP,
					"Alphabet", sms->alphabet);

		storage_close(sms->imsi, SETTINGS_STORE, sms->settings, TRUE);

		g_free(sms->imsi);
		sms->imsi = NULL;
		sms->settings = NULL;
	}

	if (sms->sr_assembly) {
		status_report_assembly_free(sms->sr_assembly);
		sms->sr_assembly = NULL;
	}

	g_free(sms);
}
Exemplo n.º 7
0
//
// save all of the socials to disk
//
void save_socials() {
  STORAGE_SET       *set = new_storage_set();
  LIST         *soc_list = newList();

  // iterate across the social table and save all of the unique socials
  HASH_ITERATOR  *hash_i = newHashIterator(social_table);
  const char        *cmd = NULL;
  SOCIAL_DATA      *data = NULL;

  ITERATE_HASH(cmd, data, hash_i)
    listPut(soc_list, data);
  deleteHashIterator(hash_i);

  store_list(set, "socials", gen_store_list(soc_list, socialStore));
  deleteList(soc_list);

  // write the set
  storage_write(set, SOCIALS_FILE);
  
  // close the set
  storage_close(set);
}
Exemplo n.º 8
0
static gboolean ril_roaming_allowed()
{
	GError *error;
	error = NULL;
	GKeyFile *settings;
	struct ofono_sim *sim;

	sim = get_sim();
	const char *imsi = ofono_sim_get_imsi(sim);
	settings = storage_open(imsi, "gprs");
	gboolean roaming_allowed = g_key_file_get_boolean(settings,
							"Settings",
							"RoamingAllowed",
							&error);

	if (error)
		g_error_free(error);

	storage_close(imsi, "gprs", settings, FALSE);

	return roaming_allowed;
}
Exemplo n.º 9
0
//
// pre-emptively, we're preparing for very large persistent world (1mil+rooms).
// Something like this, it would be real nice to have database storage for.
// Alas, we're using flat files... so we're going to have to do some pretty
// creative hashing, so the folders don't overflow and become impossible to
// access. make two layers of directories, each with 500 folders. That will
// give us 4 room files to a folder, for a 1mil room persistent world. 
ROOM_DATA *worldGetPersistentRoom(WORLD_DATA *world, const char *key) {
  static char fname[MAX_BUFFER];
  if(!*key)
    return NULL;

  *fname = '\0';
  sprintf(fname, "%s/persistent/%lu/%lu/%s", 
	  worldGetPath(world),
	  pearson_hash8_1(key) % WORLD_BINS, 
	  pearson_hash8_2(key) % WORLD_BINS,
	  key);

  if(!file_exists(fname))
    return NULL;
  else {
    // log_string("%-30s get persistent: %s", key, fname);
    STORAGE_SET *set = storage_read(fname);
    ROOM_DATA  *room = roomRead(set);
    storage_close(set);
    worldPutRoom(world, key, room);
    room_to_game(room);
    return room;
  }
}
Exemplo n.º 10
0
void main(void)
{
    unsigned char* loadbuffer;
    int buffer_size;
    int rc;
    int(*kernel_entry)(void);

    system_init();
    kernel_init(); /* Need the kernel to sleep */

    enable_interrupt(IRQ_FIQ_STATUS);

    lcd_init();
    backlight_init();
    button_init();
    font_init();
    adc_init();

    lcd_setfont(FONT_SYSFIXED);
    
    /* These checks should only run if the bootloader is flashed */
    if(GSTATUS3&0x02)
    {
        GSTATUS3&=0xFFFFFFFD;
        if(!(GPGDAT&BUTTON_POWER) && charger_inserted())
        {
            while(!(GPGDAT&BUTTON_POWER) && charger_inserted())
            {
                char msg[20];
                if(charging_state())
                {
                    snprintf(msg,sizeof(msg),"Charging");
                }
                else
                {
                    snprintf(msg,sizeof(msg),"Charge Complete");
                }
                reset_screen();
                lcd_putsxy( (LCD_WIDTH - (SYSFONT_WIDTH * strlen(msg))) / 2,
                        (LCD_HEIGHT - SYSFONT_HEIGHT) / 2, msg);
                lcd_update();
                
#if defined(HAVE_RTC_ALARM)            
                /* Check if the alarm went off while charging */
                if(rtc_check_alarm_flag())
                {
                    GSTATUS3=1; /* Normally this is set in crt0.s */
                    break;
                }
#endif
            }
            if(!(GPGDAT&BUTTON_POWER) 
#if defined(HAVE_RTC_ALARM)
                && !GSTATUS3
#endif
                )
            {
                shutdown();
            }
        }

        if(button_hold())
        {
            const char msg[] = "HOLD is enabled";
            reset_screen();
            lcd_putsxy( (LCD_WIDTH - (SYSFONT_WIDTH * strlen(msg))) / 2,
                        (LCD_HEIGHT - SYSFONT_HEIGHT) / 2, msg);
            lcd_update();
            
            sleep(2*HZ);
            
            shutdown();
        }
    }

    power_init();
    usb_init();

    /* Enter USB mode without USB thread */
    if(usb_detect() == USB_INSERTED)
    {
        const char msg[] = "Bootloader USB mode";
        reset_screen();
        lcd_putsxy( (LCD_WIDTH - (SYSFONT_WIDTH * strlen(msg))) / 2,
                    (LCD_HEIGHT - SYSFONT_HEIGHT) / 2, msg);
        lcd_update();

        storage_enable(false);
        sleep(HZ/20);
        usb_enable(true);

        while (usb_detect() == USB_INSERTED)
            sleep(HZ);

        usb_enable(false);

        reset_screen();
        lcd_update();
    }
    
    reset_screen();

    /* Show debug messages if button is pressed */
    if(button_read_device()&BUTTON_A)
        verbose = true;

    printf("Rockbox boot loader");
    printf("Version %s", rbversion);

    sleep(50); /* ATA seems to error without this pause */

    rc = storage_init();
    if(rc)
    {
        reset_screen();
        error(EATA, rc, true);
    }

    filesystem_init();

    rc = disk_mount_all();
    if (rc<=0)
    {
        error(EDISK, rc, true);
    }

    printf("Loading firmware");

    /* Flush out anything pending first */
    commit_discard_idcache();

    loadbuffer = (unsigned char*) 0x31000000;
    buffer_size = (unsigned char*)0x31400000 - loadbuffer;

    rc = load_firmware(loadbuffer, BOOTFILE, buffer_size);
    if(rc <= EFILE_EMPTY)
        error(EBOOTFILE, rc, true);

    storage_close();
    system_prepare_fw_start();

    commit_discard_idcache();
    kernel_entry = (void*) loadbuffer;
    rc = kernel_entry();

#if 0
    /* Halt */
    while (1)
        core_idle();
#else
    /* Return and restart */
#endif
}
Exemplo n.º 11
0
static gboolean ril_get_net_config(struct radio_data *rsd)
{
	GKeyFile *keyfile;
	GError *err = NULL;
	char *config_path = RIL_CONFIG_DIR;
	char **alreadyset = NULL;
	gboolean needsconfig = FALSE;
	gboolean value = FALSE;
	gboolean found = FALSE;
	rsd->ratmode = PREF_NET_TYPE_GSM_WCDMA_AUTO;
	GDir *config_dir;
	const gchar *config_file;
	gsize length;
	gchar **codes = NULL;
	int i;

	/*
	 * First we need to check should the LTE be on
	 * or not
	 */

	keyfile = g_key_file_new();

	g_key_file_set_list_separator(keyfile, ',');

	config_dir = g_dir_open(config_path, 0, NULL);
	while ((config_file = g_dir_read_name(config_dir)) != NULL) {
		char *path = g_strconcat(RIL_CONFIG_DIR "/", config_file, NULL);
		DBG("Rilconfig handling %s", path);
		gboolean ok = g_key_file_load_from_file(keyfile, path, 0, &err);

		g_free(path);
		if (!ok) {
			g_error_free(err);
			DBG("Rilconfig file skipped");
			continue;
		}

		if (g_key_file_has_group(keyfile, LTE_FLAG))
			found = TRUE;
		else if (g_key_file_has_group(keyfile, MCC_LIST)) {
			codes = g_key_file_get_string_list(keyfile, MCC_LIST,
						MCC_KEY, &length, NULL);
			if (codes) {
				for (i = 0; codes[i]; i++) {
					if (g_str_equal(codes[i],
						ofono_sim_get_mcc(get_sim()))
							== TRUE) {
						found = TRUE;
						break;
					}
				}
				g_strfreev(codes);
			}
		}

		if (found) {
			rsd->ratmode = PREF_NET_TYPE_LTE_GSM_WCDMA;
			break;
		}
	}

	g_key_file_free(keyfile);
	g_dir_close(config_dir);

	/* Then we need to check if it already set */

	keyfile = storage_open(NULL, RIL_STORE);
	alreadyset = g_key_file_get_groups(keyfile, NULL);

	if (alreadyset[0])
		value = g_key_file_get_boolean(
			keyfile, alreadyset[0], LTE_FLAG, NULL);
	else if (rsd->ratmode == PREF_NET_TYPE_GSM_WCDMA_AUTO)
		value = TRUE;

	if (!value && rsd->ratmode == PREF_NET_TYPE_LTE_GSM_WCDMA) {
			g_key_file_set_boolean(keyfile,
				LTE_FLAG, LTE_FLAG, TRUE);
			needsconfig = TRUE;
	} else if (value && rsd->ratmode == PREF_NET_TYPE_GSM_WCDMA_AUTO) {
			g_key_file_set_boolean(keyfile,
				LTE_FLAG, LTE_FLAG, FALSE);
			needsconfig = TRUE;
	}

	g_strfreev(alreadyset);

	storage_close(NULL, RIL_STORE, keyfile, TRUE);

	return needsconfig;
}
Exemplo n.º 12
0
void* main(void)
{
    char filename[MAX_PATH];
    int i;
    int btn;
    int rc;
    int num_partitions;
    struct partinfo* pinfo;
#if !(CONFIG_STORAGE & STORAGE_SD)
    char buf[256];
    unsigned short* identify_info;
#endif
    int usb = USB_EXTRACTED;

    chksum_crc32gentab ();

    system_init();
    kernel_init();

#ifdef HAVE_BOOTLOADER_USB_MODE
    /* loader must service interrupts */
    enable_interrupt(IRQ_FIQ_STATUS);
#endif

    lcd_init();

    font_init();
    show_logo();

    adc_init();
#ifdef HAVE_BOOTLOADER_USB_MODE
    button_init_device();
#else
    button_init();
#endif
#if defined(SANSA_E200) || defined(PHILIPS_SA9200)
    i2c_init();
    _backlight_on();
#endif

    if (button_hold())
    {
        verbose = true;
        lcd_clear_display();
        printf("Hold switch on");
        printf("Shutting down...");
        sleep(HZ);
        power_off();
    }

    btn = button_read_device();

    /* Enable bootloader messages if any button is pressed */
#ifdef HAVE_BOOTLOADER_USB_MODE
    lcd_clear_display();
    if (btn)
        verbose = true;
#else
    if (btn) {
        lcd_clear_display();
        verbose = true;
    }
#endif

    lcd_setfont(FONT_SYSFIXED);

    printf("Rockbox boot loader");
    printf("Version: " RBVERSION);
    printf(MODEL_NAME);

    i=storage_init();
#if !(CONFIG_STORAGE & STORAGE_SD)
    if (i==0) {
        identify_info=ata_get_identify();
        /* Show model */
        for (i=0; i < 20; i++) {
            ((unsigned short*)buf)[i]=htobe16(identify_info[i+27]);
        }
        buf[40]=0;
        for (i=39; i && buf[i]==' '; i--) {
            buf[i]=0;
        }
        printf(buf);
    } else {
        error(EATA, i, true);
    }
#endif

    disk_init(IF_MV(0));
    num_partitions = disk_mount_all();
    if (num_partitions<=0)
    {
        error(EDISK,num_partitions, true);
    }

    /* Just list the first 2 partitions since we don't have any devices yet 
       that have more than that */
    for(i=0; i<NUM_PARTITIONS; i++)
    {
        pinfo = disk_partinfo(i);
        printf("Partition %d: 0x%02x %ld MB",
                i, pinfo->type, pinfo->size / 2048);
    }

    /* Now that storage is initialized, check for USB connection */
    if ((btn & BOOTLOADER_BOOT_OF) == 0)
    {
        usb_pin_init();
        usb = handle_usb(HZ*2);
        if (usb == USB_INSERTED)
            btn |= BOOTLOADER_BOOT_OF;
    }

    /* Try loading Rockbox, if that fails, fall back to the OF */
    if((btn & BOOTLOADER_BOOT_OF) == 0)
    {
        printf("Loading Rockbox...");
        snprintf(filename,sizeof(filename), BOOTDIR "/%s", BOOTFILE);

        rc = load_mi4(loadbuffer, filename, MAX_LOADSIZE);
        if (rc <= EFILE_EMPTY)
        {
            bool old_verbose = verbose;
            verbose = true;
            printf("Can't load " BOOTFILE ": ");
            printf(loader_strerror(rc));
            verbose = old_verbose;
            btn |= BOOTLOADER_BOOT_OF;
            sleep(5*HZ);
        }
        else
            goto main_exit;
    }

    if(btn & BOOTLOADER_BOOT_OF)
    {
        /* Load original mi4 firmware in to a memory buffer called loadbuffer.
           The rest of the loading is done in crt0.S.
           1) First try reading from the hidden partition (on Sansa only).
           2) Next try a decrypted mi4 file in /System/OF.mi4
           3) Finally, try a raw firmware binary in /System/OF.bin. It should be
              a mi4 firmware decrypted and header stripped using mi4code.
        */
        printf("Loading original firmware...");

#if (CONFIG_STORAGE & STORAGE_SD)
        /* First try a (hidden) firmware partition */
        printf("Trying firmware partition");
        pinfo = disk_partinfo(1);
        if(pinfo->type == PARTITION_TYPE_OS2_HIDDEN_C_DRIVE)
        {
            rc = load_mi4_part(loadbuffer, pinfo, MAX_LOADSIZE,
                               usb == USB_INSERTED);
            if (rc <= EFILE_EMPTY) {
                printf("Can't load from partition");
                printf(loader_strerror(rc));
            } else {
                goto main_exit;
            }
        } else {
            printf("No hidden partition found.");
        }
#endif

#if defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) || defined(PHILIPS_SA9200)
        printf("Trying /System/OF.ebn");
        rc=load_mi4(loadbuffer, "/System/OF.ebn", MAX_LOADSIZE);
        if (rc <= EFILE_EMPTY) {
            printf("Can't load /System/OF.ebn");
            printf(loader_strerror(rc));
        } else {
            goto main_exit;
        }
#endif

        printf("Trying /System/OF.mi4");
        rc=load_mi4(loadbuffer, "/System/OF.mi4", MAX_LOADSIZE);
        if (rc <= EFILE_EMPTY) {
            printf("Can't load /System/OF.mi4");
            printf(loader_strerror(rc));
        } else {
#if defined(SAMSUNG_YH925)
            lcd_reset();
#endif
            goto main_exit;
        }

        printf("Trying /System/OF.bin");
        rc=load_raw_firmware(loadbuffer, "/System/OF.bin", MAX_LOADSIZE);
        if (rc <= EFILE_EMPTY) {
            printf("Can't load /System/OF.bin");
            printf(loader_strerror(rc));
        } else {
#if defined(SAMSUNG_YH925)
            lcd_reset();
#endif
            goto main_exit;
        }
        
        error(0, 0, true);
    }

main_exit:
#ifdef HAVE_BOOTLOADER_USB_MODE
    storage_close();
    system_prepare_fw_start();
#endif

    return (void*)loadbuffer;
}
Exemplo n.º 13
0
//
// close a storage set, and clean up its memory
PyObject *PyStorageSet_close      (PyObject *self, PyObject *args) { 
  storage_close(((PyStorageSet *)self)->set);
  ((PyStorageSet *)self)->set = NULL;
  return Py_BuildValue("i", 1);
}