| 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[] = |
| 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 |
}; |
}; |
| 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 |
|
|