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.40 by aga4096, Wed May 18 10:00:17 2005 UTC revision 1.41 by aga4096, Tue Jun 14 01:02:20 2005 UTC
# Line 146  ZEND_FUNCTION(xnp_get_own_public_item_id Line 146  ZEND_FUNCTION(xnp_get_own_public_item_id
146  ZEND_FUNCTION(xnp_zip_create               );  ZEND_FUNCTION(xnp_zip_create               );
147  ZEND_FUNCTION(xnp_get_item_count           );  ZEND_FUNCTION(xnp_get_item_count           );
148  ZEND_FUNCTION(xnp_get_item_count_group_by_index );  ZEND_FUNCTION(xnp_get_item_count_group_by_index );
149    
150    ZEND_FUNCTION(xnp_extract_public_item_id);
151    ZEND_FUNCTION(xnp_extract_nonbinder_item_id);
152  };  };
153  /* compiled function list so Zend knows what's in this module */  /* compiled function list so Zend knows what's in this module */
154  zend_function_entry xnpalmod_functions[] =  zend_function_entry xnpalmod_functions[] =
# Line 244  zend_function_entry xnpalmod_functions[] Line 247  zend_function_entry xnpalmod_functions[]
247      ZEND_FE(xnp_get_item_count           ,NULL)      ZEND_FE(xnp_get_item_count           ,NULL)
248      ZEND_FE(xnp_get_item_count_group_by_index ,NULL)      ZEND_FE(xnp_get_item_count_group_by_index ,NULL)
249    
250        ZEND_FE(xnp_extract_public_item_id,NULL)
251        ZEND_FE(xnp_extract_nonbinder_item_id,NULL)
252          {NULL, NULL, NULL}          {NULL, NULL, NULL}
253  };  };
254    
# Line 3562  ZEND_FUNCTION(xnp_get_item_count_group_b Line 3567  ZEND_FUNCTION(xnp_get_item_count_group_b
3567          RETURN_LONG(result);          RETURN_LONG(result);
3568  }  }
3569    
3570    /**
3571     * アイテムIDの中から,公開のものを抽出.
3572     *
3573     * int xnp_extract_public_item_id( int sid, array iids, array public_iids )
3574     * @param sid セッションID
3575     * @param iids item_idの配列
3576     * @param public_iids 取得結果を受け取る配列
3577     * @return RES_OK
3578     * @return RES_DB_NOT_INITIALIZED
3579     * @return RES_NO_SUCH_SESSION
3580     * @return RES_DB_QUERY_ERROR
3581     *
3582     */
3583    ZEND_FUNCTION(xnp_extract_public_item_id)
3584    {
3585            long sid;
3586            zval *ziids;
3587            zval *zpublic_iids;
3588            result_t result = RES_ERROR;
3589    
3590            if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "laa",
3591                                                              &sid, &ziids, &zpublic_iids) == FAILURE) {
3592                    fprintf( stderr, "error occured " );
3593                    return;
3594            }
3595    
3596            zIIDs_t zIIDs(ziids);
3597            result = zIIDs.getResult();
3598            if ( RES_OK == result ){
3599                    itemid_t *piids;
3600                    int iidsLen;
3601                    result = extractPublicItemId( (sessionid_t)sid,
3602                            zIIDs.getPIID(), zIIDs.getLen(), &piids, &iidsLen );
3603                    if ( RES_OK == result ){
3604                            itemidsToZval( piids, iidsLen, &zpublic_iids );
3605                            freeItemID( piids );
3606                    }
3607            }
3608    
3609            RETURN_LONG( result );
3610    }
3611    
3612    /**
3613     * アイテムIDの中から,Binderでないものを抽出.
3614     *
3615     * int xnp_extract_nonbinder_item_id( int sid, array iids, array nonbinder_iids )
3616     * @param sid セッションID
3617     * @param iids item_idの配列
3618     * @param iids 取得結果を受け取る配列
3619     * @return RES_OK
3620     * @return RES_DB_NOT_INITIALIZED
3621     * @return RES_NO_SUCH_SESSION
3622     * @return RES_DB_QUERY_ERROR
3623     *
3624     */
3625    ZEND_FUNCTION(xnp_extract_nonbinder_item_id)
3626    {
3627            long sid;
3628            zval *ziids;
3629            zval *znonbinder_iids;
3630            result_t result = RES_ERROR;
3631    
3632            if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "laa",
3633                                                              &sid, &ziids, &znonbinder_iids) == FAILURE) {
3634                    fprintf( stderr, "error occured " );
3635                    return;
3636            }
3637    
3638            zIIDs_t zIIDs(ziids);
3639            result = zIIDs.getResult();
3640            if ( RES_OK == result ){
3641                    itemid_t *piids;
3642                    int iidsLen;
3643                    result = extractNonbinderItemId( (sessionid_t)sid,
3644                            zIIDs.getPIID(), zIIDs.getLen(), &piids, &iidsLen );
3645                    if ( RES_OK == result ){
3646                            itemidsToZval( piids, iidsLen, &znonbinder_iids );
3647                            freeItemID( piids );
3648                    }
3649            }
3650    
3651            RETURN_LONG( result );
3652    }

Legend:
Removed from v.1.40  
changed lines
  Added in v.1.41

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