100% found this document useful (1 vote)
37 views54 pages

21st Century C C Tips From The New School 1st Edition Ben Klemens PDF Download

The document is a promotional listing for the book '21st Century C: C Tips from the New School' by Ben Klemens, which is available for digital download. It includes details such as the ISBN, publication information, and a brief description of the book's content, which covers various aspects of programming in C. Additionally, it features links to other related educational resources and books on topics like STEM education and sociology.

Uploaded by

euusctp3432
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
37 views54 pages

21st Century C C Tips From The New School 1st Edition Ben Klemens PDF Download

The document is a promotional listing for the book '21st Century C: C Tips from the New School' by Ben Klemens, which is available for digital download. It includes details such as the ISBN, publication information, and a brief description of the book's content, which covers various aspects of programming in C. Additionally, it features links to other related educational resources and books on topics like STEM education and sociology.

Uploaded by

euusctp3432
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 54

21st Century C C Tips from the New School 1st

Edition Ben Klemens - PDF Download (2025)

https://ebookultra.com/download/21st-century-c-c-tips-from-the-
new-school-1st-edition-ben-klemens/

Visit ebookultra.com today to download the complete set of


ebooks or textbooks
We have selected some products that you may be interested in
Click the link to download now or visit ebookultra.com
for more options!.

Guided Inquiry Learning in the 21st Century 1st Edition


Carol C. Kuhlthau

https://ebookultra.com/download/guided-inquiry-learning-in-the-21st-
century-1st-edition-carol-c-kuhlthau/

Transforming Institutions Undergraduate Stem Education for


the 21st Century Gabriela C. Weaver

https://ebookultra.com/download/transforming-institutions-
undergraduate-stem-education-for-the-21st-century-gabriela-c-weaver/

The Communal Idea in the 21st Century 1st Edition Eliezer


Ben-Rafael

https://ebookultra.com/download/the-communal-idea-in-the-21st-
century-1st-edition-eliezer-ben-rafael/

The Coming Revolution Capitalism in the 21st Century 1st


Edition Ben Reynolds

https://ebookultra.com/download/the-coming-revolution-capitalism-in-
the-21st-century-1st-edition-ben-reynolds/
The Virtual Self A Contemporary Sociology 21st Century
Sociology 1st Edition Ben Agger

https://ebookultra.com/download/the-virtual-self-a-contemporary-
sociology-21st-century-sociology-1st-edition-ben-agger/

Jack C Richards 50 Tips for Teacher Development Jack C.


Richards

https://ebookultra.com/download/jack-c-richards-50-tips-for-teacher-
development-jack-c-richards/

C Python Tricks And Tips 4th Edition

https://ebookultra.com/download/c-python-tricks-and-tips-4th-edition/

School Governance 1st Edition Richard C. Hunter

https://ebookultra.com/download/school-governance-1st-edition-richard-
c-hunter/

London From the Walled City to New Towns 1st Edition


Robert C. Cottrell

https://ebookultra.com/download/london-from-the-walled-city-to-new-
towns-1st-edition-robert-c-cottrell/
21st Century C C Tips from the New School 1st Edition
Ben Klemens Digital Instant Download
Author(s): Ben Klemens
ISBN(s): 9781449327149, 1449327141
Edition: 1
File Details: PDF, 7.29 MB
Year: 2012
Language: english
21st Century C

Ben Klemens

Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo


21st Century C
by Ben Klemens

Copyright © 2013 Ben Klemens. All rights reserved.


Printed in the United States of America.

Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.

