Develop and Download Open Source Software

Browse CVS Repository

Diff of /xoonips/AL/xnpal.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.37 by tani, Sat Feb 26 05:11:31 2005 UTC revision 1.38 by aga4096, Sat Mar 5 01:48:36 2005 UTC
# Line 126  ZEND_FUNCTION(xnp_get_own_public_item_id Line 126  ZEND_FUNCTION(xnp_get_own_public_item_id
126    
127  ZEND_FUNCTION(xnp_zip_create               );  ZEND_FUNCTION(xnp_zip_create               );
128  ZEND_FUNCTION(xnp_get_item_count           );  ZEND_FUNCTION(xnp_get_item_count           );
129    ZEND_FUNCTION(xnp_get_item_count_group_by_index );
130  };  };
131  /* compiled function list so Zend knows what's in this module */  /* compiled function list so Zend knows what's in this module */
132  zend_function_entry xnpalmod_functions[] =  zend_function_entry xnpalmod_functions[] =
# Line 222  zend_function_entry xnpalmod_functions[] Line 223  zend_function_entry xnpalmod_functions[]
223    
224      ZEND_FE(xnp_zip_create               ,NULL)      ZEND_FE(xnp_zip_create               ,NULL)
225      ZEND_FE(xnp_get_item_count           ,NULL)      ZEND_FE(xnp_get_item_count           ,NULL)
226        ZEND_FE(xnp_get_item_count_group_by_index ,NULL)
227    
228          {NULL, NULL, NULL}          {NULL, NULL, NULL}
229  };  };
# Line 3503  ZEND_FUNCTION(xnp_get_item_count) Line 3505  ZEND_FUNCTION(xnp_get_item_count)
3505          RETURN_LONG(count);          RETURN_LONG(count);
3506  }  }
3507    
3508    /** Readアクセス可能なインデックス毎の、直下のアイテム数を得る<br>
3509            int xnp_item_count_group_by_index( int xnp_session_id, array counts );
3510            @param xnp_session_id   XNPのセッションID
3511            @param counts アイテム数を受け取る連想配列.キーはindex_idで値はアイテム数.
3512        @return RES_OK
3513        @return RES_DB_NOT_INITIALIZED
3514        @return RES_NO_SUCH_SESSION
3515        @return RES_DB_QUERY_ERROR
3516      */
3517    ZEND_FUNCTION(xnp_get_item_count_group_by_index)
3518    {
3519            long sid;
3520            zval *zcounts;
3521            
3522            if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "la",
3523              &sid, &zcounts) == FAILURE) {
3524                    return;
3525            }
3526            
3527            indexid_t *xids;
3528            int xidsLen;
3529            int *counts;
3530            result_t result = getItemCountGroupByIndex( (sessionid_t)sid, &xids, &xidsLen, &counts );
3531            if ( RES_OK == result ){
3532                    zend_hash_clean( Z_ARRVAL_P(zcounts) );
3533                    
3534                    // add IDs
3535                    for ( int i = 0; i < xidsLen; i++ ){
3536                            add_index_long(zcounts, (uint)(xids[i]), (long)(counts[i]) );
3537                    }
3538                    freeIndexID( xids );
3539                    freeInt( counts );
3540            }
3541            
3542            RETURN_LONG(result);
3543    }
3544    

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26