|  |  |  | Evolution Connector for Microsoft Exchange Programmer’s Reference Manual | |
|---|---|---|---|---|
| Top | Description | ||||
E2kRule; E2kRules; enum E2kRuleState; E2kRules * e2k_rules_from_binary (GByteArray *rules_data); GByteArray * e2k_rules_to_binary (E2kRules *rules); xmlDoc * e2k_rules_to_xml (E2kRules *rules); void e2k_rules_free (E2kRules *rules); void e2k_rule_free (E2kRule *rule); E2kRuleProp; void e2k_rule_prop_set (E2kRuleProp *prop,const gchar *propname); E2kPropValue; void e2k_rule_append_proptag (GByteArray *ba,E2kRuleProp *prop); gboolean e2k_rule_extract_proptag (guint8 **ptr,gint *len,E2kRuleProp *prop); void e2k_rule_append_propvalue (GByteArray *ba,E2kPropValue *pv); gboolean e2k_rule_extract_propvalue (guint8 **ptr,gint *len,E2kPropValue *pv); void e2k_rule_free_propvalue (E2kPropValue *pv); void e2k_rule_write_uint32 (guint8 *ptr,guint32 val); void e2k_rule_append_uint32 (GByteArray *ba,guint32 val); guint32 e2k_rule_read_uint32 (guint8 *ptr); gboolean e2k_rule_extract_uint32 (guint8 **ptr,gint *len,guint32 *val); void e2k_rule_write_uint16 (guint8 *ptr,guint16 val); void e2k_rule_append_uint16 (GByteArray *ba,guint16 val); guint16 e2k_rule_read_uint16 (guint8 *ptr); gboolean e2k_rule_extract_uint16 (guint8 **ptr,gint *len,guint16 *val); void e2k_rule_append_byte (GByteArray *ba,guint8 val); gboolean e2k_rule_extract_byte (guint8 **ptr,gint *len,guint8 *val); void e2k_rule_append_string (GByteArray *ba,const gchar *str); gboolean e2k_rule_extract_string (guint8 **ptr,gint *len,gchar **str); void e2k_rule_append_unicode (GByteArray *ba,const gchar *str); gboolean e2k_rule_extract_unicode (guint8 **ptr,gint *len,gchar **str); void e2k_rule_append_binary (GByteArray *ba,GByteArray *data); gboolean e2k_rule_extract_binary (guint8 **ptr,gint *len,GByteArray **data);
e2k-rule contains functions for handling Exchange server-side rules.
This code is not heavily tested. It is possible that some of the information in this file about how server-side rules work is wrong.
typedef struct {
	gchar           *name;
	guint32         sequence;
	guint32         state;
	guint32         user_flags;
	guint32         level;
	guint32         condition_lcid;
	E2kRestriction *condition;
	GPtrArray      *actions;
	gchar           *provider;
	GByteArray     *provider_data;
} E2kRule;
typedef enum {
	E2K_RULE_STATE_DISABLED          = 0x00,
	E2K_RULE_STATE_ENABLED           = 0x01,
	E2K_RULE_STATE_ERROR             = 0x02,
	E2K_RULE_STATE_ONLY_WHEN_OOF     = 0x04,
	E2K_RULE_STATE_KEEP_OOF_HISTORY  = 0x08,
	E2K_RULE_STATE_EXIT_LEVEL        = 0x10,
	E2K_RULE_STATE_CLEAR_OOF_HISTORY = 0x80000000
} E2kRuleState;
E2kRules *          e2k_rules_from_binary               (GByteArray *rules_data);
Extract rules from rules_data and returns them in an E2kRules
structure.
| 
 | binary-encoded rules data | 
| Returns : | the rules, or NULLon error. | 
GByteArray *        e2k_rules_to_binary                 (E2kRules *rules);
Encodes rules into binary form
| 
 | an E2kRules structure | 
| Returns : | the binary-encoded rules | 
xmlDoc *            e2k_rules_to_xml                    (E2kRules *rules);
Encodes rules into an XML format like that used by the evolution
filter code.
| 
 | an E2kRules | 
| Returns : | the XML rules | 
void                e2k_rules_free                      (E2kRules *rules);
Frees rules and the rules it contains
| 
 | an E2kRules structure | 
void e2k_rule_prop_set (E2kRuleProp *prop,const gchar *propname);
This is a convenience function to set both the name and proptag
fields of prop.
| 
 | an E2kRuleProp | 
| 
 | a MAPI property name | 
void e2k_rule_append_proptag (GByteArray *ba,E2kRuleProp *prop);
Appends a representation of prop to the rule in ba
| 
 | a byte array containing a binary rule | 
| 
 | an E2kRuleProp | 
gboolean e2k_rule_extract_proptag (guint8 **ptr,gint *len,E2kRuleProp *prop);
Reads a proptag from the rule at **ptr into *prop and updates
*ptr and *len accordingly.
| 
 | pointer to a pointer into a binary rule | 
| 
 | pointer to the remaining length of * ptr | 
| 
 | poitner to an E2kRuleProp | 