O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions
are also available for most titles (http://my.safaribooksonline.com). For more information, contact our
corporate/institutional sales department: 800-998-9938 or [email protected].

Editor: Nathan Jepson Indexer: Ellen Troutman


Production Editor: Rachel Steely Cover Designer: Karen Montgomery
Copyeditor: Linley Dolby Interior Designer: David Futato
Proofreader: Teresa Horton Illustrators: Robert Romano and Rebecca Demarest

November 2012: First Edition.

Revision History for the First Edition:


2012-10-12 First release
See http://oreilly.com/catalog/errata.csp?isbn=9781449327149 for release details.

Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of
O’Reilly Media, Inc. 21st Century C, the image of a common spotted cuscus, and related trade dress are
trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a
trademark claim, the designations have been printed in caps or initial caps.

While every precaution has been taken in the preparation of this book, the publisher and author assume
no responsibility for errors or omissions, or for damages resulting from the use of the information con-
tained herein.

ISBN: 978-1-449-32714-9

[LSI]

1350398139
Table of Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix

Part I. The Environment

1. Set Yourself Up for Easy Compilation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3


Use a Package Manager 4
Compiling C with Windows 6
POSIX for Windows 6
Compiling C with POSIX 7
Compiling C Without POSIX 8
Which Way to the Library? 9
A Few of My Favorite Flags 10
Paths 12
Runtime Linking 14
Using Makefiles 15
Setting Variables 16
The Rules 18
Using Libraries from Source 21
Using Libraries from Source (Even if Your Sysadmin Doesn’t Want You To) 23
Compiling C Programs via Here Document 24
Include Header Files from the Command Line 25
The Unified Header 25
Here Documents 26
Compiling from stdin 27

2. Debug, Test, Document . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29


Using a Debugger 29
GDB Variables 32
Print Your Structures 34
Using Valgrind to Check for Errors 37
Unit Testing 39

iii
Using a Program as a Library 41
Coverage 42
Interweaving Documentation 43
Doxygen 44
Literate Code with CWEB 45
Error Checking 47
What Is the User’s Involvement in the Error? 47
The Context in Which the User Is Working 49
How Should the Error Indication Be Returned? 50

3. Packaging Your Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53


The Shell 54
Replacing Shell Commands with Their Outputs 54
Use the Shell’s for Loops to Operate on a Set of Files 56
Test for Files 57
fc 60
Makefiles vs. Shell Scripts 62
Packaging Your Code with Autotools 64
An Autotools Demo 66
Describing the Makefile with makefile.am 69
The configure Script 73

4. Version Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
Changes via diff 78
Git’s Objects 79
The Stash 82
Trees and Their Branches 83
Merging 84
The Rebase 86
Remote Repositories 87

5. Playing Nice with Others . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89


The Process 89
Writing to Be Read by Nonnatives 89
The Wrapper Function 90
Smuggling Data Structures Across the Border 91
Linking 92
Python Host 93
Compiling and Linking 94
The Conditional Subdirectory for Automake 94
Distutils Backed with Autotools 96

iv | Table of Contents
Part II. The Language

6. Your Pal the Pointer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101


Automatic, Static, and Manual Memory 101
Persistent State Variables 103
Pointers Without malloc 105
Structures Get Copied, Arrays Get Aliased 106
malloc and Memory-Twiddling 109
The Fault Is in Our Stars 110
All the Pointer Arithmetic You Need to Know 111

7. C Syntax You Can Ignore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115


Don’t Bother Explicitly Returning from main 116
Let Declarations Flow 116
Set Array Size at Runtime 118
Cast Less 119
Enums and Strings 120
Labels, gotos, switches, and breaks 122
goto Considered 122
switch 123
Deprecate Float 126

8. Obstacles and Opportunity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131


Cultivate Robust and Flourishing Macros 131
Preprocessor Tricks 135
Linkage with static and extern 137
Declare Externally Linked Elements Only in Header Files 139
The const Keyword 141
Noun-Adjective Form 142
Tension 143
Depth 144
The char const ** Issue 145

9. Text . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Making String Handling Less Painful with asprintf 149
Security 150
Constant Strings 151
Extending Strings with asprintf 152
A Pæan to strtok 154
Unicode 158
The Encoding for C Code 160
Unicode Libraries 161

Table of Contents | v
The Sample Code 162

10. Better Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165


Compound Literals 166
Initialization via Compound Literals 167
Variadic Macros 167
Safely Terminated Lists 168
Foreach 169
Vectorize a Function 170
Designated Initializers 171
Initialize Arrays and Structs with Zeros 173
Typedefs Save the Day 174
A Style Note 176
Return Multiple Items from a Function 177
Reporting Errors 178
Flexible Function Inputs 180
Declare Your Function as printf-Style 181
Optional and Named Arguments 183
Polishing a Dull Function 185
The Void Pointer and the Structures It Points To 190
Functions with Generic Inputs 190
Generic Structures 194

11. Object-Oriented Programming in C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199


What You Don’t Get (and Why You Won’t Miss It) 200
Scope 200
Overloaded with Operator Overloading 203
Extending Structures and Dictionaries 207
Extending a Structure 208
Implementing a Dictionary 212
Base Your Code on Pointers to Objects 216
Functions in Your Structs 217
Count References 221
Example: A Substring Object 222
An Agent-Based Model of Group Formation 226

12. Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233


GLib 233
POSIX 234
Using mmap for Gigantic Data Sets 234
Easy Threading with Pthreads 236
The GNU Scientific Library 244
SQLite 246

vi | Table of Contents
The Queries 247
libxml and cURL 248

Epilogue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ccliii

Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255

Bibliography . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261

Table of Contents | vii


Preface

Is it really punk rock


Like the party line?

—Wilco, “Too Far Apart”

C Is Punk Rock
C has only a handful of keywords and is a bit rough around the edges, and it rocks.
You can do anything with it. Like the C, G, and D chords on a guitar, you can learn
the basic mechanics pretty quickly, and then spend the rest of your life getting better.
The people who don’t get it fear its power and think it too edgy to be safe. By all
rankings, it is consistently the most popular language that doesn’t have a corporation
or foundation spending money to promote it.1
Also, the language is about 40 years old, which makes it middle-aged. It was written
by a few guys basically working against management—the perfect punk rock origins—
but that was in the 1970s, and there’s been a lot of time for the language to go main-
stream.
What did people do when punk rock went mainstream? In the decades since its advent
in the 1970s, punk certainly has come in from the fringes: The Clash, The Offspring,
Green Day, and The Strokes sold millions of albums worldwide (to name just a few),
and I have heard lite instrumental versions of songs from the punk spinoff known as
grunge at my local supermarket. The former lead singer of Sleater-Kinney now has a
popular sketch comedy show that frequently lampoons punk rockers.2 One reaction
to the continuing evolution would be to take the hard line and say that the original stuff
was punk and everything else is just easy punk pop for the masses. The traditionalists
can still play their albums from the ’70s, and if the grooves are worn out, they can

1. This preface owes an obvious and huge debt to “Punk Rock Languages: A Polemic,” by Chris Adamson,
at http://pragprog.com/magazines/2011-03/punk-rock-languages.
2. With lyrics like “Can’t get to heaven with a three-chord song,” maybe Sleater-Kinney was post-punk?
Unfortunately, there is no ISO Punk standard we can look to for precise in-or-out definitions.

ix
download a digitally mastered edition. They can buy Ramones hoodies for their
toddlers.
Outsiders don’t get it. Some of them hear the word punk and picture something out of
the 1970s—a historic artifact about some kids that were, at the time, really doing
something different. The traditionalist punks who still love and play their 1973 Iggy
Pop LPs are having their fun, but they bolster the impression that punk is ossified and
no longer relevant.
Getting back to the world of C, we have both the traditionalists, waving the banner of
ANSI ’89, and those who will rock out to whatever works and may not even realize that
the code they are writing would not have compiled or run in the 1990s. Outsiders don’t
get the difference. They see still-in-print books from the 1980s and still-online tutorials
from the 1990s, they hear from the hardcore traditionalists who insist on still writing
like that today, and they don’t even know that the language and the rest of its users
continue to evolve. That’s a shame, because they’re missing out on some great stuff.
This is a book about breaking tradition and keeping C punk rock. I really don’t care to
compare the code in this book to the original C specification in Kernighan & Ritchie’s
1978 book. My telephone has 512 megabytes of memory, so why are our C textbooks
still spending pages upon pages covering techniques to shave kilobytes off of our exe-
cutables? I am writing this on a bottom-of-the-line red netbook that can accommodate
3,200,000,000 instructions per second; what do I care about whether an operation
requires comparing 8 bits or 16? We should be writing code that we can write quickly
and that is readable by our fellow humans. We’re still writing in C, so our readable but
imperfectly optimized code will still run an order of magnitude faster than if we’d
written comparable code in any number of alternative, bloated languages.

Q & A (Or, the Parameters of the Book)


Q: How is this C book different from all others?
A: C textbooks are a pretty uniform bunch (I’ve read a lot of them, including [Griffiths
2012], [Kernighan 1978], [Kernighan 1988], [Kochan 2004], [Oualline 1997], [Perry
1994], [Prata 2004], and [Ullman 2004]). Most were written before the C99 standard
simplified many aspects of usage, and you can tell that some of those now in their Nth
edition just pasted in a few notes about updates rather than really rethinking how to
use the language. They all mention that there might be libraries that you could maybe
use in writing your own code, but they predate the installation tools and ecosystem we
have now that make using those libraries reliable and reasonably portable. Those text-
books are still valid and still have value, but modern C code just doesn’t look like the
code in those textbooks.
This book picks up where they left off, reconsidering the language and the ecosystem
in which it lives. The storyline here is about using libraries that provide linked lists and

x | Preface
XML parsers, not writing new ones from scratch. It is about writing code that is readable
and function interfaces that are user-friendly.
Q: Who is this book for? Do I need to be a coding guru?
A: You have experience coding in any language, maybe Java or a scripting language
such as Perl. I don’t have to sell you on why your code shouldn’t just be one long routine
with no subfunctions.
You have some knowledge of C, but don’t worry if you don’t know it too well—as I’ll
detail, there’s a lot you’re better off never learning. If you are a blank slate with respect
to C syntax, it really is an aggressively simple language, and your search engine will
point you to dozens of C tutorials online; if you have experience with another language,
you should be able to get the basics in an hour or two.
I might as well point out to you that I have also written a textbook on statistical and
scientific computing, Modeling with Data [Klemens 2008]. Along with lots of details of
dealing with numeric data and using statistical models for describing data, it has a
standalone tutorial on C, which I naturally think overcomes many of the failings of
older C tutorials.
Q: I’m an application programmer, not a kernel hacker. Why should I use C instead
of a quick-to-write scripting language like Python?
A: If you are an application programmer, this book is for you. I read people asserting
that C is a systems language, which impresses me as so un-punk—who are they to tell
us what we’re allowed to write?
Statements in the way of “Our language is almost as fast as C, but is easier to write”
are so common that they are almost cliché. Well, C is definitely as fast as C, and the
purpose of this book is to show you that C is easier to write than the textbooks from
decades past imply that it is. You don’t have to call malloc and get elbow-deep in
memory management half as often as the systems programmers of the 1990s did, we
have facilities for easier string handling, and even the core syntax has evolved to make
for more legible code.
I started writing C in earnest because I had to speed up a simulation in a scripting
language, R. Like so many other scripting languages, R has a C interface and encourages
the user to make use of it any time the host language is too slow. Eventually, I had so
many functions jumping out from the R script to C code that I just dropped the host
language entirely. Next thing you know, I’m writing a book on modern C technique.
Q: It’s nice that application programmers coming from scripting languages will like
this book, but I am a kernel hacker. I taught myself C in fifth grade and sometimes have
dreams that correctly compile. What new material can there be for me?
A: C really has evolved in the last 20 years. As I’ll discuss later, the set of things we are
guaranteed that all C compilers support has changed with time, thanks to two new C

Preface | xi
standards since the ANSI standard that defined the language for so long. Maybe have
a look at Chapter 10 and see if anything there surprises you.
Also, the environment has advanced. Autotools has entirely changed how distribution
of code happens, meaning that it is much easier to reliably call other libraries, meaning
that our code should spend less time reinventing common structures and routines and
more time calling the sort of libraries discussed throughout this book.
Q: I can’t help but notice that about a third of this book has almost no C code in it.
A: It is true: good C practice requires gathering good C tools. If you’re not using a
debugger (standalone or part of your IDE), you’re making your life much more difficult.
If you tell me that it’s impossible to track down memory leaks, then that means that
you haven’t heard of Valgrind, a system designed to point out the exact line where
memory leaks and errors occurred. Python and company have built-in package man-
agers; C’s de facto cross-platform packaging system, Autotools, is a standalone system
that is its own story.
If you use an attractive Integrated Development Environment (IDE) as a wrapper for
all these various tools, you may still benefit from knowing how your IDE is dealing with
environment variables and other minutiæ that have been hidden from you but still crop
up and throw errors at you.
Q: Some of these tools you talk about are old. Aren’t there more modern alternatives
to these shell-oriented tools?
A: If we make fun of people who reject new things just because they’re new, then we
have no right to reject old things just because they’re old.
One can find reasonable sources putting the first six-string guitar around 1200, the first
four-string violin circa 1550, and the piano with keyboard around 1700. The odds are
good that most (if not all) of the music you listen to today will involve one of these
instruments. Punk rock didn’t happen by rejecting the guitar, but by using it creatively,
such as piping the guitar’s output through new filters.
Q: I have the Internet, and can look up commands and syntax details in a second or
two, so, really, why should I read this book?
A: It’s true: you can get an operator precedence table from a Linux or Mac command
prompt with man operator, so why am I going to put one here?
I’ve got the same Internet you’ve got, and I’ve spent a lot of time reading it. So I have
a good idea of what isn’t being talked about, and that’s what I stick to here. When
introducing a new tool, like gprof or GDB, I give you what you need to know to get
your bearings and ask your search engine coherent questions, and what other textbooks
missed (which is a lot).

xii | Preface
Standards: So Many to Choose From
Unless explicitly stated otherwise, everything in this book conforms to the ISO C99
and C11 standards. To make sense of what that means, and give you some historical
background, let us go through the list of major C standards (passing on the minor
revisions and corrections).
K & R (circa 1978)
Dennis Ritchie, Ken Thompson, and a handful of other contributors came up with
C while putting together the Unix operating system. Brian Kernighan and Dennis
Ritchie eventually wrote down a description of the language in the first edition of
their book, which set the first de facto standard [Kernighan 1978].
ANSI C89
Bell Labs handed over the stewardship of the language to the American National
Standards Institute. In 1989, they published their standard, which made a few
improvements over K & R. The second edition of K & R’s book included a full
specification of the language, which meant that tens of thousands of programmers
had a copy of the ANSI standard on their desks [Kernighan 1988]. The ANSI stan-
dard was adopted by the ISO in 1990 with no serious changes, but ANSI `89 seems
to be the more common term (and would make a great t-shirt slogan).
A decade passed. C went mainstream, in the sense that the base code for more or less
every PC and every Internet server was written in C, which is as mainstream as a human
endeavor could possibly become.
During this period, C++ split off and hit it big (although not quite as big). C++ was
the best thing to ever happen to C. While every other language was bolting on extra
syntax to follow the object-oriented trend and whatever other new tricks came to the
authors’ minds, C stuck to the standard. The people who wanted stability and porta-
bility used C, the people who wanted more and more features so they could wallow in
them like moist hundred dollar bills got C++, and everybody was happy.
ISO C99
The C standard underwent a major revision a decade later. Additions were made
for numeric and scientific computing, with a standard type for complex numbers
and some type-generic functions. A few conveniences from C++ got lifted, includ-
ing one-line comments (which originally came from one of C’s predecessor lan-
guages, BCPL) and being able to declare variables at the head of for loops. Using
structures was made easier thanks to a few additions to the rules for how they can
be declared and initialized, plus some notational conveniences. Things were mod-
ernized to acknowledge that security matters and that not everybody speaks
English.
When you think about just how much of an impact C89 had, and how the entire
globe was running on C code, it’s hard to imagine the ISO being able to put out
anything that wouldn’t be widely criticized—even a refusal to make any changes

Preface | xiii
would be reviled. And indeed, this standard was controversial. There are two com-
mon ways to express a complex variable (rectangular and polar coordinates)—so
where does the ISO get off picking one? Why do we need a mechanism for variable-
length macro inputs when all the good code got written without it? In other words,
the purists accused the ISO of selling out to the pressure for more features.
As of this writing, most compilers support C99 plus or minus a few caveats; the
long double type seems to cause a lot of trouble, for example. However, there is
one notable exception to this broad consensus: Microsoft currently refuses to add
C99 support to its Visual Studio C++ compiler. The section “Compiling C with
Windows” on page 6 covers some of the many ways to compile C code for
Windows, so not using Visual Studio is at most an inconvenience, and having a
major establishment player tell us that we can’t use ISO-standard C only bolsters
the punk rock of it all.
C11
Self-conscious about the accusations of selling out, the ISO made few serious
changes in the third edition of the standard. We got a means of writing type-generic
functions, and things were modernized to further acknowledge that security mat-
ters and that not everybody speaks English.
I’m writing this in 2012, shortly after the C11 standard came out in December of
2011, and there’s already some support from compilers and libraries.

The POSIX Standard


That’s the state of things as far as C itself goes, but the language coevolved with the
Unix operating system, and you will see throughout the book that the interrelationship
matters for day-to-day work. If something is easy on the Unix command line, then it is
probably because it is easy in C; Unix tools are often written to facilitate writing C code.
Unix
C and Unix were designed at Bell Labs in the early 1970s. During most of the 20th
century, Bell was being investigated for monopolistic practices, and one of its
agreements with the US federal government included promises that Bell would not
expand its reach into software. So Unix was given away for free for researchers to
dissect and rebuild. The name Unix is a trademark, originally owned by Bell Labs
and subsequently traded off like a baseball card among a number of companies.
Variants of Unix blossomed, as the code was looked over, reimplemented, and im-
proved in different ways by diverse hackers. It just takes one little incompatibility to
make a program or script unportable, so the need for some standardization quickly
became apparent.

xiv | Preface
POSIX
This standard, first established by the Institute of Electrical and Electronics Engi-
neers (IEEE) in 1988, provided a common basis for Unix-like operating systems.
It specifies how the shell should work, what to expect from commands like ls and
grep, and a number of C libraries that C authors can expect to have available. For
example, the pipes that command-line users use to string together commands are
specified in detail here, which means C’s popen (pipe open) function is POSIX-
standard, not ISO C standard. The POSIX standard has been revised many times;
the version as of this writing is POSIX:2008, and is what I am referring to when I
say that something is POSIX-standard. A POSIX-standard system must have a C
compiler available, via the command name c99.
This book will make use of the POSIX standard, though I’ll tell you when.
With the exception of many members of a family of OSes from Microsoft, just
about every current operating system you could name is built on a POSIX-com-
pliant base: Linux, Mac OS X, iOS, webOS, Solaris, BSD—even Windows servers
offer a POSIX subsystem. And for the hold-out OSes, “Compiling C with Win-
dows” on page 6 will show you how to install a POSIX subsystem.
Finally, there are two more implementations of POSIX worth noting because of their
prevalence and influence:
BSD
After Unix was sent out from Bell Labs for researchers to dissect, the nice people
at the University of California, Berkeley, made major improvements, eventually
rewriting the entire Unix code base to produce the Berkeley Software Distribution.
If you are using a computer from Apple, Inc., you are using BSD with an attractive
graphical frontend. BSD goes beyond POSIX in several respects, and we’ll see a
function or two that are not part of the POSIX standard but are too useful to pass
up (most notably the lifesaver that is asprintf).
GNU
It stands for GNU’s Not Unix, and is the other big success story in independently
reimplementing and improving on the Unix environment. The great majority of
Linux distributions use GNU tools throughout. There are very good odds that you
have the GNU Compiler Collection (gcc) on your POSIX box—even BSD uses it.
Again, the gcc defines a de facto standard that extends C and POSIX in a few ways,
and I will be explicit when making use of those extensions.
Legally, the BSD license is slightly more permissive than the GNU license. Because some
parties are deeply concerned with the political and business implications of the licenses,
one can typically find both GNU and BSD versions of most tools. For example, both
the GNU Compiler Collection (gcc) and the BSD’s clang are top-notch C compilers.
The authors from both camps closely watch and learn from each other’s work, so we
can expect that the differences that currently exist will tend to even out over time.

Preface | xv
The Legal Sidebar
US law no longer has a registration system for copyright: with few exceptions, as soon
as anybody writes something down, it is copyrighted.
Of course, distribution of a library depends on copying from hard drive to hard drive,
and there are a number of common mechanisms for granting the right to copy a copy-
righted work with little hassle.
• The GNU Public License allows unlimited copying and use of the source code and
its executable version. There is one major condition: If you distribute a program
or library based on the GPLed source code, then you must distribute the source
code to your program. Note well that if you use your program in-house and don’t
distribute it, this condition doesn’t hold, and you have no obligation to distribute
source. Running a GPLed program, like compiling your code with gcc, does not
in itself obligate you to distribute source code, because the program output (such
as the executable you just compiled) is not considered to be based on or a derivative
of gcc. [Example: the GNU Scientific Library.]
• The Lesser GPL is much like the GPL, but it explicitly stipulates that if you are
linking to an LGPL library as a shared library, then your code doesn’t count as a
derivative work, and you aren’t obligated to distribute source. That is, you can
distribute closed-source code that links to an LGPL library. [Example: GLib.]
• The BSD license requires that you preserve copyrights and disclaimers for BSD-
licensed source code, but doesn’t require that you redistribute source code.
[Example: Libxml2, under the BSD-like MIT license.]
Please note the usual disclaimer: I am not a lawyer, and this is a sidebar summary of
several rather long legal documents. Read the documents themselves or consult a lawyer
if you are unsure about how the details apply to your situation.

Some Logistics
Conventions Used in This Book
The following typographical conventions are used in this book:
Italic
Indicates new terms, filenames and file paths, URLs, and email addresses. Many
new terms are defined in a glossary at the end of this book.
Constant width
Used for program listings, as well as within paragraphs to refer to program elements
such as variable or function names, databases, data types, environment variables,
statements, and keywords.

xvi | Preface
Constant width italic
Shows text that should be replaced with user-supplied values or by values deter-
mined by context.

This icon signifies a tip, suggestion, or general note.

Your Turn: These are exercises, to help you learn by doing and give
you an excuse to get your hands on a keyboard.

This icon indicates a warning or caution.

Using Code Examples


This book is here to help you get your job done. In general, you may use the code in
this book in your programs and documentation. You do not need to contact us for
permission unless you’re reproducing a significant portion of the code. For example,
writing a program that uses several chunks of code from this book does not require
permission. Selling or distributing a CD-ROM of examples from O’Reilly books does
require permission. Answering a question by citing this book and quoting example
code does not require permission. Incorporating a significant amount of example code
from this book into your product’s documentation does require permission.
The code examples for this title can be found here: http://examples.oreilly.com/
0636920025108/.
We appreciate, but do not require, attribution. An attribution usually includes the title,
author, publisher, and ISBN. For example: “21st Century C by Ben Klemens (O’Reilly).
Copyright 2013 Ben Klemens, 978-1-449-32714-9.”
If you feel your use of code examples falls outside fair use or the permission given above,
feel free to contact us at [email protected].

Safari® Books Online


Safari Books Online (www.safaribooksonline.com) is an on-demand digital
library that delivers expert content in both book and video form from the
world’s leading authors in technology and business.

Preface | xvii
Technology professionals, software developers, web designers, and business and cre-
ative professionals use Safari Books Online as their primary resource for research,
problem solving, learning, and certification training.
Safari Books Online offers a range of product mixes and pricing programs for organi-
zations, government agencies, and individuals. Subscribers have access to thousands
of books, training videos, and prepublication manuscripts in one fully searchable da-
tabase from publishers like O’Reilly Media, Prentice Hall Professional, Addison-Wesley
Professional, Microsoft Press, Sams, Que, Peachpit Press, Focal Press, Cisco Press, John
Wiley & Sons, Syngress, Morgan Kaufmann, IBM Redbooks, Packt, Adobe Press, FT
Press, Apress, Manning, New Riders, McGraw-Hill, Jones & Bartlett, Course Tech-
nology, and dozens more. For more information about Safari Books Online, please visit
us online.

How to Contact Us
Please address comments and questions concerning this book to the publisher:
O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)
We have a web page for this book, where we list errata, examples, and any additional
information. You can access this page at http://oreil.ly/21st_century_c.
To comment or ask technical questions about this book, send email to
[email protected].
For more information about our books, courses, conferences, and news, see our website
at http://www.oreilly.com.
Find us on Facebook: http://facebook.com/oreilly
Follow us on Twitter: http://twitter.com/oreillymedia
Watch us on YouTube: http://www.youtube.com/oreillymedia

xviii | Preface
Other documents randomly have
different content
sulkeutuivat, kun Kudu oli poistunut taivaalta, ja toiset kukat taas
aukenivat yöllä, niin hän sai ällistyksekseen nähdä, ettei Mumga ollut
lainkaan pannut merkille näitä mielenkiintoisia seikkoja, vaikka hän
voi tuumalleen ilmoittaa, missä lihavimmat toukat piilivät.

Tarzanista nämä seikat olivat ihmeitä. Ne vetosivat hänen


järkeensä ja mielikuvitukseensa. Hän näki kukkien sulkeutuvan ja
avautuvan; hän näki eräiden kukkien aina kääntyvän aurinkoon päin;
hän näki lehtiä, jotka liikkuivat, vaikkei lainkaan tuullut; hän näki
köynnösten elollisten olentojen lailla kiipeävän isojen puiden runkoja
ja oksia myöten; ja Apinain Tarzanista kukat, köynnökset ja puut
olivat elollisia olentoja. Usein hän puheli niille, kuten myöskin
Gorolle, kuulle ja Kudulle, auringolle, ja oli aina pahoillaan, kun ne
eivät vastanneet. Hän kyseli niiltä monenlaisia; mutta ne eivät
voineet vastata, vaikka hän tiesi, että suhina oli lehtien kieltä — ne
puhelivat keskenään.

Tuulen aiheuttajana hän piti puita ja ruohoa. Hän arveli niiden


huojuttavan itseään edestakaisin, synnyttäen tuulta. Millään muulla
tavoin hän ei kyennyt selittämään tätä ilmiötä. Sateen aiheuttajana
hän taas piti tähtiä, kuuta ja aurinkoa; mutta hänen olettamuksensa
ei ollut lainkaan viehättävä eikä runollinen.

Kun Tarzan tänä iltana virui aatoksissaan, välähti hänen


tuotteliaaseen mielikuvitukseensa selitys kuusta ja tähdistä. Hän
kerrassaan ihastui siitä. Taug nukkui läheisessä haarautumassa.
Tarzan hyppäsi hänen viereensä.

"Taug!" hän huudahti. Heti oli kookas uros valveilla niskakarvat


pörhössä, sillä öinen kutsu sai hänet aavistamaan vaaraa, "Katsos,
Taug!" intoili Tarzan, osoittaen tähtiä. "Katso Numan, Saborin, Shitan
ja Dangon silmiä. Ne vaanivat Goron ympärillä karatakseen hänen
kimppuunsa ja tappaakseen hänet. Näetkö Goron silmät ja nenän ja
suun? Ja hänen kasvoiltaan hohtava valo on sen ison nuotion valoa,
jonka hän on virittänyt ajaakseen Numan, Saborin, Shitan ja Dangon
kauaksi.

"— Joka puolella hänen ympärillään on silmiä, Taug, näethän!


Mutta ne eivät mene kovin likelle tulta — silmiä on vain vähän Goron
lähellä. Ne pelkäävät tulta! Juuri tuli pelastaa Goron Numalta. Näetkö
ne, Taug? Jonakin yönä Numa on hyvin nälissään ja raivoissaan —
silloin hän hyppää Goron ympärillä olevien orjantappura-pensaiden
ylitse, eikä meillä ole sitten enää valoa, senjälkeen kun Kudu
vetäytyy pesäänsä — yö on synkkä, niin pimeä kuin silloin, kun Goro
on laiska ja nukkuu myöhään yöhön tai kun hän vaeltaa taivaalla
päiväsaikaan unohtaen viidakon ja sen asukkaat".

Taug katsahti tylsästi taivaalle ja sitten Tarzaniin. Putosi lentotähti,


jättäen jälkeensä taivaalle hehkuvan uran.

"Katso"! kirkaisi Tarzan. "Goro heitti palavalla kekäleellä Numaa."

Taug mietti. "Numa on maassa", hän virkkoi. "Numa ei metsästä


puiden yläpuolella." Mutta hän silmäili uteliaasti ja hieman peloissaan
kirkkaita tähtiä, ikäänkuin näkisi ne ensimmäisen kerran, ja
epäilemättä Taug näkikin tähdet ensimmäisen kerran, vaikka ne
olivat olleet taivaalla joka yö koko hänen elämänsä ajan. Taugista ne
olivat samanlaisia kuin upeat viidakkokukkaset — hän ei voinut
syödä niitä eikä senvuoksi ollut niistä tietävinäänkään.

Taug oli levoton ja hermostunut. Pitkän aikaa hän virui


nukkumatta, tarkastellen tähtiä — Goroa, kuuta, ympäröivien
petojen hehkuvia silmiä — Goroa, jonka valossa apinat tanssivat
savisten rumpujen säestyksellä. Jos Numa söisi Goron, niin sitten ei
enää voitaisi pitää dum-dum-juhlia. Se ajatus masensi Taugia. Hän
vilkaisi Tarzaniin melkein pelokkaasti. Miksi hänen ystävänsä oli niin
erilainen kuin heimon muut jäsenet? Ei kukaan niistä, joita Taug oli
eläissään tuntenut, ollut lausunut noin kummallisia ajatuksia kuin
Tarzan. Apina raapi päätään ja aprikoi hämärästi, oliko Tarzanin
seura turvallista, mutta sitten hän vähitellen, vaivaloisesti aivojaan
pinnistettyään muisti, että Tarzan oli auttanut häntä enemmän kuin
yksikään muu apina, vieläkin enemmän kuin heimon voimakkaat ja
viisaat urokset.

Juuri Tarzan oli pelastanut hänet neekerien kynsistä vieläpä


samoihin aikoihin kun Taug oli luullut Tarzanin halajavan Tikaa
omakseen. Juuri Tarzan oli pelastanut Taugin pikku balun hengen.
Juuri Tarzan oli keksinyt ja toteuttanut suunnitelman Tikan ryöstäjän
takaa-ajamiseksi ja ryöstetyn vapauttamiseksi. Tarzan oli taistellut ja
vuodattanut vertaan Taugia auttaessaan niin monta kertaa, että
Taugille vaikka hän olikin vain raaka apina, oli painunut mieleen
tulinen uskollisuus, jota ei enää mikään voinut horjuttaa — hänen
ystävyytensä Tarzania kohtaan oli muuttunut tavaksi, melkeinpä
osaksi hänen luonnostaan, joka pysyisi niin kauan kuin Taug eläisi.
Hän ei koskaan näyttänyt minkäänlaisia ulkoisia merkkejä
kiintymyksestään — hän murisi Tarzanille kuten kaikille muillekin
uroksille, jotka tulivat liian lähelle hänen ollessaan ruuan haussa —
mutta hän olisi voinut kuolla Tarzanin tähden. Hän tiesi sen, ja
Tarzan tiesi sen; mutta sellaisista asioista eivät apinat puhele — he
ilmaisevat hienompia tunteitaan enemmän teoilla kuin sanoilla. Mutta
nyt oli Taug huolestunut ja vaipui jälleen uneen, yhä ajatellen
toverinsa kummallisia sanoja.

Seuraavana päivänä hän mietti niitä taaskin ja aikomatta millään


muotoa kavaltaa mainitsi Guntolle, mitä Tarzan oli viittaillut Goron
ympärillä olevista silmistä ja siitä mahdollisuudesta, että Numa
ennemmin tai myöhemmin hyökkäisi kuun kimppuun ja söisi hänet.
Apinain mielestä ovat kaikki isot luonnonesineet miespuolisia, ja
niinpä Gorokin, joka oli isoin kappale öisellä taivaalla, oli uros.

Gunto puri nahkasiekaleen känsittyneestä sormestaan ja muisteli,


että Tarzan oli kerran väittänyt puiden keskustelevan keskenään, ja
Gozan kertoi nähneensä apinamiehen tanssivan kuutamossa yksin
Shitan, pantterin, kanssa. He eivät tienneet, että Tarzan oli heittänyt
köytensä silmukan rajun pedon kaulaan, sitonut sen puuhun ja vasta
sitten laskeutunut maahan hyppimään vimmastuneen kissaeläimen
edessä, ärsyttäen sitä.

Toiset kertoivat nähneensä Tarzanin ratsastamassa Tantorin,


norsun, selässä ja puhuivat siitä, kuinka hän oli tuonut neekeripojan,
Taibon, heimon keskuuteen, ja salaperäisistä esineistä, joita hän
käsitteli omituisessa pesässä meren rannalla. He eivät olleet koskaan
ymmärtäneet hänen kirjojaan, ja näytettyään niitä parille heimon
jäsenelle ja huomattuaan, etteivät edes kuvat tehneet heidän
aivoihinsa mitään vaikutusta, oli hän luopunut yrittämästäkin.

"Tarzan ei ole apina", vakuutti Gunto. "Hän toimittaa Numan


syömään meitä, kuten hän aikoo syöttää hänelle Goron. Meidän
pitäisi surmata hänet."

Heti pörhisti Taug niskakarvojaan. Surmata Tarzan! "Ensin teidän


on tapettava Taug", ärähti hän ja lönkytti tiehensä ruokailemaan.

Mutta juonittelijoihin yhtyi toisia. He ajattelivat monia Tarzanin


suorittamia töitä, joita apinat eivät tee eivätkä käsitä. Taaskin Gunto
äänesti, että tarmangani, valkea apina, olisi surmattava, ja toiset,
joissa kuulemansa jutut herättivät pelkoa ja jotka pelkäsivät Tarzanin
suunnittelevan Goron tappamista, tervehtivät ehdotusta hyväksyvästi
murahdellen.

Heidän joukossaan oli Tika, joka kuunteli hörössä korvin; mutta


hän ei korottanut ääntään suunnitelman puolesta. Sensijaan hän
pörhisti niskakarvansa, paljasti torahampaansa ja lähti sitten
etsimään Tarzania; mutta hän ei löytänyt apinamiestä, koska tämä
oli harhailemassa kaukana pyyntimatkoillaan. Taugin hän kuitenkin
löysi ja kertoi tälle, mitä toiset suunnittelivat, ja kookas uros polki
jaloillaan maata ja ärjyi. Hänen verestävät silmänsä kiiluivat
suuttumuksesta, hänen ylähuulensa meni irveen, niin että
torahampaat paljastuivat ja hänen niskakarvansa nousivat pystyyn;
mutta sitten kiiti nakertaja aukeaman poikki, ja Taug syöksähti sitä
tavoittamaan. Heti hän näytti unohtaneen ystävänsä vihollisia
kohtaan tuntemansa raivon; mutta sellainen oli apinain mieli.

Useiden kilometrien päässä venyi Tarzan huolettomana Tantorin,


norsun, leveällä päälaella. Hän raapi isojen korvien taustaa
teräväkärkisellä tikulla ja puheli isolle paksunahkaiselle kaikesta siitä,
mitä hänen tummatukkaisessa päässään pyöri. Tantor ymmärsi hyvin
vähän, jos ollenkaan, hänen sanojaan; mutta Tantor oli mainio
kuuntelija, nauttien ystävänsä, rakastamansa ystävän seurasta ja
hivelevästä raapimisesta.

Numa; leijona, tunsi ihmisen hajun ja hiipi varovasti sitä kohti,


kunnes sai näkyviinsä valtavan, vankkahampaisen koirasnorsun
selässä olevan saaliinsa. Sitten se äristen ja murahdellen kääntyi
etsimään suotuisampia metsästysmaita.

Norsun sieraimiin kantautui leijonan haju pyörtävän tuulahduksen


mukana; hän kohotti kärsäänsä ja pärisytti sitä äänekkäästi. Tarzan
ojentautui veltosti taaksepäin loikomaan pitkin pituuttaan selällään
norsun karkeassa selässä. Hänen kasvojensa ympärillä surisi
kärpäsiä tiheänä parvena; mutta puusta katkaisemallaan lehväisellä
oksalla hän verkkaisesti hätisteli niitä pois.

"Tantor", hän sanoi, "on hauska elää. On hauska venyä vilpoisessa


siimeksessä. On hauska katsella vihreitä varjoja. On hauska katsella
vihreitä puita, ja kukkien kirkkaita värejä — kaikkea, mitä
Bulamutumoregare on meitä varten luonut. Hän on meille hyvin
hyvä, Tantor; hän on antanut sinulle hentoja lehtiä, puunkuorta ja
mehevää ruohoa syödäksesi; minulle hän on antanut Baran, Hortan
ja Pisahin, hedelmiä, pähkinöitä ja juuria. Hän on varannut kullekin
sitä ravintoa, josta kukin enimmän pitää. Ja hän vaatii meiltä vain,
että olemme kylliksi voimakkaita tai kylliksi taitavia ottaaksemme
sen. Niin, Tantor, on hupaista elää. Minusta olisi kuolema
kammottava."

Tantorilta, pääsi heikko kurkkuäännähdys ja hän taivutti kärsäänsä


ylöspäin hyväilläkseen apinamiehen poskea sen päässä olevalla
sormimaisella lisäkkeellä.

"Tantor", pyysi Tarzan äkkiä, "käänny hakemaan ruokaa siltä


suunnalta, missä Kertshakin, isonapinan, heimo on, että Tarzan saisi
ratsastaa kotiin eikä hänen tarvitsisi kävellä!"

Norsu kääntyi ja lähti verkkaisesti astelemaan leveää, puiden


reunustamaa polkua pitkin, seisahtuen silloin tällöin katkaisemaan
hennon oksan tai kiskaisemaan syötävää kuorta tien vieressä
kasvavasta puusta. Tarzan loikoi vatsallaan eläimen päälaella ja
selässä, antaen jalkojensa riippua kahden puolen, pää kämmenien
varassa, nojaten kyynärpäitään leveään kalloon. Ja niin he hitaasti
lähestyivät heimon kokoontumispaikkaa.
Vähää ennen kuin he saapuivat aukeamalle pohjoisesta, tuli sen
laidalle etelästäpäin toinen olento — vankkatekoinen musta soturi,
joka liikkui viidakossa varovasti, kaikki aistit valppaina niiden monien
vaarojen varalta, joita saattoi väijyä kaikkialla tien ohessa. Kuitenkin
hän meni eteläisen vahdin alitse, joka oli sijoitettu isoon, etelästä
tuovan tien varrella kasvavaan puuhun. Apina antoi gomanganin
edetä häiritsemättä, sillä hän näki, että mies oli yksin; mutta
samassa kun gomangani astui aukeamalle, kajahti hänen takanaan
äänekäs "Krig-ah!", jota heti seurasi kokonainen kuoro vastauksia eri
suunnilta, samalla kun kookkaat urokset kiitivät puita myöten,
noudattaen toverinsa kutsua.

Neekeri pysähtyi kuullessaan ensimmäisen huudon ja vilkaisi


ympärilleen. Hän ei nähnyt mitään, mutta tunsi puiden karvaisten
asukkaiden äänet, joita hän ja hänen kansansa pelkäsivät; heidän
pelkonsa syynä ei ollut ainoastaan noiden villien olentojen
voimakkuus ja hurjuus, vaan yhtä paljon myöskin taikauskoinen
kammo, jota apinoiden ihmisenkaltainen ulkomuoto heissä herätti.

Mutta Bulabantu ei ollut pelkuri. Hän kuuli apinoiden melua joka


taholla ympärillään; hän tiesi, että hänen oli todennäköisesti
mahdoton päästä pakoon, minkä vuoksi hän jäi paikalleen keihäs
valmiina kädessään ja sotahuuto huulillaan. Hän myisi henkensä
kalliista hinnasta, hän, Bulabantu, Mhongan, päällikön kylän
alapäällikkö.

Tarzan ja Tantor olivat vain vähän matkan päässä, kun vahdin


ensimmäinen huuto kiiri rauhallisessa viidakossa. Salamannopeasti
hyppäsi apinamies norsun selästä läheisten puuhun ja lähti nopeasti
rientämään aukeamaa kohti, ennenkuin ensimmäisen varoitusäänen
kaiku oli vaimentunut. Saapuessaan hän näki toistakymmentä urosta
yhden ainoan gomanganin ympärillä. Kamalasti kiljaisten syöksyi
Tarzan hyökkäykseen. Hän vihasi neekereitä vieläkin enemmän kuin
apinat, ja tässä oli tilaisuus tappaa gomangani avoimella kentällä.
Mitä oli gomangani tehnyt? Oliko hän surmannut jonkun heimon
jäsenen?

Tarzan tiedusti lähimmältä apinalta. Ei; gomangani ei ollut tehnyt


pahaa kellekään. Gozan, joka oli ollut vahdissa, oli nähnyt hänen
tulevan metsästä ja varoittanut heimoa — siinä kaikki. Apinamies
tunkeutui urosten piirien lävitse — heistä ei vielä yksikään ollut
yltynyt kyllin raivoiseksi karatakseen gomanganin kimppuun — ja
pääsi sellaiselle kohdalle, josta hän näki neekerin selvästi. Hän tunsi
miehen heti. Vasta viime yönä apinamies oli nähnyt hänen rohkeasti
katselevan pimeässä hehkuvia silmiä, samalla kun hänen toverinsa
kyyröttivät loassa hänen jalkojensa juurella liian peloissaan edes
puolustamaan itseään. Tässä oli urhea mies; ja Tarzan ihaili syvästi
uljuutta. Ei edes hänen mustaihoisia kohtaan tuntemansa viha ollut
niin voimakas tunne kuin hänen rakkautensa rohkeutta kohtaan. Hän
olisi nauttinut ottelusta mustan soturin kanssa melkein koska
tahansa; mutta tätä miestä hän ei halunnut tappaa; hänellä oli
epämääräinen tunne, että neekeri oli ansainnut henkensä
puolustamalla sitä niin uljaasti edellisenä yönä, eikä häntä
miellyttänyt se, että yksinäistä soturia vastassa oli niin musertava
ylivoima.

Hän kääntyi apinoiden puoleen. "Menkää takaisin


ruokailupuuhiinne", hän kehoitti, "ja antakaa gomanganin poistua
rauhassa. Hän ei ole vahingoittanut meitä, ja viime yönä näin hänen
yksin torjuvan tulella Numaa ja Saboria viidakossa. Hän on rohkea.
Miksi surmaisimme olentoa, joka on rohkea eikä ole ahdistanut
meitä? Antakaa hänen mennä."
Apinat murisivat. He olivat vihoissaan. "Surma gomanganille!"
huusi yksi heistä.

"Niin", karjui toinen, "surma gomanganille ja tarmanganille


myöskin!"

"Surma valkoiselle apinalle!" kiljui Gozan. "Hän ei ole mikään


apina, vaan gomangani, jolla ei ole ihoa."

"Surma Tarzanille!" mylvi Gunto. "Surma! Surma! Surma!"

Urokset alkoivat jo olla kyllin raivoissaan tappelua varten, mutta


pikemminkin Tarzania kuin mustaa miestä vastaan. Heidän välitseen
syöksyi karvainen hahmo, tyrkkien ne, joiden kanssa hän joutui
kosketukseen, syrjään, kuten voimakas mies hajoittaa lapsiparven.
Se oli Taug — kookas, raju Taug.

"Kuka sanoo: 'surma Tarzanille'?" hän kysyi. "Sen, joka tappaa


Tarzanin, on tapettava myöskin Taug. Kuka kykenee tappamaan
Taugin?
Taug repii sisälmyksenne näkyviin ja syöttää ne Dangolle."

"Me jaksamme tappaa teidät kaikki", vastasi Gunto. "Meitä on


paljon ja teitä vähän." Ja hän oli oikeassa. Tarzan älysi, että hän oli
oikeassa. Taug käsitti myös, mutta kumpikaan heistä ei myöntänyt
sitä mahdolliseksi. Se ei ollut urosapinain tapaista.

"Minä olen Tarzan", huusi apinamies. "Olen Tarzan, mahtava


metsästäjä, mahtava taistelija. Ei koko viidakossa ole Tarzanin
vertaista."

Vuorotellen sitten vastassa olevat urokset kehuivat kykyjään ja


kuntoaan. Ja yhä lähemmäksi tulivat vastustajat toisiaan. Siten
urokset kiihdyttivät itseään vimmaan, ennenkuin aloittivat taistelun.

Gunto tuli jalat jäykkinä aivan Tarzanin luokse ja haisteli häntä


hampaat irvessä. Tarzan päästi matalan, uhkaavan murahduksen. He
saattoivat toistaa samanlaiset temput kymmenkunta kertaa; mutta
ennemmin tai myöhemmin joutuisi kaksi urosta käsikähmään, ja
sitten alkaisi koko kamala lauma repiä ja raadella saalistaan.

Bulabantu, neekeri, oli seisonut silmät levällään hämmästyksestä


siitä alkaen, kun hän oli nähnyt Tarzanin lähestyvän apinoiden
välitse. Hän oli kuullut paljon puhuttavan tästä viidakkohaltiasta,
joka seurusteli karvaisen puukansan kanssa; mutta koskaan ennen
hän ei ollut nähnyt Tarzania täydessä päivänvalossa. Hän tunsi
apinamiehen hyvin niiden kuvauksista, jotka olivat nähneet hänet; ja
olihan hän itsekin useita kertoja vilahdukselta nähnyt tämän hirviön,
kun Tarzan oli öisin saapunut Mbongan kylään panemaan toimeen
jotakuta monista kaameista kujeistaan.

Bulabantu ei luonnollisesti ymmärtänyt vähääkään siitä, mitä


Tarzanin ja apinain välillä tapahtui; mutta hän oivalsi, että apinamies
ja yksi kookkaimpia uroksia oli väittelyssä toisten kanssa. Nämä kaksi
seisoivat selin häneen päin, hänen ja heimon muiden jäsenten
välissä, ja hän aavisti heidän kenties puolustavan häntä, vaikka se
näyttikin epätodennäköiseltä. Hän tiesi, että Tarzan oli kerran
säästänyt Mbongan, päällikön, hengen sekä auttanut Taiboa ja
tämän äitiä Momajaa. Ei niin ollen ollut mahdotonta, että hän
auttaisi Bulabantua; mutta miten hän sen voisi tehdä, sitä ei
Bulabantu käsittänyt; eikä sitä käsittänyt myöskään Tarzan, sillä
hänen vastassaan oli liian suuri ylivoima.

Gunto tovereineen pakotti Tarzanin ja Taugin hitaasti peräytymään


Bulabantuun päin. Apinamies ajatteli vähän aikaa sitten Tantorille
lausumiaan sanoja: "Niin, Tantor, on hupaisa elää. Minusta olisi
kuolema kammottava." Ja nyt hän tiesi, että häntä uhkasi pikainen
kuolema, sillä kookkaiden urosten kiukku häntä vastaan yltyi
nopeasti. Aina olivat heistä monet vihanneet häntä, ja kaikki he
olivat epäluuloisia häntä kohtaan. He ymmärsivät, että hän oli
erilainen kuin he. Myöskin Tarzan tiesi sen; mutta hän oli siitä
iloinen, — hän oli ihminen; sen hän oli oppinut kuvakirjoistaan, ja
hän oli siitä perin ylpeä. Mutta pian hän olisi kuollut ihminen.

Gunto valmistautui hyökkäämään. Tarzan tunsi enteet. Hän tiesi,


että kaikki muut kohta hyökkäisivät Gunton mukana. Sitten olisi
kaikki pian ohitse. Jotakin liikkui lehvien keskellä aukeaman
vastaisella laidalla. Tarzan huomasi sen, juuri kun Gunto syöksähti
eteenpäin, päästäen taistelunhaluisen apinan hirveän kiljaisun.
Tarzan kajahdutti omituisen kutsun ja kyyristyi torjumaan
päällekarkausta. Myöskin Taug kyyristyi, ja Bulabantu, joka nyt oli
varma siitä, että nämä kaksi ottelivat hänen puolellaan, laski
keihäänsä tanaan ja juoksi heidän väliinsä ottamaan vastaan
vihollisen ensimmäistä hyökkäystä.

Samalla murtautui hyökkäävien urosten takaa viidakosta


aukeamalle valtava otus. Kimeänä kaikui vimmastuneen urosnorsun
päristys kovemmin kuin ihmisapinain huudot, kun Tantor syöksyi
nopeasti aukeaman poikki ystävänsä avuksi.

Gunto ei käynyt käsikähmään apinamiehen kanssa, eikä ainoakaan


torahammas uponnut vastustajansa lihaan kummaltakaan puolen.
Tantorin kauhistuttava ääni pani urokset suinpäin kiitämään puihin,
hätäillen ja rähisten. Taug riensi pois heidän muassaan. Vain Tarzan
ja Bulabantu jäivät jäljelle. Viimeksimainittu pysyi paikallaan, koska
viidakkohaltia ei lähtenyt pakoon ja neekerillä oli rohkeutta uhitella
vaaraa, kauheaa kuolemaa sellaisen olennon rinnalla, joka ilmeisesti
oli antautunut kuoleman vaaraan hänen puolestaan.

Mutta gomangani ällistyi, kun valtavan kookas norsu äkkiä


pysähtyi apinamiehen eteen ja hyväili häntä pitkällä, notkealla
kärsällään.

Tarzan kääntyi mustaihoiseen päin. "Mene!" hän sanoi apinain


kielellä ja osoitti Mbongan kylän suuntaan. Bulabantu ymmärsi
viittauksen, joskaan ei sanoja, eikä vitkastellut totellessaan sitä.
Tarzan seisoi silmäillen häntä, kunnes hän oli kadonnut. Sitten hän
virkkoi norsulle: "Nosta minut selkääsi!" Ja vankkahampainen norsu
heilautti hänet keveästi päälaelleen.

"Tarzan menee laajan veden rannalla olevaan pesäänsä", huusi


apinamies puissa oleville apinoille. "Te olette kaikki typerämpiä kuin
Manu, paitsi Taugia ja Tikaa. Taug ja Tika saavat tulla katsomaan
Tarzania; mutta muiden on pysyttävä poissa. Tarzanilla ei ole enää
mitään tekemistä Kertshakin heimon kanssa."

Hän nykäisi Tantoria kovanahkaisella varpaallaan, ja iso eläin


juoksi pois aukeaman halki, apinain silmäillessä heitä, kunnes
viidakko oli heidät niellyt.

Ennen iltaa Taug surmasi Gunton, riitauduttuaan hänen kanssaan


Tarzanin hätyyttämisen johdosta.

Kuukauteen ei heimo nähnyt merkkiäkään Apinain Tarzanista.


Useille heistä hän ei luultavasti johtunut mieleenkään; mutta oli
niitäkin, jotka kaipasivat Tarzania enemmän kuin hän kuvittelikaan.
Taug ja Tika toivoivat usein hänen palaavan, ja Taug päätti
kymmenkunta kertaa käydä Tarzanin rannikkopesässä häntä
katsomassa; mutta sattui milloin minkinlaisia esteitä.

Kun Taug eräänä yönä virui nukkumatta pitkällään, katsellen


tähtitaivasta, tulivat hänen mieleensä ne omituiset seikat, joista
Tarzan oli kerran hänelle puhellut — että kirkkaat täplät muka olivat
ihmissyöjien silmiä, jotka väijyivät tummalla viidakkotaivaalla
käydäkseen Goron, kuun, kimppuun ja ahmiakseen hänet. Kuta
enemmän hän sitä ajatteli, sitä sekavammaksi hän kävi.

Ja sitten, tapahtui omituista. Goroa katsellessaan Taug näki osan


kuun reunasta katoavan, ikäänkuin sitä joku nakertaisi. Yhä
laajemmaksi kävi aukko Goron kyljessä. Kirkaisten hypähti Taug
pystyyn. Hänen vimmaisesta kajauttamansa "Krig-ah!" kiidätti
säikähtyneen heimon kirkuvana ja rähisevänä hänen luokseen.

"Katsokaa!" huusi Taug, osoittaen kuuta. "Katsokaa! Niin käy kuin


Tarzan sanoi. Numa on hypännyt puiden ylitse ja syö Goroa. Te
herjaatte Tarzania ja ajoitte hänet pois heimon keskuudesta; nyt
näette, kuinka viisas hän oli. Menköön nyt joku teistä, jotka vihasitte
Tarzania, auttamaan Goroa! Näettekö silmiä synkässä viidakossa joka
puolella Goron ympärillä. Hän on vaarassa, eikä kukaan kykene
häntä auttamaan — ei kukaan muu kuin Tarzan. Pian on Goro
Numan kidassa, eikä meillä sitten enää ole valoa, senjälkeen kun
Kudu on mennyt pesäänsä. Miten voimme tanssia dum-dumia ilman
Goron valoa?"

Apinat vapisivat ja uikuttivat. Kaikki luonnon voimien ilmiöt saivat


heidät aina kauhistumaan, sillä he eivät käsittäneet niitä.

"Menkää noutamaan Tarzania!" huudahti heistä eräs, ja sitten


yhtyivät kaikki huutoon: "Tarzan! Noutakaa Tarzan! Hän pelastaa
Goron." Mutta kuka suostuisi lähtemään pimeän viidakon läpi yöllä
häntä hakemaan?

"Minä menen", tarjoutui Taug, ja hetkistä myöhemmin, hän oli


kadonnut manalamaiseen pimeyteen pientä, maansaartamaa
lahdeketta kohti.

Ja odottaessaan heimo tarkkaili, kuinka Goroa hitaasti jyrsittiin.


Nyt oli Numa jo syönyt ison, puolipyöreän kappaleen. Joka
tapauksessa olisi Goro tyyten tuhoutunut, ennenkuin Kudu palaisi.
Apinat värisivät kuvitellessaan alituista pimeyttä öisin. He eivät
voineet nukkua. Rauhattomina he liikkuivat sinne tänne puiden
oksilla, silmäillen taivaallista Numaa, joka oli kauhealla ateriallaan, ja
kuunnellen, eivätkö Taug ja Tarzan saapuisi.

Goro oli melkein lopussa, kun apinat kuulivat heidän saapuvan


puita myöten, ja pian Tarzan Taugin seuraamana heilautti itsensä
läheiseen puuhun.

Apinamies ei tuhlannut aikaa turhiin puheisiin. Kädessään hänellä


oli pitkä jousensa ja selässään viini täynnä nuolia, myrkytettyjä
nuolia, jotka hän oli varastanut neekerien kylästä samoin kuin hän oli
varastanut jousenkin. Hän kiipesi isoon puuhun yhä korkeammalle,
kunnes hän oli hennolla oksalla, joka taipui hänen painostaan. Sieltä
hän saattoi nähdä taivaan selvästi ja esteettömästi. Hän näki Goron
ja sen tuhon, jonka nälkäinen Numa oli tehnyt kuun välkkyvälle
pinnalle.

Kohottaen kasvonsa kuuhun päin Tarzan kajautti kauhistuttavan


haastehuutonsa. Heikosti kuului kaukaa leijonan vastaus. Apinat
vavahtelivat. Taivaallinen Numa oli vastannut Tarzanille.
Sitten apinamies sovitti jouseensa nuolen, jännitti sen kauas
taaksepäin ja tähtäsi sen kärjen taivaalla Goroa ahmivan Numan
sydämeen. Kuului voimakas helähdys, kun irti päästetty vasama
sinkoutui tummalle taivaalle. Yhä uudelleen Tarzan ampui nuolillaan
Numaa, ja koko ajan kyyristelivät Kertshakin heimon apinat lähellä
toisiaan pelon vallassa.

Vihdoin pääsi Taugilta huudahdus. "Katsokaa! Katsokaa!" hän


kirkui. "Numa on saanut surmansa. Tarzan on tappanut Numan!
Katsokaa! Goro tulee jälleen esille Numan kidasta." Ja todellakin tuli
Goro vähitellen jälleen näkyviin, mikä hänet sitten lieneekään niellyt,
olipa se sitten Numa, leijona, tai maapallon varjo. Mutta jos te
yrittäisitte vakuuttaa jollekulle Kertshakin heimon apinalle, että joku
muu kuin Numa oli vähällä niellä Goron sinä yönä tai että joku muu
kuin Tarzan pelasti heidän salaperäisen juhlamenojensa jumalan
kamalasta kuolemasta, niin se tuottaisi teille vaikeuksia — ja ottelun.

Ja niin palasi Apinain Tarzan Kertshakin heimon keskuuteen, ja


palatessaan hän astui pitkän askeleen kuninkuutta kohti, jonka hän
lopulta saavutti, sillä nyt pitivät apinat häntä itseään korkeampana
olentona.

Koko heimossa oli vain yksi, joka lainkaan epäili sitä, että Tarzan
oli merkillisellä tavalla ilmeisesti pelastanut Goron; ja se ainoa oli,
niin kummalliselta kuin se tuntuneekin, Apinain Tarzan.
*** END OF THE PROJECT GUTENBERG EBOOK TARZANIN
VIIDAKKOSEIKKAILUJA: SEIKKAILUJA AFRIKAN AARNIOMETSISSÄ
***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
PLEASE READ THIS BEFORE YOU DISTRIBUTE OR USE THIS WORK

To protect the Project Gutenberg™ mission of promoting the free


distribution of electronic works, by using or distributing this work (or
any other work associated in any way with the phrase “Project
Gutenberg”), you agree to comply with all the terms of the Full
Project Gutenberg™ License available with this file or online at
www.gutenberg.org/license.

Section 1. General Terms of Use and


Redistributing Project Gutenberg™
electronic works
1.A. By reading or using any part of this Project Gutenberg™
electronic work, you indicate that you have read, understand, agree
to and accept all the terms of this license and intellectual property
(trademark/copyright) agreement. If you do not agree to abide by all
the terms of this agreement, you must cease using and return or
destroy all copies of Project Gutenberg™ electronic works in your
possession. If you paid a fee for obtaining a copy of or access to a
Project Gutenberg™ electronic work and you do not agree to be
bound by the terms of this agreement, you may obtain a refund
from the person or entity to whom you paid the fee as set forth in
paragraph 1.E.8.

1.B. “Project Gutenberg” is a registered trademark. It may only be


used on or associated in any way with an electronic work by people
who agree to be bound by the terms of this agreement. There are a
few things that you can do with most Project Gutenberg™ electronic
works even without complying with the full terms of this agreement.
See paragraph 1.C below. There are a lot of things you can do with
Project Gutenberg™ electronic works if you follow the terms of this
agreement and help preserve free future access to Project
Gutenberg™ electronic works. See paragraph 1.E below.
1.C. The Project Gutenberg Literary Archive Foundation (“the
Foundation” or PGLAF), owns a compilation copyright in the
collection of Project Gutenberg™ electronic works. Nearly all the
individual works in the collection are in the public domain in the
United States. If an individual work is unprotected by copyright law
in the United States and you are located in the United States, we do
not claim a right to prevent you from copying, distributing,
performing, displaying or creating derivative works based on the
work as long as all references to Project Gutenberg are removed. Of
course, we hope that you will support the Project Gutenberg™
mission of promoting free access to electronic works by freely
sharing Project Gutenberg™ works in compliance with the terms of
this agreement for keeping the Project Gutenberg™ name associated
with the work. You can easily comply with the terms of this
agreement by keeping this work in the same format with its attached
full Project Gutenberg™ License when you share it without charge
with others.

1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.

1.E. Unless you have removed all references to Project Gutenberg:

1.E.1. The following sentence, with active links to, or other


immediate access to, the full Project Gutenberg™ License must
appear prominently whenever any copy of a Project Gutenberg™
work (any work on which the phrase “Project Gutenberg” appears,
or with which the phrase “Project Gutenberg” is associated) is
accessed, displayed, performed, viewed, copied or distributed:
This eBook is for the use of anyone anywhere in the United
States and most other parts of the world at no cost and with
almost no restrictions whatsoever. You may copy it, give it away
or re-use it under the terms of the Project Gutenberg License
included with this eBook or online at www.gutenberg.org. If you
are not located in the United States, you will have to check the
laws of the country where you are located before using this
eBook.

1.E.2. If an individual Project Gutenberg™ electronic work is derived


from texts not protected by U.S. copyright law (does not contain a
notice indicating that it is posted with permission of the copyright
holder), the work can be copied and distributed to anyone in the
United States without paying any fees or charges. If you are
redistributing or providing access to a work with the phrase “Project
Gutenberg” associated with or appearing on the work, you must
comply either with the requirements of paragraphs 1.E.1 through
1.E.7 or obtain permission for the use of the work and the Project
Gutenberg™ trademark as set forth in paragraphs 1.E.8 or 1.E.9.

1.E.3. If an individual Project Gutenberg™ electronic work is posted


with the permission of the copyright holder, your use and distribution
must comply with both paragraphs 1.E.1 through 1.E.7 and any
additional terms imposed by the copyright holder. Additional terms
will be linked to the Project Gutenberg™ License for all works posted
with the permission of the copyright holder found at the beginning
of this work.

1.E.4. Do not unlink or detach or remove the full Project


Gutenberg™ License terms from this work, or any files containing a
part of this work or any other work associated with Project
Gutenberg™.

1.E.5. Do not copy, display, perform, distribute or redistribute this


electronic work, or any part of this electronic work, without
prominently displaying the sentence set forth in paragraph 1.E.1
with active links or immediate access to the full terms of the Project
Gutenberg™ License.

1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.

1.E.7. Do not charge a fee for access to, viewing, displaying,


performing, copying or distributing any Project Gutenberg™ works
unless you comply with paragraph 1.E.8 or 1.E.9.

1.E.8. You may charge a reasonable fee for copies of or providing


access to or distributing Project Gutenberg™ electronic works
provided that:

• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”

• You provide a full refund of any money paid by a user who


notifies you in writing (or by e-mail) within 30 days of receipt
that s/he does not agree to the terms of the full Project
Gutenberg™ License. You must require such a user to return or
destroy all copies of the works possessed in a physical medium
and discontinue all use of and all access to other copies of
Project Gutenberg™ works.

• You provide, in accordance with paragraph 1.F.3, a full refund of


any money paid for a work or a replacement copy, if a defect in
the electronic work is discovered and reported to you within 90
days of receipt of the work.

• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.

1.E.9. If you wish to charge a fee or distribute a Project Gutenberg™


electronic work or group of works on different terms than are set
forth in this agreement, you must obtain permission in writing from
the Project Gutenberg Literary Archive Foundation, the manager of
the Project Gutenberg™ trademark. Contact the Foundation as set
forth in Section 3 below.

1.F.

1.F.1. Project Gutenberg volunteers and employees expend


considerable effort to identify, do copyright research on, transcribe
and proofread works not protected by U.S. copyright law in creating
the Project Gutenberg™ collection. Despite these efforts, Project
Gutenberg™ electronic works, and the medium on which they may
be stored, may contain “Defects,” such as, but not limited to,
incomplete, inaccurate or corrupt data, transcription errors, a
copyright or other intellectual property infringement, a defective or
damaged disk or other medium, a computer virus, or computer
codes that damage or cannot be read by your equipment.

1.F.2. LIMITED WARRANTY, DISCLAIMER OF DAMAGES - Except for


the “Right of Replacement or Refund” described in paragraph 1.F.3,
the Project Gutenberg Literary Archive Foundation, the owner of the
Project Gutenberg™ trademark, and any other party distributing a
Project Gutenberg™ electronic work under this agreement, disclaim
all liability to you for damages, costs and expenses, including legal
fees. YOU AGREE THAT YOU HAVE NO REMEDIES FOR
NEGLIGENCE, STRICT LIABILITY, BREACH OF WARRANTY OR
BREACH OF CONTRACT EXCEPT THOSE PROVIDED IN PARAGRAPH
1.F.3. YOU AGREE THAT THE FOUNDATION, THE TRADEMARK
OWNER, AND ANY DISTRIBUTOR UNDER THIS AGREEMENT WILL
NOT BE LIABLE TO YOU FOR ACTUAL, DIRECT, INDIRECT,
CONSEQUENTIAL, PUNITIVE OR INCIDENTAL DAMAGES EVEN IF
YOU GIVE NOTICE OF THE POSSIBILITY OF SUCH DAMAGE.

1.F.3. LIMITED RIGHT OF REPLACEMENT OR REFUND - If you


discover a defect in this electronic work within 90 days of receiving
it, you can receive a refund of the money (if any) you paid for it by
sending a written explanation to the person you received the work
from. If you received the work on a physical medium, you must
return the medium with your written explanation. The person or
entity that provided you with the defective work may elect to provide
a replacement copy in lieu of a refund. If you received the work
electronically, the person or entity providing it to you may choose to
give you a second opportunity to receive the work electronically in
lieu of a refund. If the second copy is also defective, you may
demand a refund in writing without further opportunities to fix the
problem.

1.F.4. Except for the limited right of replacement or refund set forth
in paragraph 1.F.3, this work is provided to you ‘AS-IS’, WITH NO
OTHER WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR ANY PURPOSE.

1.F.5. Some states do not allow disclaimers of certain implied


warranties or the exclusion or limitation of certain types of damages.
If any disclaimer or limitation set forth in this agreement violates the
law of the state applicable to this agreement, the agreement shall be
interpreted to make the maximum disclaimer or limitation permitted
by the applicable state law. The invalidity or unenforceability of any
provision of this agreement shall not void the remaining provisions.

1.F.6. INDEMNITY - You agree to indemnify and hold the Foundation,


the trademark owner, any agent or employee of the Foundation,
anyone providing copies of Project Gutenberg™ electronic works in
accordance with this agreement, and any volunteers associated with
the production, promotion and distribution of Project Gutenberg™
electronic works, harmless from all liability, costs and expenses,
including legal fees, that arise directly or indirectly from any of the
following which you do or cause to occur: (a) distribution of this or
any Project Gutenberg™ work, (b) alteration, modification, or
additions or deletions to any Project Gutenberg™ work, and (c) any
Defect you cause.

Section 2. Information about the Mission


of Project Gutenberg™
Project Gutenberg™ is synonymous with the free distribution of
electronic works in formats readable by the widest variety of
computers including obsolete, old, middle-aged and new computers.
It exists because of the efforts of hundreds of volunteers and
donations from people in all walks of life.

Volunteers and financial support to provide volunteers with the


assistance they need are critical to reaching Project Gutenberg™’s
goals and ensuring that the Project Gutenberg™ collection will
remain freely available for generations to come. In 2001, the Project
Gutenberg Literary Archive Foundation was created to provide a
secure and permanent future for Project Gutenberg™ and future
generations. To learn more about the Project Gutenberg Literary
Archive Foundation and how your efforts and donations can help,
see Sections 3 and 4 and the Foundation information page at
www.gutenberg.org.

Section 3. Information about the Project


Gutenberg Literary Archive Foundation
The Project Gutenberg Literary Archive Foundation is a non-profit
501(c)(3) educational corporation organized under the laws of the
state of Mississippi and granted tax exempt status by the Internal
Revenue Service. The Foundation’s EIN or federal tax identification
number is 64-6221541. Contributions to the Project Gutenberg
Literary Archive Foundation are tax deductible to the full extent
permitted by U.S. federal laws and your state’s laws.

The Foundation’s business office is located at 809 North 1500 West,


Salt Lake City, UT 84116, (801) 596-1887. Email contact links and up
to date contact information can be found at the Foundation’s website
and official page at www.gutenberg.org/contact

Section 4. Information about Donations to


the Project Gutenberg Literary Archive
Foundation
Project Gutenberg™ depends upon and cannot survive without
widespread public support and donations to carry out its mission of
increasing the number of public domain and licensed works that can
be freely distributed in machine-readable form accessible by the
widest array of equipment including outdated equipment. Many
small donations ($1 to $5,000) are particularly important to
maintaining tax exempt status with the IRS.

The Foundation is committed to complying with the laws regulating


charities and charitable donations in all 50 states of the United
States. Compliance requirements are not uniform and it takes a
considerable effort, much paperwork and many fees to meet and
keep up with these requirements. We do not solicit donations in
locations where we have not received written confirmation of
compliance. To SEND DONATIONS or determine the status of
compliance for any particular state visit www.gutenberg.org/donate.

While we cannot and do not solicit contributions from states where


we have not met the solicitation requirements, we know of no
prohibition against accepting unsolicited donations from donors in
such states who approach us with offers to donate.

International donations are gratefully accepted, but we cannot make


any statements concerning tax treatment of donations received from
outside the United States. U.S. laws alone swamp our small staff.

Please check the Project Gutenberg web pages for current donation
methods and addresses. Donations are accepted in a number of
other ways including checks, online payments and credit card
donations. To donate, please visit: www.gutenberg.org/donate.

Section 5. General Information About


Project Gutenberg™ electronic works
Professor Michael S. Hart was the originator of the Project
Gutenberg™ concept of a library of electronic works that could be
freely shared with anyone. For forty years, he produced and
distributed Project Gutenberg™ eBooks with only a loose network of
volunteer support.
Project Gutenberg™ eBooks are often created from several printed
editions, all of which are confirmed as not protected by copyright in
the U.S. unless a copyright notice is included. Thus, we do not
necessarily keep eBooks in compliance with any particular paper
edition.

Most people start at our website which has the main PG search
facility: www.gutenberg.org.

This website includes information about Project Gutenberg™,


including how to make donations to the Project Gutenberg Literary
Archive Foundation, how to help produce our new eBooks, and how
to subscribe to our email newsletter to hear about new eBooks.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookultra.com

You might also like