Parse an address and return the requested address property.
argument informationstatus = PMDF_get_address_property
(address, property, result, result_len)
| Argument | Data type | Access | Mechanism |
|---|---|---|---|
| address | descriptor | read | reference |
| property | integer | read | value |
| result | descriptor | read/write | reference |
| result_len | unsigned word | write | reference |
argument informationstatus = PMDFgetAddressProperty
(address, address_len, property, result, result_len)
int PMDFgetAddressProperty (address, address_len, property,
result, result_len)
char *address;
int address_len;
int property
char *result;
int *result_len;
address
The address to parse. Length of this string may not exceed BIGALFA_SIZE bytes.address_len
Length in bytes of the address to parse.property
The address property to return.result
String to receive the address property. Must be at least ALFA_SIZE bytes in length. (ALFA_SIZE+1 bytes for PMDFgetAddressProperty.)result_len
Length in bytes of the returned property. Callers using PMDFgetAddressProperty must, on input, supply the maximum length in bytes of result.
PMDF_get_address_property may be used to parse an address and return the desired property. Moreover, PMDF_get_address_property can be used to see if an address is syntactically legal and to clean up addresses with minor syntax problems. The former is accomplished by seeing if PMDF__PARSE is returned and the latter by requesting the PMDF_PROP_PROPER property. The accepted values for property are shown below and refer to an address of the formReturn Valuesphrase <@otherhost:user@host> (comment)The PMDF_PROP_FRIENDLY property may be used to attempt to extract a human name from the address. When this property is requested, the following steps are used to determine the value to return:
Symbolic name Value Description PMDF_PROP_ADDRESS 1 Address part, @ otherhost: user@ host, of the addressPMDF_PROP_DOMAIN 2 Domain part, host, of the addressPMDF_PROP_FRIENDLY 3 See description below PMDF_PROP_LOCAL 4 Local part, user, of the addressPMDF_PROP_PHRASE 5 Phrase part, phrase, of the address, if anyPMDF_PROP_PROPER 6 Full address including any phrases and comments PMDF_PROP_ROUTE 7 Source route part, @ otherhost:, of the address, if any
- If a RFC 822 phrase
phraseis present, then return it, else- If at least one RFC 822 comment
commentis present, then return the first one, else- If the local part
useris not a RFC 1327 AVPL, then return the local part, else- If a string of the form
/pn=value/is present in the local part, then replace any dots invaluewith spaces and return that, else- If a string of the form
/s=svalue/is not present in the local part, then return the local part, else- If a string of the form
/g=gvalue/is present in the local part then returngvalue svalue, otherwise- Return
svalue. Note that PMDF_get_address_property can only handle a single address of length up to but not exceeding BIGALFA_SIZE bytes. If more than one address is present in the string, then PMDF:NO will be returned. So, if the address is longer than BIGALFA_SIZE bytes or more than one address may be present, PMDF_address_parse_list and PMDF_address_get_property should instead be used.
| PMDF__OK | Normal, successful completion. |
| PMDF__BAD | Bad parameter supplied: invalid value for property. No result returned. |
| PMDF__FATERRLIB | Call to LIB$SCOPY_R_DX failed owing to a fatal internal error in the OpenVMS Run Time Library. No result returned. |
| PMDF__INSVIRMEM | Insufficient virtual memory: call to LIB$GET_VM made by LIB$SCOPY_R_DX has failed. No result returned. |
| PMDF__INVSTRDES | Invalid string descriptor for result: descriptor has an invalid value in its DSC$B_CLASS field. No result returned. |
| PMDF__NO | Invalid address. No result returned. |
| PMDF__STRTRU | Supplied string was too long; result truncated to fit. |