Rule
[Protocol Common Services]


Detailed Description

Common Rule APIs.


POSTAL RULE PROPERTIES

Defines rule properties.

#define ALP_POSTAL_PROPERTY_RULE_ACTION   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_INT, 7)
 The action to be applied.
#define ALP_POSTAL_PROPERTY_RULE_ADDRESS_CLASS   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_INT, 5)
 The main address class on which the rules apply.
#define ALP_POSTAL_PROPERTY_RULE_ADDRESS_NAME   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_C_STRING, 2)
 The main address name on which the rules apply.
#define ALP_POSTAL_PROPERTY_RULE_ADDRESS_SCHEME   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_INT, 4)
 The main address scheme on which the rules apply.
#define ALP_POSTAL_PROPERTY_RULE_ADDRESS_STRING   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_C_STRING, 3)
 The main address value on which the rules apply.
#define ALP_POSTAL_PROPERTY_RULE_FOLDER_ID   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_INT, 8)
 Possible folder id associated with the action.
#define ALP_POSTAL_PROPERTY_RULE_ID   ALP_POSTAL_PROPERTY_READ_ONLY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_INT, 1)
 The rule storage identifier.
#define ALP_POSTAL_PROPERTY_RULE_KEYWORD   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_C_STRING, 6)
 The keyword on which the rules apply.
#define ALP_POSTAL_PROPERTY_RULE_UNIQUE_ADDRESS_STRING   ALP_POSTAL_PROPERTY_READ_ONLY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_C_STRING, 9)
 The unique address string on which the rules apply.

POSTAL ACCOUNT RULES LIST

Defines the account rule list types.

#define ALP_POSTAL_RULE_ACTION_ALL   ((alp_postal_rule_action_t)4)
 All Actions.
#define ALP_POSTAL_RULE_ACTION_BLOCK   ((alp_postal_rule_action_t)2)
 Block.
#define ALP_POSTAL_RULE_ACTION_GRANT   ((alp_postal_rule_action_t)1)
 Grant.
#define ALP_POSTAL_RULE_ACTION_INVALID   ((alp_postal_rule_action_t)0)
 Invalid action.
#define ALP_POSTAL_RULE_ACTION_MOVE_TO   ((alp_postal_rule_action_t)3)
 Move To.

Defines

#define ALP_POSTAL_RULE_INVALID_ID   ((alp_postal_rule_id_t)ALP_POSTAL_INVALID_OBJECT_ID)
 Invalid Rule ID definition.

Typedefs

typedef uint8_t alp_postal_rule_action_t
 Account rules type.
typedef _AlpPostalPropertyList AlpPostalRule
 AlpPostalRule.

Functions

alp_status_t alp_postal_rule_delete (alp_postal_service_id_t iServiceId, alp_postal_rule_id_t iRuleId)
 Remove a rule from the database.
alp_status_t alp_postal_rule_free (AlpPostalRule *iRuleP)
 Free a rule.
alp_status_t alp_postal_rule_get_property (AlpPostalRule *iRuleP, alp_postal_property_id_t iPropertyId, AlpPostalProperty **oRulePropertyP)
 Retrieve a property from a Postal Rule.
alp_status_t alp_postal_rule_init (AlpPostalRule *iRuleP)
 Initialize a rule. MUST be called before use.
alp_status_t alp_postal_rule_init_enumerator (AlpPostalEnumerator *iEnumeratorP)
 Initialize a rule enumerator. MUST be called before get_rule_enumerator().
alp_status_t alp_postal_rule_load (alp_postal_service_id_t iServiceId, alp_postal_rule_id_t iRuleId, AlpPostalRule *oRuleP)
 Load a rule from the database.
alp_status_t alp_postal_rule_release_enumerator (AlpPostalEnumerator *iEnumeratorP)
 free data into the enumerator and release it, must be called when data access is over.
alp_status_t alp_postal_rule_set_address (AlpPostalRule *ioRuleP, alp_postal_rule_action_t iAction, alp_postal_folder_id_t iFolderId, AlpPostalAddress *iAddressP)
 Set an an address into the rule.
alp_status_t alp_postal_rule_set_property (AlpPostalRule *ioRuleP, alp_postal_property_id_t iRulePropertyId, alp_postal_property_const_value_t iRulePropertyDataP, uint16_t iRulePropertyDataSize)
 Set a property to a Postal Rule.


Define Documentation

#define ALP_POSTAL_PROPERTY_RULE_ACTION   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_INT, 7)
 

The action to be applied.

#define ALP_POSTAL_PROPERTY_RULE_ADDRESS_CLASS   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_INT, 5)
 

The main address class on which the rules apply.

#define ALP_POSTAL_PROPERTY_RULE_ADDRESS_NAME   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_C_STRING, 2)
 

The main address name on which the rules apply.

#define ALP_POSTAL_PROPERTY_RULE_ADDRESS_SCHEME   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_INT, 4)
 

The main address scheme on which the rules apply.

#define ALP_POSTAL_PROPERTY_RULE_ADDRESS_STRING   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_C_STRING, 3)
 

The main address value on which the rules apply.

#define ALP_POSTAL_PROPERTY_RULE_FOLDER_ID   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_INT, 8)
 

Possible folder id associated with the action.