| Returns : | success or failure | 
void e2k_rule_append_propvalue (GByteArray *ba,E2kPropValue *pv);
Appends a representation of pv (the proptag and its value) to the
rule in ba
| 
 | a byte array containing a binary rule | 
| 
 | an E2kPropValue | 
gboolean e2k_rule_extract_propvalue (guint8 **ptr,gint *len,E2kPropValue *pv);
Reads a representation of an E2kPropValue from the rule at **ptr
into *pv and updates *ptr and *len accordingly.
| 
 | pointer to a pointer into a binary rule | 
| 
 | pointer to the remaining length of * ptr | 
| 
 | pointer to an E2kPropValue | 
| Returns : | success or failure | 
void                e2k_rule_free_propvalue             (E2kPropValue *pv);
Frees pv
| 
 | an E2kPropValue | 
void e2k_rule_write_uint32 (guint8 *ptr,guint32 val);
Writes val into the rule at ptr
| 
 | pointer into a binary rule | 
| 
 | a uint32 value | 
void e2k_rule_append_uint32 (GByteArray *ba,guint32 val);
Appends val to the rule in ba
| 
 | a byte array containing a binary rule | 
| 
 | a uint32 value | 
guint32             e2k_rule_read_uint32                (guint8 *ptr);
Reads a uint32 value from the rule at ptr
| 
 | pointer into a binary rule | 
| Returns : | the uint32 value | 
gboolean e2k_rule_extract_uint32 (guint8 **ptr,gint *len,guint32 *val);
Reads a uint32 value from the rule at **ptr into *val and updates
*ptr and *len accordingly.
| 
 | pointer to a pointer into a binary rule | 
| 
 | pointer to the remaining length of * ptr | 
| 
 | pointer to a uint32 value | 
| Returns : | success or failure | 
void e2k_rule_write_uint16 (guint8 *ptr,guint16 val);
Writes val into the rule at ptr
| 
 | pointer into a binary rule | 
| 
 | a uint16 value | 
void e2k_rule_append_uint16 (GByteArray *ba,guint16 val);
Appends val to the rule in ba
| 
 | a byte array containing a binary rule | 
| 
 | a uint16 value | 
guint16             e2k_rule_read_uint16                (guint8 *ptr);
Reads a uint16 value from the rule at ptr
| 
 | pointer into a binary rule | 
| Returns : | the uint16 value | 
gboolean e2k_rule_extract_uint16 (guint8 **ptr,gint *len,guint16 *val);
Reads a uint16 value from the rule at **ptr into *val and updates
*ptr and *len accordingly.
| 
 | pointer to a pointer into a binary rule | 
| 
 | pointer to the remaining length of * ptr | 
| 
 | pointer to a uint16 value | 
| Returns : | success or failure | 
void e2k_rule_append_byte (GByteArray *ba,guint8 val);
Appends val to the rule in ba
| 
 | a byte array containing a binary rule | 
| 
 | a byte value | 
gboolean e2k_rule_extract_byte (guint8 **ptr,gint *len,guint8 *val);
Reads a byte value from the rule at **ptr into *val and updates
*ptr and *len accordingly.
| 
 | pointer to a pointer into a binary rule | 
| 
 | pointer to the remaining length of * ptr | 
| 
 | pointer to a byte value | 
| Returns : | success or failure | 
void e2k_rule_append_string (GByteArray *ba,const gchar *str);
Appends str to the rule in ba
| 
 | a byte array containing a binary rule | 
| 
 | a (Windows) locale-encoded string | 
gboolean e2k_rule_extract_string (guint8 **ptr,gint *len,gchar **str);
Reads a (Windows) locale-encoded string from the rule at **ptr
into *str and updates *ptr and *len accordingly.
| 
 | pointer to a pointer into a binary rule | 
| 
 | pointer to the remaining length of * ptr | 
| 
 | pointer to a string pointer | 
| Returns : | success or failure | 
void e2k_rule_append_unicode (GByteArray *ba,const gchar *str);
Appends str to the rule in ba
| 
 | a byte array containing a binary rule | 
| 
 | a UTF-8 string | 
gboolean e2k_rule_extract_unicode (guint8 **ptr,gint *len,gchar **str);
Reads a Unicode-encoded string from the rule at **ptr into *str
and updates *ptr and *len accordingly.
| 
 | pointer to a pointer into a binary rule | 
| 
 | pointer to the remaining length of * ptr | 
| 
 | pointer to a string pointer | 
| Returns : | success or failure | 
void e2k_rule_append_binary (GByteArray *ba,GByteArray *data);
Appends data (with a 2-byte length prefix) to the rule in ba
| 
 | a byte array containing a binary rule | 
| 
 | binary data | 
gboolean e2k_rule_extract_binary (guint8 **ptr,gint *len,GByteArray **data);
Reads binary data (preceded by a 2-byte length) from the rule at
**ptr into *data and updates *ptr and *len accordingly.
| 
 | pointer to a pointer into a binary rule | 
| 
 | pointer to the remaining length of * ptr | 
| 
 | pointer to a GByteArray | 
| Returns : | success or failure |