An Introduction to APR 2.0 Christian Gross Consultant [email protected] Montreal, Canada.
-
Upload
jennifer-logan -
Category
Documents
-
view
214 -
download
1
Transcript of An Introduction to APR 2.0 Christian Gross Consultant [email protected] Montreal, Canada.
![Page 2: An Introduction to APR 2.0 Christian Gross Consultant ChristianHGross@yahoo.ca Montreal, Canada.](https://reader036.fdocuments.us/reader036/viewer/2022082816/56649d165503460f949eba06/html5/thumbnails/2.jpg)
Bio: Christian Gross
Author of several books Conference speaker Skills
– Specialization in Internet, and Infrastructure technologies
– Windows, UNIX, LINUX server development
Companies worked/consulted for– UBS, TATA, Grammer, National Westminster,
Daimler Chrysler, ETSI, ITU, Fame, NCR, etc
![Page 3: An Introduction to APR 2.0 Christian Gross Consultant ChristianHGross@yahoo.ca Montreal, Canada.](https://reader036.fdocuments.us/reader036/viewer/2022082816/56649d165503460f949eba06/html5/thumbnails/3.jpg)
Agenda
Discuss what APR represents– Why APR– Main points of APR
Go through demos that illustrate the various concepts of APR
![Page 4: An Introduction to APR 2.0 Christian Gross Consultant ChristianHGross@yahoo.ca Montreal, Canada.](https://reader036.fdocuments.us/reader036/viewer/2022082816/56649d165503460f949eba06/html5/thumbnails/4.jpg)
APR????
APR: Apache Portable Run-time Mission Statement
– The Apache Portable Run-time mission is to provide a library of routines that allows programmers to write a program once and be able to compile it anywhere
![Page 5: An Introduction to APR 2.0 Christian Gross Consultant ChristianHGross@yahoo.ca Montreal, Canada.](https://reader036.fdocuments.us/reader036/viewer/2022082816/56649d165503460f949eba06/html5/thumbnails/5.jpg)
Yet another “Portable” Runtime?
Original choices were NSPR, ACE or another library
NSPR not used because of license issues and then too many features not required
ACE used C++, which is useless with Apache Finally wrote APR, which is a continuation of
ap_ work done in Apache 1.3.x
![Page 6: An Introduction to APR 2.0 Christian Gross Consultant ChristianHGross@yahoo.ca Montreal, Canada.](https://reader036.fdocuments.us/reader036/viewer/2022082816/56649d165503460f949eba06/html5/thumbnails/6.jpg)
What APR does
Abstracts the OS into a series of Apache related functions – Simpler for porting Apache to other platforms– Solves the following problems
Threads Processes Directories
APR Core: contains fundamental portable functions
APR Util: contains functions that are not core, but need to be portable
![Page 7: An Introduction to APR 2.0 Christian Gross Consultant ChristianHGross@yahoo.ca Montreal, Canada.](https://reader036.fdocuments.us/reader036/viewer/2022082816/56649d165503460f949eba06/html5/thumbnails/7.jpg)
Core APR
Contains following functionality– Reading and writing of files– Character set conversion– Network communications using sockets– Time management used for Internet type
conversions– String management like C++ including natural order
management– UNIX Password management routines– Table management routines
![Page 8: An Introduction to APR 2.0 Christian Gross Consultant ChristianHGross@yahoo.ca Montreal, Canada.](https://reader036.fdocuments.us/reader036/viewer/2022082816/56649d165503460f949eba06/html5/thumbnails/8.jpg)
Core APR (cont.)
Contains following functionality (cont.)– UUID Internet generation– Filename canonicalization– Random data generation– Global lock management– Threads and process management – Dynamic library loading routines– Memory mapped and shared memory
![Page 9: An Introduction to APR 2.0 Christian Gross Consultant ChristianHGross@yahoo.ca Montreal, Canada.](https://reader036.fdocuments.us/reader036/viewer/2022082816/56649d165503460f949eba06/html5/thumbnails/9.jpg)
Managing Data Structures
Cross platform is problematic because not all functionality is supported
Structures look like spaghettitypdef struct foo {
#ifdef WIN32
LONG item1;
DWORD item2;
#endif
LONG shared;
};
Do not want to give programmers direct access– Violates cross-platform
capabilities False sense of security
![Page 10: An Introduction to APR 2.0 Christian Gross Consultant ChristianHGross@yahoo.ca Montreal, Canada.](https://reader036.fdocuments.us/reader036/viewer/2022082816/56649d165503460f949eba06/html5/thumbnails/10.jpg)
Incomplete Data Types
Solves problem of managing data structures across platforms
Data type is defined using a “handle” Data type is managed using a number of
routines– Programmer does not have direct access to
structure details
But not all of APR is incomplete data type based
![Page 11: An Introduction to APR 2.0 Christian Gross Consultant ChristianHGross@yahoo.ca Montreal, Canada.](https://reader036.fdocuments.us/reader036/viewer/2022082816/56649d165503460f949eba06/html5/thumbnails/11.jpg)
APR Status Codes
Used to indicate when things work and do not work Different types of errors based on the sub-system that
causes the error– Operating system native function calling error– Function calling error
APR will provide error codes for OS’s that do not support the native error or maps error codes
– Errors codes provided by layered application– Success codes
Can include extra information indicating state
![Page 12: An Introduction to APR 2.0 Christian Gross Consultant ChristianHGross@yahoo.ca Montreal, Canada.](https://reader036.fdocuments.us/reader036/viewer/2022082816/56649d165503460f949eba06/html5/thumbnails/12.jpg)
Examples
Demos illustrating the various concepts of APR– Available at www.devspace.com
Look for Apache APR Demo Code
![Page 13: An Introduction to APR 2.0 Christian Gross Consultant ChristianHGross@yahoo.ca Montreal, Canada.](https://reader036.fdocuments.us/reader036/viewer/2022082816/56649d165503460f949eba06/html5/thumbnails/13.jpg)
Where to get APR?
APR is distributed with Apache 2.x Can get standalone version by going to http://
apr.apache.org There exists an APR mailing list at above
mentioned website– Documentation is currently sparse
![Page 14: An Introduction to APR 2.0 Christian Gross Consultant ChristianHGross@yahoo.ca Montreal, Canada.](https://reader036.fdocuments.us/reader036/viewer/2022082816/56649d165503460f949eba06/html5/thumbnails/14.jpg)
Thanks!
Questions?(Send me email)