#define ALP_POSTAL_PROPERTY_RULE_ID   ALP_POSTAL_PROPERTY_READ_ONLY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_INT, 1)
 

The rule storage identifier.

#define ALP_POSTAL_PROPERTY_RULE_KEYWORD   ALP_POSTAL_PROPERTY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_C_STRING, 6)
 

The keyword on which the rules apply.

#define ALP_POSTAL_PROPERTY_RULE_UNIQUE_ADDRESS_STRING   ALP_POSTAL_PROPERTY_READ_ONLY(ALP_POSTAL_SERVICE_ID_COMMON, ALP_POSTAL_SERVICE_CLASS_ID_RULE, ALP_POSTAL_PROPERTY_TYPE_C_STRING, 9)
 

The unique address string on which the rules apply.

#define ALP_POSTAL_RULE_ACTION_ALL   ((alp_postal_rule_action_t)4)
 

All Actions.

#define ALP_POSTAL_RULE_ACTION_BLOCK   ((alp_postal_rule_action_t)2)
 

Block.

#define ALP_POSTAL_RULE_ACTION_GRANT   ((alp_postal_rule_action_t)1)
 

Grant.

#define ALP_POSTAL_RULE_ACTION_INVALID   ((alp_postal_rule_action_t)0)
 

Invalid action.

#define ALP_POSTAL_RULE_ACTION_MOVE_TO   ((alp_postal_rule_action_t)3)
 

Move To.

#define ALP_POSTAL_RULE_INVALID_ID   ((alp_postal_rule_id_t)ALP_POSTAL_INVALID_OBJECT_ID)
 

Invalid Rule ID definition.


Typedef Documentation

typedef uint8_t alp_postal_rule_action_t
 

Account rules type.

typedef struct _AlpPostalPropertyList AlpPostalRule
 

AlpPostalRule.


Function Documentation

alp_status_t alp_postal_rule_delete alp_postal_service_id_t  iServiceId,
alp_postal_rule_id_t  iRuleId
 

Remove a rule from the database.

Parameters:
[in] iServiceId The serviceId that is unique among all services.
[in] iRuleId the unique id of the rule.
Returns:
Returns an error code.

alp_status_t alp_postal_rule_free AlpPostalRule iRuleP  ) 
 

Free a rule.

Parameters:
[in] iRuleP The Postal Rule to be freed.

alp_status_t alp_postal_rule_get_property AlpPostalRule iRuleP,
alp_postal_property_id_t  iPropertyId,
AlpPostalProperty **  oRulePropertyP
 

Retrieve a property from a Postal Rule.

Parameters:
[in] iRuleP The Postal Rule in which a property must be retrieved.
[in] iPropertyId A rule property Id.
[out] oRulePropertyP The Postal Rule property to be retrieved.
Returns:
Returns an error code.

alp_status_t alp_postal_rule_init AlpPostalRule iRuleP  ) 
 

Initialize a rule. MUST be called before use.

Parameters:
[in] iRuleP The Postal Rule to be initialized.

alp_status_t alp_postal_rule_init_enumerator AlpPostalEnumerator iEnumeratorP  ) 
 

Initialize a rule enumerator. MUST be called before get_rule_enumerator().

Parameters:
[in] iEnumeratorP The enumerator to initialize.
Returns:
Returns an error code.

alp_status_t alp_postal_rule_load alp_postal_service_id_t  iServiceId,
alp_postal_rule_id_t  iRuleId,
AlpPostalRule oRuleP
 

Load a rule from the database.

Parameters:
[in] iServiceId The serviceId that is unique among all services.
[in] iRuleId the unique id of the rule.
[out] oRuleP The returned rule.
Returns:
Returns an error code.

alp_status_t alp_postal_rule_release_enumerator AlpPostalEnumerator iEnumeratorP  ) 
 

free data into the enumerator and release it, must be called when data access is over.

Parameters:
[in] iEnumeratorP The enumerator to release.
Returns:
Returns an error code.

alp_status_t alp_postal_rule_set_address AlpPostalRule ioRuleP,
alp_postal_rule_action_t  iAction,
alp_postal_folder_id_t  iFolderId,
AlpPostalAddress iAddressP
 

Set an an address into the rule.

Parameters:
[in,out] ioRuleP The Postal Rule in which the address must be set.
[in] iAction The action associated to this rule.
[in] iFolderId The Possible folder Id associated with the action (treated only with ALP_POSTAL_RULE_ACTION_MOVE_TO).
[in] iAddressP 
Returns:
Returns an error code.

alp_status_t alp_postal_rule_set_property AlpPostalRule ioRuleP,
alp_postal_property_id_t  iRulePropertyId,
alp_postal_property_const_value_t  iRulePropertyDataP,
uint16_t  iRulePropertyDataSize
 

Set a property to a Postal Rule.

Parameters:
[in,out] ioRuleP The Postal Rule in which a property must be set.
[in] iRulePropertyId The Id of the property to be created.
[in] iRulePropertyDataP The value of the property to be created.
[in] iRulePropertyDataSize The size of the data, strlen+1 if it's a string
Returns:
Returns an error code.


Generated on Wed Jul 30 07:06:43 2008 by Doxygen 1.4.6 for ALP SDK + Hiker Documentation

Copyright © 1999-2008 ACCESS CO., LTD. All rights reserved.