Instructions for installing, compiling, and linking
Typical sequence of function calls
Detailed reference page for each function
Notices
Published in the United States of America by Firstlogic, Inc., 100 Harborview Plaza,
La Crosse, Wisconsin 54601-4071.
Customer Care
What do you think of
this guide?
Technical help is free for customers who are current on their ESP. Advisors are
available from 8 a.m. to 6 p.m. central time, Monday through Friday. When you call,
have at hand the user’s manual and the version number of the product you are using.
Call from a location where you can operate your software while speaking on the
phone. To save time, fax or e-mail your questions, and an advisor will call or e-mail
back with answers prepared. Or visit our Knowledge Base on the Customer Care web
site, where you can find answers on your own, right away, at any time of the day or
night.
Our Customer Care group also manages our customer database and order processing.
Call them for order status, shipment tracking, reporting damaged shipments or flawed
media, changes in contact information, and so on.
Phone
888-788-9004 in the U.S. and Canada;
elsewhere +1-608-788-9000
The Firstlogic Technical Publications group strives to bring you the most useful and
accurate publications possible. Please give us your opinion about our documentation
by filling out the brief survey at http://www.firstlogic.com/customer/surveys/
default.asp. We appreciate your feedback! Thank you!
Firstlogic, Inc., or any authorized dealer distributing this product, makes no warranty, expressed or implied, with respect to
this computer software product or with respect to this manual or its contents, its quality, performance, merchantability, or
fitness for any particular purpose or use. It is solely the responsibility of the purchaser to determine its suitability for a
particular purpose or use. Firstlogic, Inc. will in no event be liable for direct, indirect, incidental, or consequential damages
resulting from any defect or omission in this software product, this manual, the program disks, or related items and
processes, including, but not limited to, any interruption of service, loss of business or anticipatory profit, even if
Firstlogic, Inc. has been advised of the possibility of such damages. This statement of limited liability is in lieu of all other
warranties or guarantees, expressed or implied, including warranties of merchantability or fitness for a particular purpose.
1L, IL (ball design), ACE, ACSpeed, DataJet, DocuRight, eDataQuality, Entry Planner, Firstlogic, Firstlogic InfoSource,
FirstPrep, FirstSolutions, GeoCensus, i·d·Centric, IQ Insight, Label Studio, MailCoder, Match/Consolidate, PostWare,
Postalsoft, Postalsoft Address Dictionary, Postalsoft Business Edition by Firstlogic, Postalsoft DeskTop Mailer, Postalsoft
DeskTop PostalCoder, Postalsoft DeskTop Presort, Postalsoft Manifest Reporter, PrintForm, RapidKey, Total Rewards,
and TrueName are registered trademarks of Firstlogic, Inc. DataRight, IRVE, iSummit, and TaxIQ are trademarks of
Firstlogic, Inc. All other trademarks are the property of their respective owners.
Preface
Purpose and contents
of this manual
Qualifications
Related documents
This manual is a reference guide for programmers working with International
Address Correction and Encoding library, International ACE.
In writing this manual, we have assumed that you already are familiar with your
programming language, your compiling and debugging tools, your operating
system, and your database-management system. If you are not familiar with these
subjects, your integration of International ACE will be more difficult. If you need
assistance in these areas, please contact us for referrals and resources.
Our System Administrator’s Guide contains installation instructions and system
requirements.
ConventionDescription
BoldWe use boldface type for file names and paths. When we’re
explaining something that you would type on your computer, boldface indicates something that you should type exactly as shown; for
example, “Type
ItalicsWe use italics for emphasis. When we’re explaining something that
you would type on your computer, italics indicate an item for which
you should substitute your own data or values; for example, “Type
a name for your job, along with the
cd\dirs
.”
.job
extension (
jobname
.job
).”
Complete
documentation set
Menu commandsWe indicate commands that you choose from menus in the follow-
ing format: Menu Name | Command Name. For example, “Choose
File | New.”
We use this symbol to alert you to important information and potential problems.
We use this symbol to point out special cases that you should know
about.
The complete International ACE documentation set includes the following:
The complete International ACE documentation set includes the following:
You can access Firstlogic documentation in several places:
On your computer. Release notes, manuals, and other documents for each
Firstlogic product that you’ve installed are available in the Documentation
folder. Choose Start > Programs > Firstlogic Applications >
Documentation.
On the Firstlogic Customer Portal. Go to www.firstlogic.com/customer,
log on using your username and password, and then click the Documentation
link to access all the latest Firstlogic documentation. You can view the PDFs
online, save them to your computer, or order professionally printed
documents that will be delivered to you. To order printed documents, see the
following instructions.
Order printed
documents
You can order professionally printed documents and have them delivered to you
for a small charge. Your documents will be sent to you as soon as the next
business day.
1.Go to www.firstlogic.com/customer
, log on using your username and
password, click the Documentation link, and then click the Printed Technical Documentation link.
If this is your first time accessing the Mimeo site, you’ll be prompted to open
an account before you can log in. Follow the instructions on screen to open
an account.
2.Log in to Mimeo.
3.To access Firstlogic documents, in the Folders area on the left side of the
Mimeo web site, choose DocCenter Shared Folders > Firstlogic Inc.
Index ............................................................................................................289
Contents
9
10
International ACE Library Reference
Chapter 1:
Working with International ACE
This chapter discusses how to compile and run the International engine, as well as
how to work with header files, sample programs, the engines.
11
Introducing International ACE
International ACE parses address components from input records containing
international name and address data.
For some countries, International ACE may also correct address data or add
postal codes. For a list of the countries covered, see “Countries supported” on
page 197.
Discrete, multiline, or
hybrid input data
Data you can retrieve
from International
ACE
Auxiliary data files
International ACE accepts discrete, multiline and hybrid address line formats. For
details on supported formats, see “Accepted address line formats” on page 25
For a complete list of input fields, see the Quick Reference for Libraries.
After you process an address, you can retrieve:
Parsed address components, such as locality, region, and postal code.
Corrected address components.
Standardized address lines that correspond to the input lines.
Information about whether any data was changed, added, or deleted in a
corrected component.
For the U.S., Canadian, and Australian processing engines, information about
the level of “agreement” within a corrected address—for example, whether
the region and postal code agree. You may use this information to measure
address quality.
The level of parsing and correction varies by country. The level of correction
also depends upon the amount of address data present in the input record.
International ACE includes a set of data files that contain address and postal code
data. International ACE uses these files to guide parsing and address correction.
See “EngineFileEnum” on page 153 for details.
12
International ACE Library Reference
Compiling and running the International engine
If you install and run the International engine on UNIX, you must manually set up
the COBOL runtime environment. Refer to the International Address Processing COBOL Installation Guide for UNIX Platforms. If you install and run the
International engine on Windows, you do not need to set up a runtime
environment because the runtime environment is already installed on the
Windows platform. However, you do need to set environment variables. See
“Windows users: configure your system” on page 14 for details.
Note: You no longer need to set the COBPATH and TCGMAPPER
environment variables or edit the allmapper.txt file.
UNIX users: Configure
your system
The International engine relies on specific environment variables being set in
order to run successfully. All examples are shown using the bash shell. Make
adjustments for the shell that you are using.
1.To set the COBDIR variable to the location where the system administrator
has installed the MicroFocus COBOL environment, type COBDIR=/opt/lib/cobol and press Enter. Then type export COBDIR and press Enter.
2.To set the TCGLOG variable, type TCGLOG=/<path>/postware/iacelib/
work/tcglog.txt and press Enter. Then type exportTCGLOG and press
Enter. If you do not name the file, it defaults to tcglog.txt and places it in the
location in which you are running.
3.Set the Shared Library Path environment variable. This command varies
according to your operating system.
HP
AIX
Solaris
Linux
Type
SHLIB_PATH=$COBDIR/lib:
ware/adm
Enter.
Type
adm
Type
postware/adm and press Enter. Then type export
LD_LIBRARY_PATH
4.To increase the number of file handles available, type ulimit –Sn 1024.
5.Library users: Adjust your path variable to include the $COBDIR/bin
directory. Type PATH=$COBDIR/bin:$PATH and press Enter. Then type export PATH and press Enter.
Compiling and running the International engine
13
Adjust your path
Be sure to adjust your path to include the location of the linker (ld) command and
the assembler (as) command. For example:
To adjust your path variable to include the location of the linker (ld)
command, type PATH=/usr/ucb/bin:$PATH and press Enter.
To adjust your path variable to include the location of assembler (as)
command, type PATH=/usr/ccs/bin:$PATH and press Enter.
Windows users:
configure your system
Set file location
If you install and run the International engine on Windows, you do not need to set
up a runtime environment because the runtime environment is automatically
installed on the Windows platform. However, you do need to set environment
variables.
You must set the TCGLOG to a valid path and file name. You may give this file
any name. If you do not name the file, it will default to tcglog.txt. Do one of the
following:
At the DOS prompt, type set TCGLOG=\<path>\pw\iacelib\work\
tcglog.txt
In your operating system startup file, add the TCGLOG variable to include a
path of \<path>\pw\iacelib\work\tcglog.txt
If the environment variable for TCGLOG is not valid, International ACE will
stop running and bring you back to the prompt soon after processing begins.
To correct this, set the TCGLOG to reflect a valid path.
When you are running your compiled application, the keyfile flprods.key
must be in the current directory. The files iiemsg.dbf and cppgmsg.dbf must
be in your PATH.
14
International ACE Library Reference
Header files
International ACE comes with six header files. Include the four appropriate files.
FileDescriptionInclude
C++
cflsys.h
ciie.h
iiepub.h
cppgpub.h
ciiepub.h
ccppgpub.h
Generic parameter type declarations.
Parameter declarations (enumerations).
Global functions and abstract class declarations for
PubEngineClass, PubNaddressClass, and PubQueryClass.
Abstract class declarations for PubErrorClass.
Function declarations for the C interface.
Declarations for error-handling functions in the C
interface.
C
Header files
15
Sample programs
If you would like to see an example of application code calling the C++ interface,
refer to our sample source-code files:
C++CDescription
testiace.cppctstiace.cpp
testqry.cppctstqry.cpp
International ACE
does not support
dlopen for C++.
testieq.cppctestieq.cpp
cstiace_shared.cpp
Demonstrates how to process addresses.
Demonstrates how to query the postal
directories.
Demonstrates how to process addresses.
This example is written using dlopen and
shared libraries on UNIX.
Demonstrates how to process addresses in
Easyiq.
We provide make files (.mak) for Windows, and build scripts (_mk) for UNIX.
To build one of the sample programs, use the corresponding make file or build
script.
When running a sample program, make sure that the file flprods.key is in the
current directory, and that iiemsg.dbf, and cppgmsg.dbf, are in the user’s path.
Note: Our C source-code files have .cpp file extensions because you must
use a C++ linker. By using the .cpp file extension, you can compile and link
in one step rather than in two steps.
The sample programs are for use only as a learning tool. They are not prototypes
or products per se. We do not support or authorize any use for commercial
purposes, and we disclaim any warranty regarding such use.
16
International ACE Library Reference
Overview of the object-oriented interface
The International ACE C++ interface uses global functions and four abstract
classes.
Global functions
Public name-andaddress class
Public engine class
The global functions provide initialization and termination. Global functions
also produce name-and-address, engine, and query objects that conform to the
PubNaddressClass, PubEngineClass, and PubQueryClass class definitions,
respectively.
A name-and-address object does the following:
Accepts input data from your application
Specifies which output components to produce
Accepts output data from the processing engine
You pass input data into a name-and-address object, then use an engine object to
process the data. The engine parses and corrects the data, produces the requested
output components, and passes the results back to the name-and-address object.
You retrieve the output results from the name-and-address object.
You can create multiple name-and-address objects. For example, suppose you get
your input records from two databases that have different record layouts. You can
set up two name-and-address objects—one to accept input from each database.
An engine object parses and corrects address data.
Engines are specialized. For example, the U.S. engine processes addresses from
the United States only, the Australian engine processes addresses from Australia,
and so on. The international engine processes addresses from many countries; see
“Countries supported” on page 197.
Public query class
Public error class
Working with objects
The engine processes the data stored on a name-and-address object and passes the
results back to the name-and-address object.
The public query class is used to directly query the address and postal code files
that International ACE uses for lookups. For example, you might do a query to
investigate unexpected output results.
The public error class, PubErrorClass, provides information about International
ACE errors.
In your application, you will create and work with objects.
For example, for a simple application, you might create one engine object and
one name-and-address object. You would use the engine object to process address
Overview of the object-oriented interface
17
data. You would use the name-and-address object to pass input data into the
engine, and to retrieve output data from the engine.
Input data
Output data
Name-andaddress
object
Engine
object
In most applications, you will use multiple objects. For example, suppose you are
processing a file that contains addresses from Canada and other countries. You
might create a country identification engine, a Canadian engine, and an
international engine. You would use the country identification engine to first
identify the country. Then, you would send each Canadian address to the
Canadian engine, and all other addresses to the international engine.
Input data
If the country is Canada,
use the Canadian engine
object. Else, use the
International engine
object.
Output data
Name-andaddress
object
Country ID
engine object
Canadian
engine object
International
engine object
Bear in mind that when you load input data into a name-and-address object, that
input data stays in that name-and-address object until you either clear the data or
load different input data into the object. In other words, once you load data into a
name-and-address object, you can shuttle the name-and-address object from
engine to engine without reloading the input data.
18
International ACE Library Reference
Working with the C interface
International ACE is an object-oriented C++ library. However, we also provide a
C interface as a cover over our C++ interface, so that C programmers can call the
library.
Working with objects
For most International ACE functions, you must tell International ACE which
object it should use to perform the function. For example, to open a particular
engine object using the C interface, you would pass the engine object into the
engOpen() function as an input parameter:
engOpen(engPtr, error);
By comparison, a C++ programmer would use the object to call the open()
function, like this:
engPtr --> open();
Working with the C interface
19
Looking up functions
The C functions and C++ functions are named differently. In this manual, we
organize the functions into chapters by the classes used in C++, and we use the
C++ function name as the title for each reference page.
You can find a C function on the reference page for the equivalent C++ function.
To look up a particular C function, follow the guidelines below, or look in the
index.
Linking and compiling
Don’t mix C and C++
If the C
function
starts with...
cGlobal functions, Chapter 2
Look in this chapterExample
C functionC++ function
c
IieInit()
c
or
GetErrorInfo()
iieInit()
getErrorInfo()
PubErrorClass, Chapter 6
eng
eng PubEngineClass, Chapter 3
nadPubNaddressClass, Chapter
4
qryPubQueryClass, Chapter 5
GetEngineInfo() getEngineInfo()
nad
GetCompo-
getComponent()
nent()
qry
GetElement()getElement()
releaseGlobal functions, Chapter 2releaseEng()n/a
If you use the C interface, you must use a C++ linker. You may use a C compiler.
For each application that you write, use either the C interface or the C++
interface. Do not mix calls to both interfaces.
20
International ACE Library Reference
Error and warning handling
C++ interface
The error handling subsystem uses exceptions to throw and catch errors. All
International ACE interface functions, including global and class members, have
the potential for throwing errors.
Check for warnings after completing an operation that may generate a warning.
Warning messages do not throw an error. It is not sufficient to see if the error
object has data. The error object may just contain warning data. You must instead
try to catch an error using the catch() function call. Use the public error class,
PubErrorClass, to interrogate any error object that you catch. Call getErrorInfo()
to retrieve an error title and error message. For example:
try
{
// Do some stuff.
}
catch(const PubErrorClass* errorObject)
{
FlCharType msg[256];
FlCharType title[256];
The casting of title and msg to char*is dependent upon FlCharType being an
8-bit type.
In addition, you may check for the existence of warnings by using
getErrorStatus():
//You can also check for the existence of a warning
if(FL_WARNING == getErrorStatus())
{
FlCharType title(256);
FlCharType msg(256);
getErrorObject()->getErrorInfo(256, title, 256, msg);
cerr << "\nERROR: " << (char *)title << endl
<< (char *)msg << endl << endl;
// Note: After getting the warning it should be
cleared
getErrorObject()->clear();
}
Error and warning handling
21
C interface
Almost every function in the C interface includes an error output parameter. After
you call a function, check the value of the error parameter. If the error parameter
contains a 1, call your error handler.
Inside your error handler, call cGetErrorInfo() to get an error title and message.
For example:
For an example showing one possible method of error handling, see the
error_tran() macro in our sample programs ctstiace.c and ctstqry.c.
22
International ACE Library Reference
Thread safety limits for AIX, HP, and Solaris
International ACE is thread safe on AIX, HP, and Solaris platforms. When you
are writing a threaded application, the number of threads you can use depends on
the number of file handles that are available on your system. To obtain the
maximum number of threads, it is recommended that you raise the ulimit on
UNIX to 1024.
Set the ulimit to 1024 by typing ulimit -Sn 1024
The table below lists the approximate number of file handles required for each
engine in International ACE. To calculate the number of threads your application
can use, determine your system’s limitations and the combination of engines you
plan to use. Be sure to account for any other file handles your application may use
aside from the file handles used by each engine.
Example
Library and RAPID
users
You are creating an application that
requires the following engines:
•United States (20 file handles)
•Canadian (20 file handles)
•Australian (20 file handles)
EngineFile handles
Australian engine20
Canadian engine20
US engine20
International engine70
•International (70 file handles)
The total number of file handles required is 130. If your system has 1024 file
handles available and your application does not use any additional file handles,
then you are able to run your application safely using 7 threads.
(1024 / 130 = 7)
Library and RAPID users need to include the -t flag when building an executable.
For example, type:
cob -t myprog.o myprog
Thread safety limits for AIX, HP, and Solaris
23
Tips for working with the International engines
Results differ by
country
The international engine is a general-purpose engine that must process addresses
from many different countries. The goal of the international engine is to assign
the correct postal code for an address. The engine recognizes only as much
information as it needs to assign the postal code. For example, for some countries,
the international engine may require only the locality (town) and region to assign
a postal code.
The output component fields reflect the amount of information processed. For
example, if only the locality and region are used to assign the postal code, then
only the locality, region, and postal code output components would be
populated—other components will not be populated. If the engine cannot assign a
postal code, then all of the output components may be empty. (Exception:
Locality and country components may be populated even if a postal code was not
assigned.)
Additionally, the level of postal data varies widely from country to country. For
some countries, complete address data is available for most or all of the country.
In other countries, only locality, region, and postal code data are available. Also
in some countries, complete address data is available for large metropolitan areas,
while only locality, region, and postal code are available for smaller towns. The
amount of data available in the postal databases will affect the data that is
available for output.
When using the international engine, check the output for blank fields. You may
prefer to retrieve lines rather than retrieving output components. To retrieve lines,
call getStandardizeLineData().
Pass in discrete
country data
Although the international engine can often recognize country data within a larger
line, the country ID engine is specially designed to identify country data and is
therefore the most effective engine to use for this purpose.
The international engine provides best results if you pass in discrete country data
through the
discrete country data, use the country ID engine to identify the country, then pass
that country information to the international engine.
1.When you create the name-and-address object, include the discrete country
line,
discrete country data. You’ll need this line for the country data that you get
from the country ID engine.
2.Pass the input address to the country ID engine. Retrieve the country name
from the country ID engine and store it in a buffer.
3.Remove the country data from the original input address by calling
getComponentLocation(). Do this so that you don’t send duplicate country
data to the international engine (the country embedded in the original address
and the country retrieved from the country ID engine). Duplicate address data
may sometimes affect results.
4.Reload the data onto the name-and-address object. Load the input address
from which you removed the country data, along with the discrete country
name that you retrieved from the country ID engine.
NAD_LINE_COUNTRY field. If your input records do not contain
NAD_LINE_COUNTRY, even if your input records do not contain
24
5.Process the address as usual.
International ACE Library Reference
Accepted address line formats
The following tables list the line formats currently supported by Interational
ACE.
Note: For all multi-line and multi-line hybrid formats listed, you are not
required to use all lines for a selected format. You must always start with
Line1.
Multi-line and Multi-line Hybrid Formats
Line1Line1Line1Line1Line1
Line2Line2Line2Line2Line2
Line3Line3Line3Line3Line3
Line4Line4Line4Line4Line4
Line5Line5Locality3Line5Line5
Line6Line6Locality2Locality2Line6
Line7Line7Locality1Locality1Locality1
Line8LastlineRegionRegionRegion
Country
(Optional)
CountryPostcodePostcodePostcode
CountryCountryCountry
Note: We recommend using the Country field if the default Country option is
set to None for the International engine.
Discrete Line Formats
AddressAddressAddressAddress
LastlineLocality3Locality2Locality1
CountryLocality2Locality1Region
Locality1RegionPostcode
RegionPostcodeCountry
PostcodeCountry
Country
Note: The discrete line formats are not recommended for processing
International databases. They are more appropriate for use in U.S., Canadian,
and Australian addresses.
Accepted address line formats
25
Sample formats
International ACE accepts addresses in three formats. The following examples
give the description of each accepted address format and three sample addresses
for each format.
Multiline
The multiline format is a database record format in which address data is not
consistently located in the same arrangement in all records. That is, data items
"float" among fields.
3150 S. Larkin Rd., Suite 10
Etiboke ON M9C4T9
Canada
Dupong S.A.
225 rue de Bragance
Luxembourg
1449
Luxembourg
26
International ACE Library Reference
Hybrid format
The hybrid format is a database record format which contains “floating” address
data as in the multi-line format as well as consistent/discrete last line data. Data
such as Locality Region and Postcode are located in the same field or line for
every record in the database.
Address 1Address 2Address 3
Line1 =
Line2 =
Line3 =
Line4 =
Line5 =
Locality2 =
Locality1 =
Region =
Postcode =
Country =
Jonas Lancaster
Woodworks Ltd.
Wetherby House
20 Oakley Road
Note: When using the International engine and defining the hybrid format, be
sure that the total number of Localities + Region + Multilines is less than or
equal to eight.
Sample formats
27
Certification options
If you are interested in what settings are required for certification, here is a table
describing each required option and it’s setting.
Typical sequence of function calls for address processing
For all International ACE functions, there is the potential for errors to occur. For
information about error handling, see “Error and warning handling” on page 21.
Note: This call sequence shows functions from the C++ interface. If you are
using the C interface, call the equivalent C functions in the same sequence.
Initializing
Creating name-andaddress object(s)
Create engine
object(s)
1.Call iieInit() to initialize the library. See “iieInit()” on page 43.
2.Call getNad() to create a name-and-address object. See “getNad()” on
page 40.
3.Optional: Call setStandardizeLineLength() to set the maximum length for
an output line. Call this function once for each output line whose length you
wish to set. See “setStandardizeLineLength()” on page 102.
4.Optional: Call setOption() to set options for this name-and-address object.
See “setOption()” on page 67.
Repeat steps 2 through 4 for each name-and-address object.
5. Call getEng() to create an engine object. When created, the engine will be
in the closed state. See “getEng()” on page 37.
6. While the engine is in the closed state, set file names and paths:
Call setPathName() to set paths for the files used by the engine. See
“setPathName()” on page 69.
Call setFile() to set the locations and file names of files whose locations
were not set using setPathName(). See “setFile()” on page 65.
7.Optional: Call setOption() to set options for this engine. You may only call
setOption() when the engine is in the closed state. See “setOption()” on
page 67.
8.Call open() to move the engine to the open state. See “open()” on page 64.
Repeat steps 5 through 7 for each engine object you want to create.
Typical sequence of function calls for address processing
29
Pass in data
9.Call insertLineData() to insert input data into the name-and-address object.
Call this function once for each input field. See “insertLineData()” on
page 88..
10. Call validateLineFormat() to verify that the combination of input fields is
valid. See “validateLineFormat()” on page 103.
Process data and
retrieve results
11. Call process() to use an engine object to process the data stored on the nameand-address object. See “process()” on page 122.
12. Retrieve the results from the name-and-address object:
To retrieve a line that corresponds to an input line, call
getStandardizeLineData(). See “getStandardizeLineData()” on
page 83.
To retrieve a parsed or corrected component, call getComponent(). See
“getComponent()” on page 77.
To get information about the address—for example, to learn which
address data was corrected—call getFaultCode() and getStatus(). See
“getFaultCode()” on page 82 and “getStatus()” on page 86.
To process the record with another engine object, repeat steps 11 and 12 (You do
not have to reload the input data into the name-and-address object.) For example,
you might use the Country ID engine to get the country, then pass the record to
the appropriate engine for address processing.
Note: The name-and-address object retains the original data that you passed
in until you call insertLineData() and load new data. However, the name-andaddress object retains the results of only the engine upon which it was most
recently processed. So always, retrieve results before processing the nameand-address data with a different engine.
Termination
13. Use the built-in C++ delete operator to deallocate all name-and-address and
engine objects.
Note: If you are using the C interface, call the “release” functions to
deallocate objects. See “releaseEng()” on page 45 and “releaseQry()” on
page 47.
14. Call iieTerm() to terminate the library. See “iieTerm()” on page 44.
30
International ACE Library Reference
Unicode implementation
International ACE Library processes Unicode data much the same way as you’ve
processed other data in the past. International ACE handles Unicode data by
making use of special Unicode functions and methods. All functions and methods
are explained fully in this reference.
Accepted data type
Mixing Unicode and
non-Unicode calls?
Do I need to convert
my entire API to pass
Unicode data?
Unicode functions and
methods
International ACE will accept Unicode input only if the data uses the UTF-16
encoding.
You can mix calls to Unicode and non-Unicode functions. For example, if you’re
passing UTF-16 fields to International ACE from one source, and you also have
address lines in ASCII that need to be passed as input, you can use the nonUnicode “set” functions for that ASCII data.
You do not need to convert functions that output messages or revision
information, functions that accept input like path names, and so on.
All you need to do is accept Latin-1 characters that have been stored in a UTF-16
encoding or to output the data as UTF-16. You don’t need to convert output such
as error messages to Unicode. These messages will always be Latin-1 characters.
Besides, they’re only for display or logging purposes.
The following functions are available for processing Unicode data in
International ACE Library.
These Unicode functions correlate to previously existing functions. You can tell
International ACE’s Unicode functions from their non-Unicode counterparts by
the “_u” appended to the name.
Unicode implementation
31
32
International ACE Library Reference
Chapter 2:
Global functions
The International ACE C++ library uses seven global functions. Two of these
functions are used to initialize and terminate the error-management and memorymanagement subsystems. Two can be used to retrieve user-friendly names for
components and lines. The others are object factories that produce objects that
conform to the PubEngineClass, PubNaddressClass, and PubQueryClass classes.
The global functions are listed in alphabetical order in this chapter.
33
FlNadFaultCodeEnumToString
()
Synopsis
Arguments
Returns
Description
C function
const FlCharType* (
NadFaultCodeEnuminId,
NadToStringEnumoutId =
inIdInput: The fault code for which to retrieve a printable string.
outIdInput: The type of string to retrieve. For this function, the only
valid values are
Returns the requested string.
For a particular fault code, call this function to retrieve a printable fault-code
string such as “F101,” or a description string such as “Last line is bad or
missing.” You might print this information on a report.
To get the fault code inId that you must pass in, call the PubNaddressClass
function getFaultCode().
NAD_VALUE_AS_STRING and NAD_DESCRIPTION.
NAD_VALUE_AS_STRING);
const FlCharType* cFlNadFaultCodeEnumToString(
NadFaultCodeEnuminId,
NadToStringEnumoutId);
inIdSee description above.
outIdSee description above. Not optional for C.
34
International ACE Library Reference
FlNadLineEnumToString
()
Synopsis
Arguments
Returns
Description
C function
const FlCharType* FlNadLineEnumToString(
NadLineEnuminId,
NadToStringEnumoutId =
inIdInput: Type of line. For a list of values, see NadLineEnum on
page 161.
outIdOptional input: Type of string to return. For a list of values, see
NadToStringEnum on page 167.
If successful, returns the string.
Call this function to retrieve a NadLineEnum enumeration as a printable string,
such as “
spelling in the header file ciie.h.
NAD_LINE_MULTILINE1.” The spelling will be the same as the
NAD_VALUE_AS_STRING);
const FlCharType* cFlNadLineEnumToString(
NadLineEnuminId,
NadToStringEnumoutId);
inIdSee description above.
outIdSee description above. Not optional for C.
FlNadLineEnumToString()
35
FlNadOutputCompEnumToString
()
Synopsis
Arguments
Returns
Description
C function
const FlCharType* FlNadOutputCompEnumToString(
NadOutputCompEnuminId,
NadToStringEnumoutId =
inIdInput: Type of output component. For a list of values, see
NadOutputCompEnum on page 163.
outIdOptional input: Type of string to return. For a list of values, see
NadToStringEnum on page 167.
If successful, returns the string.
Call this function to retrieve a NadOutputCompEnum enumeration as a printable
string such as “
spelling in the header file ciie.h.
NAD_PRIM_NAME.” The spelling will be the same as the
NAD_VALUE_AS_STRING);
const FlCharType* cFlNadOutputCompEnumToString(
NadOutputCompEnuminId,
NadToStringEnumoutId);
inIdSee description above.
outIdSee description above. Not optional for C.
36
International ACE Library Reference
getEng
()
Synopsis
Arguments
Returns
Description
C function
PubEngineClass * getEng(EngineTypeEnum engType);
engTypeInput: The type of engine object to create. For values, see
EngineTypeEnum on page 156.
If successful, returns a pointer to an engine object.
Call this function to create an engine object that conforms to the PubEngineClass
class. The function creates the type of engine object specified by the engType
parameter. You will use this engine object to parse and correct address data.
When you are done with an engine object, you are responsible for deallocating it.
C++ programmers should use the built-in C++ delete operator, and C
programmers should call releaseEng().
void* cGetEng(
EngineTypeEnumengType,
int*error);
engTypeSee description above.
errorOutput: Contains a 1 if an error occurred.
getEng()
37
getErrorObject
()
Synopsis
Arguments
Returns
Description
PubErrorClass* getErrorObject();
None.
PubErrorClass* If an error occurred, this returns a pointer to an error class
object, otherwise it returns FL_NULL.
Call this function to obtain an error object pointer to retrieve information.
Usage example:
if (FL_
{
FlCharType title(256);
FlCharType msg(256);
getErrorObject()->getErrorInfo(256, title, 256, msg);
cerr << "\nERROR: " << (char *)title << endl
<< (char *)msg << endl << endl;
// Note: After getting the warning it should be
cleared
getErrorObject()->clear();
Call this function to see if a warning is generated.
getErrorStatus()
39
getNad()
Synopsis
Returns
Description
C function
PubNaddressClass * getNad( );
If successful, returns a pointer to a name-and-address object.
Call this function to create a name and address object that conforms to the
PubNaddressClass class. You will use this name-and-address object to store input
data and retrieve output components.
When you are done with a name-and-address object, you are responsible for
deallocating it. C++ programmers should use the built-in C++ delete operator,
and C programmers should call releaseNad().
void* cGetNad(int* error);
errorOutput: Contains a 1 if an error occurred.
40
International ACE Library Reference
getQuery
()
Synopsis
Arguments
Returns
Description
C function
PubQueryClass * getQuery(EngineTypeEnum engType);
engTypeInput: The type of query engine. For values, see
EngineTypeEnum on page 156.
If successful, returns a pointer to a query class object.
Call getQuery() to create a query class object that conforms to the
PubQueryClass class. To perform simultaneous queries, you must have multiple
instances of the PubQueryClass.
When you are done using a query engine object, you are responsible for
deallocating it. C++ programmers should use the built-in C++ delete operator,
and C programmers should call releaseQry().
void* cGetQuery(
EngineTypeEnumengType,
int*error);
engTypeSee description above.
errorOutput: Contains a 1 if an error occurred.
bufferSee description above.
bufferLenSee description above.
versionDepthSee description above. Not optional for C.
errorOutput: Contains a 1 if an error occurred.
42
International ACE Library Reference
iieInit
()
Synopsis
Description
C function
void iieInit( );
Call this function to initialize the library. This function initializes the memory
management system and error handling system. You must call iieInit() before
calling any other International ACE functions.
To initialize the library, the key file iacelib.key must be in current directory. If
!
this file is not found, the library will not initialize.
void cIieInit(int* error);
errorOutput: Contains a 1 if an error occurred.
iieInit()
43
iieTerm
()
Synopsis
Description
C function
void iieTerm( );
Call iieTerm() to terminate the library. This function terminates the memory
!
management system and error handling system.
Before calling iieTerm(), you must deallocate all name-and-address, engine, and
query engine objects.
Do not call any other International ACE functions after calling iieTerm().
void cIieTerm(int* error);
errorOutput: Contains a 1 if an error occurred.
44
International ACE Library Reference
releaseEng
()
Note: This is a C function. If you are using the C++ interface, do not call this
function—instead, use the built-in C++ delete operator to deallocate an
object.
Synopsis
Arguments
Description
void releaseEng(
void*engPtr,
int*error);
engPtrInput: Pointer to an engine object..
errorOutput: Contains a 1 if an error occurred.
If you are using the C interface, call releaseEng() to deallocate an engine
object.
releaseEng()
45
releaseNad
()
Note: This is a C function. If you are using the C++ interface, do not call this
function—instead, use the built-in C++ delete operator to deallocate an
object.
Synopsis
Arguments
Description
void releaseNad(
void*nadPtr,
int*error);
nadPtrInput: Pointer to a name-and-address object.
errorOutput: Contains a 1 if an error occurred.
If you are using the C interface, call releaseNad() to deallocate a name-andaddress object.
46
International ACE Library Reference
releaseQry
()
Note: This is a C function. If you are using the C++ interface, do not call this
function—instead, use the built-in C++ delete operator to deallocate an
object.
Synopsis
Arguments
Description
void releaseQry(
void*qryPtr,
int*error);
qryPtrInput: Pointer to a query engine object.
errorOutput: Contains a 1 if an error occurred.
If you are using the C interface, call releaseQry() to deallocate a query engine
object.
releaseQry()
47
usSetZ4cCheckDate
()
Synopsis
Arguments
Returns
Description
C function
EngineDateEnum usSetZ4cCheckDate(
PubEngineClass*usEngPtr,
intmonth,
intyear);
usEngPtrInput: Pointer to a U.S. engine.
monthInput: Month of last ZIP+4 coding.
yearInput: Four-digit year of last ZIP+4 coding.
Returns EngineDateEnum. For a list of possible values for EngineDateEnum, see
page 152.
Call this function with the month and year that the input records were most
recently ZIP+4 coded. This function will verify that your date is within the 12month period covered by the current Z4Change file.
Before calling this function, make sure the ASSIGN_ENG_PROC_MODE_
DELPT_CHANGE
are using.
processing option is set to YES for the engine object that you
EngineDateEnum cUsSetZ4cCheckDate(
void*engPtr,
intmonth,
intyear,
int*error);
engPtrInput: U.S. engine object
monthSee description above.
yearSee description above.
errorOutput: Contains a 1 if an error occurred.
48
International ACE Library Reference
usZ4Zip4Changed
()
Synopsis
Arguments
Returns
Description
EngineZ4CEnum usZ4Zip4Changed(
PubEngineClass*usEngPtr,
const FlCharType*zip9);
usEngPtrInput: Pointer to a U.S. engine.
zip9Input: Nine-digit ZIP+4 code (no hyphen).
Returns a value indicating whether this ZIP+4 code is affected by a change, or a
value indicating that the input ZIP+4 code was not valid. For a list of values, see
EngineZ4CEnum on page 156.
Call this function to see whether a particular ZIP+4 code has changed within the
past twelve months. The change may be to a postal code (ZIP Code, ZIP4 code, or
carrier route) or a change in the standardized form of the address line or city
name.
Before calling this function:
Call usSetZ4cCheckDate().
Make sure the ASSIGN_ENG_PROC_MODE_DELPT_CHANGE processing
option is set to
YES for the engine object that you are using.
C function
Note: The Z4Change process does not assign new postal codes.
EngineZ4CEnum cUsZ4Zip4Changed(
void*engPtr,
const FlCharType*zip9,
int*error);
engPtrInput: U.S. engine object
zip9See description above.
errorOutput: Contains a 1 if an error occurred.
usZ4Zip4Changed()
49
usZ4Zip4Changed_u()
SynopsisEngineZ4CEnum usZ4Zip4Changed_u(
PubEngineClass* usEngPtr,
const FlUChar*zip9);
ArgumentsusEngPtrInput: Pointer to a U.S. engine.
zip9Input: Nine-digit ZIP+4 code (no hyphen).
ReturnsReturns a value indicating whether this ZIP+4 code is affected by a change, or
a value indicating that the input ZIP+4 code was not valid. For a list of values,
see EngineZ4CEnum on page 156.
DescriptionCall this function to see whether a particular ZIP+4 code has changed within the
past twelve months. The change may be to a postal code (ZIP Code, ZIP4 code, or
carrier route) or a change in the standardized form of the address line or city
name.
Before calling this function:
Call usSetZ4cCheckDate().
Make sure the ASSIGN_ENG_MODE_DELPT_CHANGE processing option
is set to
YES for the engine object that you are using.
Note: The Z4Change process does not assign new postal codes.
C function EngineZ4CEnum FL_API cUsZ4Zip4Changed_u(
void*engPtr,
const FlUChar *zip9,
int*error);
engPtrInput: U.S. engine object
zip9See description above.
errorOutput: Contains a 1 if an error occurred.
50
International ACE Library Reference
Chapter 3:
PubEngineClass
The PubEngineClass is an abstract class that defines the engine interface.
An engine object parses and corrects address data stored on a name-and-address
object. The output results are stored on the name-and-address object and retrieved
through the PubNaddressClass interface.
An engine object is always in one of two states: open or closed.
In the closed state, you can set file paths and processing options.
In the open state, the engine object can process data. File paths and
processing options cannot be changed in the open state.
In either state (open or closed), you can query the engine type, the current set
of files, and current directory path. You can also change options.
51
close
()
Synopsis
Description
C function
void close( );
Call this function to close files, deallocate internal structures, and move the
engine object to the closed state.
void engClose(
void*engPtr,
int*error);
engPtrInput: Pointer to an engine object.
errorOutput: Contains a 1 if an error occurred.
selectionInput: The engine information to retrieve. For a list of possible
values, see “EngineInfoEnum” on page 155.
bufferOutput: The requested information.
bufferLenInput: Length of the buffer allocated to hold the output string.
The output string will be no longer than
NAD_MAX_STD_LINE_LENGTH (plus a NULL terminator).
If the buffer is long enough to hold the output string, the function returns true. If
the buffer is not long enough, the function returns false and the output string is
truncated.
Call this function to retrieve information about the engine.
engPtrInput: Pointer to an engine object.
selectionSee description above.
bufferSee description above.
bufferLenSee description above.
errorOutput: Contains a 1 if an error occurred.
getEngineInfo()
53
getEngineInfo_u()
Synopsisbool getEngineInfo_u(
EngineInfoEnum selection,
FlUChar* buffer,
int bufferLen) const;
ArgumentsselectionInput: The engine information to retrieve. For a list of possible
values, see “EngineInfoEnum” on page 155.
bufferOutput: The requested information.
bufferLenInput: Length of the buffer allocated to hold the output string in
Unicode code-units. The output string will be no longer than
NAD_MAX_STD_LINE_LENGTH (plus a NULL terminator).
ReturnsIf the buffer is long enough to hold the output string, the function returns true. If
the buffer is not long enough, the function returns false and the output string is
truncated.
DescriptionCall this function to retrieve information about the engine.
engPtrInput: Pointer to an engine object.
selectionSee description above.
bufferSee description above.
bufferLenSee description above.
errorOutput: Contains a 1 if an error occurred.
fileIdInput: The type of file whose path and file name to retrieve. For
a list of file types, see “EngineFileEnum” on page 153.
If successful, returns the path and file name of the file. Returns an empty string if
the file has not been set.
Call this function to retrieve the path and file name of a specific type of file stored
on the engine object. You may call this function when the engine is in either state
(open or closed).
const FlCharType* engGetFile(
void*engPtr,
EngineFileEnumfileId,
int*error);
engPtrInput: Pointer to an engine object.
fileIdSee description above.
errorOutput: Contains a 1 if an error occurred.
getFile()
55
getFile_u()
Synopsisconst FlUChar* getFile_u(
EngineFileEnum fileId ) const;
ArgumentsfileIdInput: The type of file whose path and file name to retrieve. For
a list of file types, see “EngineFileEnum” on page 153.
ReturnsIf successful, returns the path and file name of the file. Returns an empty
string if the file has not been set
DescriptionCall this function to retrieve the path and file name of a specific type of file
stored on the engine object. You may call this function when the engine is in
either state (open or closed).
Make sure the input file and path name is in Unicode encoded ASCII data.
International ACE can not process non-ASCII file or path names.
C function const FlUChar* FL_API engGetFile_u (
void*engPtr,
EngineFileEnum fileId,
int*error);
engPtrInput: Pointer to an engine object.
fileIdSee description above.
errorOutput: Contains a 1 if an error occurred.
selectionInput: The type of option whose value to retrieve. For a list of
options, see “AssignEngOptionEnum and
AssignEngOptionValueEnum” on page 136.
CountryThe country identifier for International engine countries only.
This is an optional parameter that is defaulted to
FL_COUNTRY_UNDEFINED. The countries that support each
option are listed with the values in “AssignEngOptionEnum and
AssignEngOptionValueEnum” on page 136.
Returns the current value of the option. For a list of possible values, see
“AssignEngOptionEnum and AssignEngOptionValueEnum” on page 136.
Returns
which case the setting from the name-and-address object is used.
Call this function to retrieve the current setting of a particular option on this
engine.
OPTION_NOT_SET if the option has not been set on this engine, in
Call this function to retrieve the value of the given statistic. The second parameter
is an optional parameter. It is defaulted to COUNTRY_SUPPORTED_MAX,
which will give you a total of all the statistics kept for all the international
countries. If an individual country enumeration is passed in, it gives the total for
that country only. You may call this function when the engine is in the open state.
Returns the value associated with the passed in parameter. Either
EngineStatisticEnum, NadFaultCodeEnum, NadAddrTypeEnum, or
NadAssignTypeEnum.
engPtrInput: Pointer to an engine object.
statId See description above.
countrySee description above.
errorOutput: Contains a 1 if an error occurred.
getStatistic()
61
getType
()
Synopsis
Description
Returns
C function
EngineTypeEnum getType( ) const;
Call this function to retrieve the engine type. You may call this function when the
engine either is in the open state or closed state.
Returns the engine type. For a list of possible values, see “EngineTypeEnum” on
page 156.
EngineTypeEnum engGetType(
void*engPtr,
int*error);
engPtrInput: Pointer to an engine object.
errorOutput: Contains a 1 if an error occurred.
62
International ACE Library Reference
isLineUsed
()
Synopsis
Arguments
Returns
Description
C function
bool isLineUsed(NadLineEnum line)const;
lineInput line. For a list of values, see NadLineEnum on
“NadLineEnum” on page 161.
Returns true if the input line is processed by this engine; otherwise, returns false.
Call this function to query whether a particular input line is processed by this
engine.
If the input line is not processed by this engine, any data passed in on that line
!
will not be available as an output component (NadOutputCompEnum). For
the U.S. and Canadian engines, you can retrieve such lines by calling
getStandardizeLineData(). For other engines, if you want to carry such
lines to the output, you are responsible for retrieving the data from the input
record and copying it to the output record.
int engIsLineUsed(
void*engPtr,
NadLineEnumline,
int*error);
engPtrInput: Pointer to an engine object.
lineSee description above.
errorOutput: Contains a 1 if an error occurred.
isLineUsed()
63
open
()
Synopsis
Description
C function
void open( );
Call this function to move an engine object to the open state. This function opens
all files associated with the engine and allocates internal data structures.
void engOpen(
void*engPtr,
int*error);
engPtrInput: Pointer to an engine object.
errorOutput: Contains a 1 if an error occurred.
64
International ACE Library Reference
setFile
()
Synopsis
Arguments
Description
C function
void setFile(
EngineFileEnumfileId,
const FlCharType*fileName);
fileIdInput: Type of file. For a list of possible values, see
“EngineFileEnum” on page 153.
fileNameInput: Path and file name.
Call this function to set the path and file name of one of the files that International
ACE uses for lookups. Call this function only when the engine object is in the
closed state.
Tip: You can make just a few calls to setPathName() rather than calling
setFile() for each file. See “setPathName()” on page 69.
selectionThe option to set. For a list of options, see
“AssignEngOptionEnum and AssignEngOptionValueEnum” on
page 136.
newValueValue to set for the option. For a list of valid settings for each
option, see “AssignEngOptionEnum and
AssignEngOptionValueEnum” on page 136.
countryThe country identifier for International engine countries only.
This is an optional parameter that is defaulted to
FL_COUNTRY_UNDEFINED. The countries that support each
option are listed with the values in “AssignEngOptionEnum and
AssignEngOptionValueEnum” on page 136.
Call this function to set options for an engine object.
Note: If you set the same option on the engine object and the name-andaddress object, the engine setting overrides the setting on the name-andaddress object.
Returns
C functions
Returns true if the option is valid for this engine; otherwise, returns false.
engPtrInput: Pointer to an engine object.
selectionInput: See description above.
newValueInput: See description above.
errorOutput: Contains a 1 if an error occurred.
pathTypeInput: The type of file(s) for which you want to set the path. For
a list of values, see “EnginePathNameTypeEnum” on page 155.
pathNameInput: The path to the directory containing the files of type
pathType. For details, see the description below.
If a required file has not been set using setFile(), the engine searches for the
default file in the path that was set by setPathName(). The default file name
varies by engine—see “EngineFileEnum” on page 153.
For the international engine, you must call setPathName() to set a directory-type
ENGINE_DIRECTORY_PATH) for the postal-code files, which must all be
path (
stored in the same location.
Call this function only when the engine object is in the closed state.
engPtrInput: Pointer to an engine object.
pathTypeSee description above.
pathNameSee description above.
errorOutput: Contains a 1 if an error occurred.
engPtrInput: Pointer to an engine object.
pathTypeSee description above.
pathNameSee description above.
errorOutput: Contains a 1 if an error occurred.
engInput: Pointer to a US Engine object.
lineNumberInput: The line number to retrieve.
bufferOutput: The retrieved data. The recommended buffer length
is NAD_MAX_COMPONENT_LENGTH.
errorOutput: Contains a 1 if an error occurred.
72
International ACE Library Reference
Chapter 4:
PubNaddressClass
The PubNaddressClass class is an abstract class that defines the name-andaddress interface.
Name-and-address objects are used to store input data, define which output
components to produce, and retrieve processing results. A name-and-address
object uses one or more engine objects to process its input data.
73
getAddressType()
Synopsis
Arguments
Returns
Description
C function
NadAddrTypeEnum getAddressType() const;
None.
Returns the address-type code for the address that was most recently processed
using this name-and-address object. For a list of values see “NadAddrTypeEnum”
on page 159.
After processing an address, call this function to get the address type.
NadAddrTypeEnum nadGetAddressType (
void*nadPtr,
int*error);
nadPtrInput: Pointer to a name-and-address object.
errorOutput: Contains a 1 if an error occurred.
74
International ACE Library Reference
GetAssignType()
Synopsis
Arguments
Returns
Description
C function
NadAssignTypeEnum getAssignType() const;
None.
Returns the assignment-type for the address that was most recently processed
using this name-and-address object. For a list of values see
“NadAssignTypeEnum” on page 160.
After processing an address, call this function to get the assignment-type.
NadAssignTypeEnum nadGetAssignType(
Vo i d *nadPtr,
int*error);
NadPtrInput: Pointer to a name-and-address object.
ErrorOutput: Contains a 1 if an error occurred.
GetAssignType()
75
clear()
Synopsis
Description
C function
void clear( );
Call this function to clear the following from the name-and-address object:
Status flags (NadStatusEnum)
Input data inserted by calling insertLineData()
Output component data and status
You might use this function if you pass input data to a name-and-address object
and then check it for completeness before processing. If you decide that the
address is not complete enough to process, call clear() to clear the data from the
name-and-address object before passing in the next address.
Note: You are not required to call this function every time you pass in new
address data. International ACE automatically clears data from the nameand-address object when you insert new data after calling process().
void nadClear(
void*nadPtr,
int*error);
nadPtr Input: Pointer to a name-and-address object
errorOutput: Contains a 1 if an error occurred.
componentInput: Output component to retrieve. For values, see
“NadOutputCompEnum” on page 163.
compDataBuffer Output: The output string.
bufferLenInput: Length of the compDataBuffer buffer allocated to hold
the output string.
statusOutput: Retrieval status. For a list of possible values, see
“NadOutputCompStatusEnum” on page 163.
typeOptional input: Type of data. For a list of values, see
“NadOutputCompTypeEnum” on page 164.
Returns true if the component request is valid. Returns false if the component
request is not valid—for example, if the requested component is not available for
the country, or if the requested type is not available for this component.
Description
Call getComponent() to retrieve a specific address component.
International ACE places the component string (which includes a
terminator) into your output buffer, compDataBuffer. The data is truncated to fit
within the length specified by the bufferLen parameter. The status parameter
indicates whether the data was truncated.
The maximum component length is
defined in ciie.h.
nadPtrInput: Pointer to a name-and-address object
componentSee description on previous page.
compDataBufferSee description on previous page.
bufferLenSee description on previous page.
statusSee description on previous page.
typeSee description on previous page.
errorOutput: Contains a 1 if an error occurred.
78
International ACE Library Reference
getComponent_u()
Synopsisbool getComponent_u(
NadOutputCompEnumcomponent,
FlUChar* compDataBuffer,
int bufferLen,
NadOutputCompStatusEnum& status,
NadOutputCompTypeEnumtype ) const;
ArgumentscomponentInput: Output component to retrieve. For values, see
“NadOutputCompEnum” on page 163.
compDataBufferOutput: The output string.
bufferLenInput: Length of the compDataBuffer buffer allocated to
hold the output string in Unicode code-units.
statusOutput: Retrieval status. For a list of possible values, see
“NadOutputCompStatusEnum” on page 163.
typeInput: Type of data. For a list of values, see
“NadOutputCompTypeEnum” on page 164.
ReturnsReturns true if the component requested is valid. Returns false if the component
request is not valid—for example, if the requested component is not available for
the country, or if the requested type is not available for this component.
DescriptionCall getComponent_u() to retrieve a specific address component.
International ACE places the component string (which includes a
terminator) into your output buffer, compDataBuffer. The data is truncated to fit
within the length specified by the bufferLen parameter. The status parameter
indicates whether the data was truncated.
NULL
The maximum component length is NAD_MAX_COMPONENT_LENGTH,
as defined in ciie.h.
nadPtrInput: Pointer to a name-and-address object
componentSee description on previous page.
compDataBufferSee description on previous page.
bufferLenSee description on previous page.
statusSee description on previous page.
typeSee description on previous page.
errorOutput: Contains a 1 if an error occurred.
componentInput: Type of component. For a list of values, see
“NadOutputCompEnum” on page 163.
lineOutput: Line where component is located. For a list of values,
see “NadLineEnum” on page 161.
offsetOutput: Character offset of component in the line; starts at zero.
lengthOutput: Length of component.
Call this function to find the location of a particular component in the original
input data. If the component was found in the original data, the output parameters
contain the line, character offset, and length of the component, respectively. If the
component was not found, line is set to
–1, and length is set to 0 (zero).
nadPtrInput: Pointer to a name-and-address object
componentSee description above.
lineSee description above.
offsetSee description above.
lengthSee description above.
errorOutput: Contains a 1 if an error occurred.
getComponentLocation()
81
getFaultCode
()
Synopsis
Arguments
Returns
Description
C function
NadFaultCodeEnum getFaultCode();
None.
Returns the address-fault code for the address that was most recently processed
using this name-and-address object. For a list of values, see
“NadFaultCodeEnum” on page 161.
After processing an address, call this function to get the address-fault code. The
address-fault code indicates why an address could not be assigned, if applicable.
To get a fault-code string such as “F101” or a description string such as “Last line
is bad or missing,” call FlNadFaultCodeEnumToString().
NadFaultCodeEnum nadGetFaultCode(
void*nadPtr,
int*error);
nadPtrInput: Pointer to a name-and-address object
errorOutput: Contains a 1 if an error occurred.
82
International ACE Library Reference
getStandardizeLineData
()
Synopsis
Arguments
Description
C function
void getStandardizeLineData(
NadLineEnumline,
FlCharType*dataBuffer);
lineInput: Line to retrieve. For a list of values, see “NadLineEnum”
on page 161.
dataBufferOutput: The standardized data.
Call this function to retrieve a line of corrected data. The output line corresponds
to the input line, but may contain corrected data. You must provide a buffer long
enough to hold the result. The maximum data copied to the buffer is the length
returned from getStandardizeLineLength().
For U.S. and Canadian engines, if corrected data is not available, dataBuffer
contains the original data. For the international engine, if corrected data is not
available, dataBuffer is blank.
nadPtrInput: Pointer to a name-and-address object
lineSee description above.
dataBufferSee description above.
errorOutput: Contains a 1 if an error occurred.
getStandardizeLineData()
83
getStandardizeLineData_u()
Synopsisvoid getStandardizeLineData_u(
NadLineEnum line,
FlUChar* dataBuffer );
ArgumentslineInput: Line to retrieve. For a list of values,
see “NadLineEnum” on page 161.
dataBufferOutput: The standardized data.
ReturnsNone.
DescriptionCall this function to retrieve a line of corrected data. The output line corresponds
to the input line, but may contain corrected data. You must provide a buffer long
enough to hold the result. The maximum data copied to the buffer is the length
returned from getStandardizeLineLength(). The length is the number of
Unicode code-units (UTF-16 entities).
For U.S. and Canadian engines, if corrected data is not available, dataBuffer
contains the original data. For the international and Japan engine, if corrected
data is not available, dataBuffer is blank
nadPtrInput: Pointer to a name-and-address object
lineSee description above.
dataBufferSee description above.
errorOutput: Contains a 1 if an error occurred.
84
International ACE Library Reference
getStandardizeLineLength
()
Synopsis
Arguments
Returns
Description
C function
int getStandardizeLineLength(NadLineEnum line)const;
lineInput: Type of line. For a list of values, see NadLineEnum on
“NadLineEnum” on page 161.
Returns the current maximum line length.
Call this function to get the maximum length of a particular type of standardized
output line.
int nadGetStandardizeLineLength(
void*nadPtr,
NadLineEnumline,
int*error);
nadPtrInput: Pointer to a name-and-address object
lineSee description above.
errorOutput: Contains a 1 if an error occurred.
getStandardizeLineLength()
85
getStatus
()
Synopsis
Arguments
Returns
Description
C function
bool getStatus(NadStatusEnum statusFlag)const;
statusFlagInput: Type of status flag to query. For a list of values, see
“NadStatusEnum” on page 165.
Returns the boolean value of the status flag: true or false.
Call this function to query a status flag. Status flags provide information about the
address.
int nadGetStatus(
void*nadPtr,
NadStatusEnumstatusFlag,
int*error);
nadPtrInput: Pointer to a name-and-address object
statusFlagSee description above.
errorOutput: Contains a 1 if an error occurred.
Returns the SupportedCountriesEnum value for the address that was most
recently processed using this name-and-address object. For a list of values see
“SupportedCountriesEnum” on page 178.
After processing an address, call this function to get the supported country
enumerated value.
SupportedCountriesEnum nadGetSupportedCountry (
void*nadPtr,
int*error);
nadPtrInput: Pointer to a name-and-address object.
errorOutput: Contains a 1 if an error occurred.
nadPtrInput: Pointer to a name-and-address object
lineSee description above.
newDataSee description above.
tunerIndexSee description above. Not optional for C.
errorOutput: Contains a 1 if an error occurred.
88
International ACE Library Reference
insertLineData_u()
Synopsisvoid insertLineData_u(
NadLineEnum line,
const FlUChar* newData,
int tunerIndex = -1);
ArgumentslineInput: Input field to insert data into
(see “NadLineEnum” on page 161).
newDataInput: Input data.
tunerIndexOptional input: Tuner index. Use the value –1.
ReturnsNone.
DescriptionCall this function to insert input data into a specific input field on the name-and-
address object. The input data must be a
For information about which field combinations are not valid, see
“NadLineStateEnum” on page 162.
Note: If you are using the International engine, for last-line data (locality,
region, postal code), we recommend that you use either the
NAD_LINE_LASTLINE input field or the NAD_LINE_LOCALITY1,
NAD_LINE_REGION, and NAD_LINE_POSTCODE fields (rather than
NAD_LINE_MULTILINE).
nadPtrInput: Pointer to a name-and-address object
lineSee description above.
newDataSee description above.
tunerIndexSee description above. Not optional for C.
errorOutput: Contains a 1 if an error occurred.
insertLineData_u()
89
openTuner_u()
Synopsisint openTuner_u(
const FlUChar* tunerFilename );
ArgumentstunerFilenameInput: name of the file with the tuning parameters.
ReturnsReturns the tuning index.
DescriptionCall this function to open the tuning file.
Make sure the input file and path name is in Unicode encoded ASCII data.
International ACE can not process non-ASCII file or path names.
nadPtrInput and output: naddress object.
tunerFilename Input: name of the file with the tuning parameters.
errorOutput: indicates whether an error occurred.
90
International ACE Library Reference
process
()
Synopsis
Arguments
Returns
bool process(PubEngineClass* engine);
engineInput: Pointer to the engine object that should be used to process
the data stored on the name-and-address object.
The meaning of the return value varies by engine:
Australian engine: Returns true if a delivery-point identifier was assigned.
Otherwise, returns false. A return of false does not necessarily mean that no
output was produced, or that no data was corrected. It means only that a deliverypoint identifier could not be assigned for the address, which may indicate a
problem with the address.
Country ID engine: Returns true if the country was identified. Otherwise, returns
false.
International engine: Returns true if International ACE verified or generated
the postal code. Otherwise, returns false.
U.S. and Canadian engines: Returns true if the address was corrected to the finest
depth. Otherwise, returns false. A return of false does not necessarily mean that
no output was produced, but rather that the output was produced without
complete confirmation from the lookup process. For example, perhaps the
locality, region, and postal code were verified, but the address-line data could not
be verified.
Description
Call this function to use a particular engine object to process the data stored on
the name-and-address object.
After processing, the engine passes the results back to the name-and-address
object. If you use more than one engine to process a record, the name-and-address
object retains results only for the last engine it was processed on. (However, that
the name-and-address object retains the original input data until you insert new
data.)
process()
91
C function
int nadProcess(
void*nadPtr,
void*engPtr,
int*error);
nadPtrInput: Pointer to a name-and-address engine object.
engPtrInput: Pointer to the engine object that should be used to process
engineInput: A pointer to the appropriate engine object to produce the
certification report for that country.
rptBufOutput: Buffer where the report will be written. You are
responsible for allocating and deallocating the memory for this
buffer. It should be created with a size of
NAD_REPORT_LENGTH, which is defined in ciie.h.
If you want the report to write directly to a file, call setReportInfo
(RPT_TYPE,RPT_TYPE_FILE). See “setReportInfo()” on page 96.
Returns true if a report was produced successfully, false otherwise.
Call produceReport() after the file is processed to create a country specific
certification report.
Note: The default names of the report files are CAcrtrpt.txt for Canada,
UScrtrpt.txt for US, and AUcrtrpt.txt for Australia. You may set the path to
the location of these files, or change their name by calling
setFile(ENGINE_FILE_CERT_RPT, path and file name).
C function
void nadProduceReport(
void*nadPtr,
const void*engine,
FlCharType*rptBuf,
int*error);
nadPtrInput: Pointer to a name-and-address object
engineSee description above.
rptBufSee description above.
errorOutput: Contains a 1a 1 if an error occurred.
ArgumentsengineInput: A pointer to the appropriate engine object to produce the
certification report for that country.
rptBufOutput: Buffer where the report will be written. You are
responsible for allocating and deallocating the memory for this
buffer. It should be created with a size of
NAD_REPORT_LENGTH, which is defined in ciie.h. If you
want the report to write directly to a file, make this pointer
NULL.
ReturnsReturns true if a report was produced successfully, false otherwise.
DescriptionCall produceReport_u() after the file is processed to create a country specific
nadPtrInput: Pointer to a name-and-address object
engineSee description above.
rptBufSee description above.
errorOutput: Contains a 1 if an error occurred.
94
International ACE Library Reference
setReportInfo
()
There are five different options for setReportInfo(). This option allows you to set
the item to double. Use this method for U.S. or Canadian reports.
Synopsis
Arguments
Returns
Description
C function
void setReportInfo(
ReportItemEnumitem
const doublevalue);
itemInput: The item to be set.
value Input: Set the item to a value.
void
Call setReportInfo() to set information used to create certification reports.
nadPtrInput: Pointer to a name-and-address object
itemSee description above.
valueSee description above.
errorOutput: Contains a 1 if an error occurred.
setReportInfo()
95
setReportInfo
()
There are five different options for setReportInfo(). This option allows you to set
the item to init*. Use this method for U.S. or Canadian reports.
Synopsis
Arguments
Returns
Description
C function
void setReportInfo(
ReportItemEnumitem, For a list of values, see
“ReportItemEnum” on page 175
const intvalue);
itemInput: The item to set.
valueInput: Set the item to a value.
void
Call setReportInfo() to set the information used to create certification reports.
void nadSetIntReportInfo(
void*nadPtr,
ReportItemEnumitem, For a list of values, see
“ReportItemEnum” on page 175
const intvalue);
int*error);
nadPtrInput: Pointer to a name-and-address object
selectionSee description above.
valueSee description above.
errorOutput: Contains a 1 if an error occurred.
96
International ACE Library Reference
setReportInfo
()
There are five different options for setReportInfo(). This option allows you to set
the item to long. Use this method for U.S. or Canadian reports.
Synopsis
Arguments
Returns
Description
C function
void setLongReportInfo(
ReportItemEnumitem,
const longvalue);
itemInput: The item to set.
valueInput: Set the item to a value.
void
Call setReportInfo() to set the information used to create certification reports.
nadPtrInput: Pointer to a name-and-address object
selectionSee description above.
valueSee description above.
errorOutput: Contains a 1 if an error occurred.
setReportInfo()
97
setReportInfo()
There are five different options for setReportInfo(). This option allows you to set
a variety of items. Use this method for U.S. or Canadian reports.
nadPtrInput: Pointer to a name-and-address object
itemSee description above.
valueSee description above.
errorOutput: Contains a 1 if an error occurred.
100
International ACE Library Reference
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.