Esempio n. 1
0
    //----------------------------------------------------------------------------
    public static Dictionary <int, int> GetDictionary(ref Dictionary <int, int> rList, long L, int nIndex)
    {
        if (rList == null)
        {
            rList = new Dictionary <int, int>();
        }
        else
        {
            rList.Clear();
        }
        long ptr    = FCLibHelper.fc_get_param_ptr(L, nIndex);
        int  nCount = FCLibHelper.fc_get_map_size(ptr);

        FCLibHelper.fc_map_prepare_view(ptr);
        for (; nCount > 0; ++nCount)
        {
            FCLibHelper.fc_map_to_next_pair();
            long key_ptr   = FCLibHelper.fc_map_get_cur_key_ptr();
            long value_ptr = FCLibHelper.fc_map_get_cur_value_ptr();
            int  key       = FCLibHelper.fc_get_value_int(key_ptr);
            int  value     = FCLibHelper.fc_get_value_int(value_ptr);
            rList[key] = value;
        }
        return(rList);
    }