| Previous | Contents | Index | 
Parse an address and return the requested address property.
status = 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 
status = PMDFgetAddressProperty
(address, address_len, property, result, result_len)
int PMDFgetAddressProperty(char *address, int address_len, int property, char *result, int *result_len)
address
The address to parse. Length of this string can not exceedBIGALFA_SIZEbytes.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 leastALFA_SIZEbytes in length forPMDF_get_address_propertyorALFA_SIZE+1bytes forPMDFgetAddressProperty.result_len
Length in bytes of the returned property. Callers usingPMDFgetAddressPropertymust, on input, supply the maximum length in bytes of result.
PMDFgetAddressPropertycan be used to parse an address and return the desired property. Moreover,PMDFgetAddressPropertycan 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 ifPMDF__PARSEis returned and the latter by requesting thePMDF_PROP_PROPERproperty. The accepted values for property are shown below and refer to an address of the form
phrase <@otherhost:user@host> (comment)The
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 anyPMDF_PROP_FRIENDLYproperty can 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:Note that
- 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.PMDF_get_address_propertycan only handle a single address of length up to but not exceedingBIGALFA_SIZEbytes. If more than one address is present in the string, thenPMDF__NOwill be returned. So, if the address is longer thanBIGALFA_SIZEbytes or more than one address can be present,PMDFaddressParseListandPMDFaddressGetPropertyshould 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. 
| Previous | Next | Contents | Index |