Title: APPX Conference 2004
1APPX Conference 2004
Interfacing APPX with External Processes
WELCOME!
2Interfacing APPX with External Processes
Communicating Out of APPX
- Using the CALL Statement
- Using the RUN Statement
- Using the STREAM Routines
- Using the LOAD URL Routine
- Using DATABASE Triggers
- Using TCP/IP Functions
- Using PIPE Functions
3Interfacing APPX with External Processes
Communicating Into APPX
- Reading FLAT Data Files
- Reading from STDIN
- Reading from Named Pipes
- Reading from TCP/IP Sockets
- Using File Level Event Points
- Using the CGI Data Importer
4Interfacing APPX with External Processes
Using the CALL Interface
- Finding the right Function
- Finding the Share Library
- Mapping the Data Arguments
- Passing the Data Values
- Getting back the Return Code
5Interfacing APPX with External Processes
CALL Finding the Right Function
- Linux apropos, man
- Windows Win32 API
- Software Manuals
- Software Vendor Website
- Google Web/Groups Search
6Interfacing APPX with External Processes
CALL Finding the Shared Library
- Linux man, ldd, nm
- Windows Win32 API, QuickView
- Software Manuals
- Software Vendor Website
- Google Web/Groups Search
7Interfacing APPX with External Processes
CALL Mapping Data Arguments
8Interfacing APPX with External Processes
CALL Passing the Data Values
- Pass by Value (SharedN)
- Pass by Reference (SharedY)
- Null Terminated Strings
- Passing Structures
- Passing a FILE parameter
9Interfacing APPX with External Processes
CALL Getting the Return Code
- T/F Indicator
- --- RETURN CODE
10Interfacing APPX with External Processes
Using the RUN Interface
- Finding the right Program
- Building the Command String
- Passing the Data Values
- Sequential or Concurrent?
- Getting back the Return Data
11Interfacing APPX with External Processes
RUN Finding the Right Program
- Linux apropos, /bin, /usr/bin
- Windows Shortcuts, Assoc.
- Software Manuals
- Software Vendor Website
- Google Web/Groups Search
12Interfacing APPX with External Processes
RUN Building the Command String
- May need full path to program
- PASS Substitution 1, 2,
- Trailing wait flag /w
- Linux Passing a \
- Windows Passing a
13Interfacing APPX with External Processes
RUN Passing the Data Values
- Data will replace 1, 2, etc.
- Unused PASSes will replace
- Shared flag not used
- Passing FILE Full pathname
- CREATE temp files before pass
14Interfacing APPX with External Processes
RUN Getting back Return Data
- T/F Indicator
- --- RETURN CODE
- Temporary Files
- Stream I/O Routines
- Record Padding
- CNV TEXT on Record
15Interfacing APPX with External Processes
Using the STREAM Interface
- The STREAM OPEN Routine
- Using READ, WRITE, CLOSE
- Using Concurrent Streams
- Using PIPES to Pass Data
- Using Other I/O Functions
16Interfacing APPX with External Processes
Stream STREAM OPEN Routine
- --- STREAM OPEN
- Pathname of File to Open
- OS Command to Execute
- Can Open for Read / Write
- Can Open Multiple Files
17Interfacing APPX with External Processes
Stream Using PIPES to Pass Data
- ps ax
- mail techsupp_at_appx.com
- Open for Read r to pipe in
- Open for Write w to pipe out
- Cant pipe both In and Out
18Interfacing APPX with External Processes
Stream Using Other I/O Functions
- OPEN returns a File Descriptor
- READ/WRITE are for Text data
- Can pass FD to I/O Functions
- fdopen() convert FD to FILE