0% found this document useful (0 votes)
22 views47 pages

Professional Linux Programming 1st Edition Jon Masters PDF Download

The document provides information about the book 'Professional Linux Programming' by Jon Masters and Richard Blum, including details on its digital download, ISBN, and publication year. It features additional recommended Linux programming resources and highlights the authors' backgrounds and contributions to the field. The book covers various aspects of Linux programming, including installation, development processes, and community engagement.

Uploaded by

govherarzum
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
0% found this document useful (0 votes)
22 views47 pages

Professional Linux Programming 1st Edition Jon Masters PDF Download

The document provides information about the book 'Professional Linux Programming' by Jon Masters and Richard Blum, including details on its digital download, ISBN, and publication year. It features additional recommended Linux programming resources and highlights the authors' backgrounds and contributions to the field. The book covers various aspects of Linux programming, including installation, development processes, and community engagement.

Uploaded by

govherarzum
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/ 47

Professional Linux Programming 1st Edition Jon

Masters pdf download

https://ebookfinal.com/download/professional-linux-
programming-1st-edition-jon-masters/

Explore and download more ebooks or textbooks


at ebookfinal.com
Here are some recommended products for you. Click the link to
download, or explore more at ebookfinal

Linux System Programming 1st Edition Robert Love

https://ebookfinal.com/download/linux-system-programming-1st-edition-
robert-love/

Beginning Linux programming 4th Edition Neil Matthew

https://ebookfinal.com/download/beginning-linux-programming-4th-
edition-neil-matthew/

Beginning Linux programming 3rd Edition Neil Matthew

https://ebookfinal.com/download/beginning-linux-programming-3rd-
edition-neil-matthew/

Linux Programming by Example The Fundamentals 1st Edition


Robbins

https://ebookfinal.com/download/linux-programming-by-example-the-
fundamentals-1st-edition-robbins/
Professional Oracle Programming 1st Edition Rick Greenwald

https://ebookfinal.com/download/professional-oracle-programming-1st-
edition-rick-greenwald/

Red Hat Fedora Linux 3 For Dummies 1st Edition Jon


'Maddog' Hall

https://ebookfinal.com/download/red-hat-fedora-linux-3-for-
dummies-1st-edition-jon-maddog-hall/

C Programming in Linux 2nd Edition David Haskins

https://ebookfinal.com/download/c-programming-in-linux-2nd-edition-
david-haskins/

Professional DotNetNuke Module Programming Mitchel Sellers

https://ebookfinal.com/download/professional-dotnetnuke-module-
programming-mitchel-sellers/

Professional Android Sensor Programming 1st Edition Greg


Milette

https://ebookfinal.com/download/professional-android-sensor-
programming-1st-edition-greg-milette/
Professional Linux Programming 1st Edition Jon Masters
Digital Instant Download
Author(s): Jon Masters, Richard Blum
ISBN(s): 9780471776130, 0471776130
Edition: 1
File Details: PDF, 13.43 MB
Year: 2007
Language: english
01_776130 ffirs.qxp 2/2/07 10:13 PM Page iii

Professional
Linux® Programming

Jon Masters
Richard Blum
01_776130 ffirs.qxp 2/2/07 10:13 PM Page ii
01_776130 ffirs.qxp 2/2/07 10:13 PM Page i

Professional
Linux® Programming
01_776130 ffirs.qxp 2/2/07 10:13 PM Page ii
01_776130 ffirs.qxp 2/2/07 10:13 PM Page iii

Professional
Linux® Programming

Jon Masters
Richard Blum
01_776130 ffirs.qxp 2/2/07 10:13 PM Page iv

Professional Linux® Programming


Published by
Wiley Publishing, Inc.
10475 Crosspoint Boulevard
Indianapolis, IN 46256
www.wiley.com
Copyright © 2007 by Wiley Publishing, Inc., Indianapolis, Indiana
Published simultaneously in Canada
Manufactured in the United States of America
10 9 8 7 6 5 4 3 2 1
Library of Congress Cataloging-in-Publication Data:
Masters, Jon, 1981-
Professional Linux programming / Jon Masters, Richard Blum.
p. cm.
Includes index.
ISBN: 978-0-471-77613-0 (paper/website)
1. Linux. 2. Operating systems (Computers) I. Blum, Richard, 1962- II. Title.
QA76.76.O63M37153 2007
005.4’32—dc22
2006102202
No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any
means, electronic, mechanical, photocopying, recording, scanning or otherwise, except as permitted under Sections
107 or 108 of the 1976 United States Copyright Act, without either the prior written permission of the Publisher, or
authorization through payment of the appropriate per-copy fee to the Copyright Clearance Center, 222 Rosewood
Drive, Danvers, MA 01923, (978) 750-8400, fax (978) 646-8600. Requests to the Publisher for permission should be
addressed to the Legal Department, Wiley Publishing, Inc., 10475 Crosspoint Blvd., Indianapolis, IN 46256, (317)
572-3447, fax (317) 572-4355, or online at http://www.wiley.com/go/permissions.

LIMIT OF LIABILITY/DISCLAIMER OF WARRANTY: THE PUBLISHER AND THE AUTHOR MAKE NO REP-
RESENTATIONS OR WARRANTIES WITH RESPECT TO THE ACCURACY OR COMPLETENESS OF THE CON-
TENTS OF THIS WORK AND SPECIFICALLY DISCLAIM ALL WARRANTIES, INCLUDING WITHOUT
LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE. NO WARRANTY MAY BE CREATED
OR EXTENDED BY SALES OR PROMOTIONAL MATERIALS. THE ADVICE AND STRATEGIES CONTAINED
HEREIN MAY NOT BE SUITABLE FOR EVERY SITUATION. THIS WORK IS SOLD WITH THE UNDERSTAND-
ING THAT THE PUBLISHER IS NOT ENGAGED IN RENDERING LEGAL, ACCOUNTING, OR OTHER PRO-
FESSIONAL SERVICES. IF PROFESSIONAL ASSISTANCE IS REQUIRED, THE SERVICES OF A COMPETENT
PROFESSIONAL PERSON SHOULD BE SOUGHT. NEITHER THE PUBLISHER NOR THE AUTHOR SHALL BE
LIABLE FOR DAMAGES ARISING HEREFROM. THE FACT THAT AN ORGANIZATION OR WEBSITE IS
REFERRED TO IN THIS WORK AS A CITATION AND/OR A POTENTIAL SOURCE OF FURTHER INFORMA-
TION DOES NOT MEAN THAT THE AUTHOR OR THE PUBLISHER ENDORSES THE INFORMATION THE
ORGANIZATION OR WEBSITE MAY PROVIDE OR RECOMMENDATIONS IT MAY MAKE. FURTHER, READ-
ERS SHOULD BE AWARE THAT INTERNET WEBSITES LISTED IN THIS WORK MAY HAVE CHANGED OR
DISAPPEARED BETWEEN WHEN THIS WORK WAS WRITTEN AND WHEN IT IS READ.
For general information on our other products and services please contact our Customer Care Department within
the United States at (800) 762-2974, outside the United States at (317) 572-3993 or fax (317) 572-4002.
Trademarks: Wiley, the Wiley logo, Wrox, the Wrox logo, Programmer to Programmer, and related trade dress are
trademarks or registered trademarks of John Wiley & Sons, Inc. and/or its affiliates, in the United States and other
countries, and may not be used without written permission. Linux is a registered trademark of Linus Torvalds. All
other trademarks are the property of their respective owners. Wiley Publishing, Inc., is not associated with any
product or vendor mentioned in this book.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in print may not be
available in electronic books.
01_776130 ffirs.qxp 2/2/07 10:13 PM Page v

For Karin, whom I love very much.—Jon Masters

To my wife Barbara.—Richard Blum


01_776130 ffirs.qxp 2/2/07 10:13 PM Page vi

About the Authors


Jon Masters is a 25-year-old British-born Linux kernel engineer, embedded systems specialist, and
author who lives and works in the United States for Red Hat. Jon made UK history by becoming one of
the youngest University students the country had ever seen, at the tender age of just 13. Having been
through college twice by the time his peers were completing their first time around, and having been
published over 100 times in a wide range of technical magazines, journals and books, Jon went on to
work for a variety of multinational technology companies. He has worked extensively in the field of
Embedded Systems, Enterprise Linux and Scientific instrumentation and has helped design anything
and everything from Set Top Boxes to future NMR (MRI) imaging platforms.

When not working on Enterprise Linux software for Red Hat, Jon likes to drink tea on Boston Common
and read the collective works of Thomas Paine and other great American Revolutionaries of a bygone
age. He dreams of a time when the world was driven not by electrons, but by wooden sailing ships and
a universal struggle for the birth of modern nations. He plays the violin, and occasionally sings in choral
ensembles, for which he has won several awards. For relaxation, Jon enjoys engaging in a little rock
climbing. He lives in Cambridge, Massachusetts, just across the river Charles from historic Boston, and
enjoys every minute of it.

Jon has extensive experience in speaking about and training people to use a wide variety of Linux
technologies and enjoys actively participating in many Linux User Groups the world over.

Richard Blum has worked for over 18 years for a large U.S. government organization as a network and
systems administrator. During this time he has had plenty of opportunities to work with Microsoft,
Novell, and of course, UNIX and Linux servers. He has written applications and utilities using C, C++,
Java, C#, Visual Basic, and shell script.

Rich has a Bachelors of Science degree in Electrical Engineering, and a Masters of Science degree in
Management, specializing in Management Information Systems, from Purdue University. He is the author
of several books, including “sendmail for Linux” (2000, Sams publishing), “Running qmail” (2000, Sams
publishing), “Postfix” (2001, Sams Publishing), “Open Source E-mail Security” (2001, Sams Publishing),
“C# Network Programming” (2002, Sybex), “Network Performance Open Source Toolkit” (2003, John Wiley &
Sons), and “Professional Assembly Language Programming” (2005, Wrox).

When he is not being a computer nerd, Rich plays electric bass for the church worship and praise band,
and enjoys spending time with his wife Barbara, and daughters Katie Jane and Jessica.
01_776130 ffirs.qxp 2/2/07 10:13 PM Page vii

Credits
Contributing Writers Graphics and Production Specialists
Christopher Aillon Carrie A. Foster
Katherine and David Goodwin Jennifer Mayberry
Matthew Walton Barbara Moore
Alicia B. South
Acquisitions Editor
Kit Kemper Quality Control Technicians
Cynthia Fields
Development Editor John Greenough
Howard A. Jones
Project Coordinator
Production Editor Adrienne Martinez
Eric Charbonneau
Proofreading and Indexing
Copy Editor Techbooks
Foxxe Editorial
Anniversary Logo Design
Editorial Manager Richard Pacifico
Mary Beth Wakefield

Production Manager
Tim Tate

Vice President and Executive Group Publisher


Richard Swadley

Vice President and Executive Publisher


Joseph B. Wikert
01_776130 ffirs.qxp 2/2/07 10:13 PM Page viii
01_776130 ffirs.qxp 2/2/07 10:13 PM Page ix

Acknowledgments

I sit here writing these acknowledgements on my 25th birthday, having spent many long evenings over
the last year pouring over schedules, planning and even occasionally actually getting some writing
done. When I first undertook to write this book, I could never have fully appreciated the amount of
work it takes to put such a thing together nor the difficulties that would need to be overcome along the
way. I started writing this book living just outside London and finished it less than a year later from my
new home in Cambridge, Massachusetts, having decided to leave the country in the interim. Over the
last year, a lot has changed for me both personally and professionally, but I am supported by a great net-
work of friends and family who have helped make it possible.

First and foremost I would like to thank the team I have worked with at Wiley — Debra, Adaobi, Kit,
Howard and Carol as well as numerous others whose job it is to turn this manuscript into a finished
book. Kit Kemper deserves special thanks for enduring my writing schedule and somehow making that
just about work out in the end, as does Debra Williams-Cauley for believing that this project was a good
idea in the first place. Howard Jones helped to keep me honest by doing an excellent job as my editor.
This book would not exist without the inspiration I received from my good friends (and former bosses)
Malcolm Buckingham and Jamie McKendry at Resonance Instruments (later Oxford Instruments), who
used to moan about the lack of Linux-specific programming books. This book would also not exist with-
out the kind contributions from several good friends of mine — Kat and David Goodwin, Matthew Walton,
and Chris Aillon, thank you. Thanks also to Richard Blum for stepping up and joining the team once it
became apparent to me that I couldn’t hope to finish this in time. You’ve all done a great job and I really
do thank you very much.

I have been helped along the way by my fantastic family — my parents Paula and Charles, my sisters
Hannah Wrigley and Holly, my brother-in-law Joe, and occasional inspiration too from my grandmothers.
I have also benefited from some of the best friends anyone could ask for — there are too many to list every-
one individually, but I would like to specifically mention Hussein Jodiyawalla, Johannes Kling, Ben Swan,
Paul Sladen, Markus Kobler, Tom Hawley, Sidarshan Guru Ratnavellu, Chris and Mad Ball (and Zoe, the
cat), Emma Maule, John and Jan Buckman, Toby Jaffey and Sara, Sven Thorsten-Dietrich, Bill Weinberg,
Daniel James, Joe Casad and Andrew Hutton and Emilie. Special thanks also to all of my friends at Red
Hat, my boss and all the other hard-working people who help to make our company truly the greatest
place to work anywhere in the world. Red Hat really understands what it means to work on Linux, and
I am extremely grateful for having such a cool work environment, which really does encourage involve-
ment in projects such as this one, in the true spirit of the Linux community — thanks, guys, you rock.

Finally, I would like to thank Karin Worley for her friendship, which provided me with ample opportu-
nity for procrastination during the final stages of this project. Karin, I’m not sure I would have completed
it without the new-found sense of happiness that recently entered into my life.

Jon Masters
Cambridge, Massachusetts
01_776130 ffirs.qxp 2/2/07 10:13 PM Page x

Acknowledgments
Many thanks go to the great team of people at Wiley for their outstanding work on this project. Thanks
to Kit Kemper, the Acquisitions Editor, for offering me the opportunity to work on this book. Also
thanks to Howard Jones, the Developmental Editor, for keeping things on track and helping make this
book presentable. I would also like to thank Carole McClendon at Waterside Productions, Inc. for
arranging this opportunity for me, and for helping out in my writing career.

Finally, I would like to thank my parents, Mike and Joyce Blum, for their dedication and support while
raising me, and to my wife Barbara and daughters Katie Jane and Jessica for their love, patience, and
understanding, especially while I’m writing.

Richard Blum

x
02_776130 ftoc.qxp 2/2/07 10:13 PM Page xi

Contents

Acknowledgments ix
Introduction xix

Chapter 1: Working with Linux 1


A Brief History of Linux 2
The GNU Project 2
The Linux Kernel 3
Linux Distributions 4
Free Software vs. Open Source 4
Beginning Development 5
Choosing a Linux Distribution 6
Installing a Linux Distribution 8
Linux Community 15
Linux User Groups 15
Mailing lists 16
IRC 16
Private Communities 16
Key Differences 16
Linux Is Modular 17
Linux Is Portable 17
Linux Is Generic 17
Summary 18

Chapter 2: Toolchains 19
The Linux Development Process 19
Working with Sources 20
Configuring to the Local Environment 21
Building the Sources 22
Components of the GNU Toolchain 23
The GNU Compiler Collection 23
The GNU binutils 34
GNU Make 39
The GNU Debugger 40
02_776130 ftoc.qxp 2/2/07 10:13 PM Page xii

Contents
The Linux Kernel and the GNU Toolchain 44
Inline Assembly 44
Attribute Tags 45
Custom Linker Scripts 45
Cross-Compilation 46
Building the GNU Toolchain 47
Summary 48

Chapter 3: Portability 49
The Need for Portability 50
The Portability of Linux 51
Layers of Abstraction 51
Linux Distributions 52
Building Packages 57
Portable Source Code 70
Internationalization 81
Hardware Portability 88
64-Bit Cleanliness 89
Endian Neutrality 89
Summary 92

Chapter 4: Software Configuration Management 93


The Need for SCM 94
Centralized vs. Decentralized Development 95
Centralized Tools 95
The Concurrent Version System 96
Subversion 104
Decentralized tools 108
Bazaar-NG 109
Linux kernel SCM (git) 112
Integrated SCM Tools 115
Eclipse 115
Summary 117

Chapter 5: Network Programming 119


Linux Socket Programming 119
Sockets 120
Network Addresses 122
Using Connection-Oriented Sockets 123
Using Connectionless Sockets 130

xii
02_776130 ftoc.qxp 2/2/07 10:13 PM Page xiii

Contents
Moving Data 133
Datagrams vs. Streams 133
Marking Message Boundaries 137
Using Network Programming Libraries 140
The libCurl Library 140
Using the libCurl Library 141
Summary 147

Chapter 6: Databases 149


Persistent Data Storage 149
Using a Standard File 150
Using a Database 150
The Berkeley DB Package 152
Downloading and Installing 153
Building Programs 154
Basic Data Handling 154
The PostgreSQL Database Server 165
Downloading and Installing 165
Building Programs 167
Creating an Application Database 167
Connecting to the Server 169
Executing SQL Commands 173
Using Parameters 181
Summary 184

Chapter 7: Kernel Development 185


Starting Out 185
Kernel Concepts 199
A Word of Warning 200
The Task Abstraction 200
Virtual Memory 205
Don’t Panic! 208
Kernel Hacking 208
Loadable Modules 209
Kernel Development Process 211
Git: the “Stupid Content Tracker” 212
The Linux Kernel Mailing List 213
The “mm” Development Tree 215
The Stable Kernel Team 215
LWN: Linux Weekly News 216
Summary 216

xiii
02_776130 ftoc.qxp 2/2/07 10:13 PM Page xiv

Contents
Chapter 8: Kernel Interfaces 217
What Is an Interface? 217
Undefined Interfaces 218
External Kernel Interfaces 219
System Calls 219
The Device File Abstraction 224
Kernel Events 238
Ignoring Kernel Protections 239
Internal Kernel Interfaces 243
The Kernel API 243
The kernel ABI 244
Summary 245

Chapter 9: Linux Kernel Modules 247


How Modules Work 247
Extending the Kernel Namespace 250
No Guaranteed Module Compatibility 251
Finding Good Documentation 251
Linux Kernel Man Pages 251
Writing Linux Kernel Modules 252
Before You Begin 253
Essential Module Requirements 253
Logging 256
Exported Symbols 257
Allocating Memory 259
Locking considerations 267
Deferring work 275
Further Reading 283
Distributing Linux Kernel Modules 284
Going Upstream 284
Shipping Sources 284
Shipping Prebuilt Modules 284
Summary 285

Chapter 10: Debugging 287


Debugging Overview 287
A Word about Memory Management 288
Essential Debugging Tools 289
The GNU Debugger 289
Valgrind 298

xiv
02_776130 ftoc.qxp 2/2/07 10:13 PM Page xv

Contents
Graphical Debugging Tools 299
DDD 299
Eclipse 302
Kernel Debugging 305
Don’t Panic! 306
Making Sense of an oops 307
Using UML for Debugging 309
An Anecdotal Word 312
A Note about In-Kernel Debuggers 313
Summary 313

Chapter 11: The GNOME Developer Platform 315


GNOME Libraries 316
Glib 316
GObject 316
Cairo 316
GDK 317
Pango 317
GTK+ 317
libglade 318
GConf 318
GStreamer 318
Building a Music Player 319
Requirements 319
Getting Started: The Main Window 319
Building the GUI 321
Summary 340

Chapter 12: The FreeDesktop Project 341


D-BUS: The Desktop Bus 341
What Is D-Bus? 342
Under D-Hood of D-Bus 342
D-Bus Methods 346
Hardware Abstraction Layer 350
Making Hardware Just Work 350
Hal Device Objects 353
The Network Manager 358
Other Freedesktop Projects 360
Summary 360

xv
02_776130 ftoc.qxp 2/2/07 10:13 PM Page xvi

Contents
Chapter 13: Graphics and Audio 361
Linux and Graphics 361
X Windows 362
Open Graphics Library 364
OpenGL Utilities Toolkit 365
Simple Directmedia Layer 365
Writing OpenGL Applications 365
Downloading and Installing 366
Programming Environment 367
Using the GLUT Library 368
Writing SDL Applications 382
Downloading and Installing 382
Programming Environment 383
Using the SDL Library 383
Summary 394

Chapter 14: LAMP 395


What Is LAMP? 395
Apache 396
MySQL 396
PHP 397
The Rebel Platform 397
Evaluating the LAMP Platform 397
Apache 399
Virtual Hosting 400
Installation and Configuration of PHP 5 401
Apache Basic Authentication 402
Apache and SSL 402
Integrating SSL with HTTP Authentication 403
MySQL 404
Installing MySQL 404
Configuring and Starting the Database 404
Changing the Default Password 405
The MySQL Client Interface 405
Relational Databases 405
SQL 406
The Relational Model 409
PHP 411
The PHP Language 411
Error Handling 420
Error-Handling Exceptions 421

xvi
02_776130 ftoc.qxp 2/2/07 10:13 PM Page xvii

Contents
Optimization Techniques 422
Installing Additional PHP Software 427
Logging 427
Parameter Handling 428
Session Handling 429
Unit Testing 430
Databases and PHP 432
PHP Frameworks 432
The DVD Library 433
Version 1: The Developer’s Nightmare 433
Version 2: Basic Application with DB-Specific Data Layer 434
Version 3: Rewriting the Data Layer, Adding Logging and Exceptions 437
Version 4: Applying a Templating Framework 441
Summary 442

Index 443
GNU 473

xvii
Discovering Diverse Content Through
Random Scribd Documents
THE COURIER.

The Courier, in the time of the war, was the great


paper; it obtained a large circulation, and
consequently exercised considerable influence. It was
started by John Parry in 1792, and he carried it on for
some years with tolerable success, till he was ruined
in 1799 by a government prosecution for a libel on
the Emperor of Russia. It was bought by Daniel
Stuart, who left The Morning Post for The Courier in
1803. During three years, says he, at the time of the
overthrow of Buonaparte, The Courier, by the able
management of Peter Street, who was editor and
half-proprietor, sold steadily upwards of 8000 per
day; during one fortnight it sold upwards of 10,000
daily. At the end of 1809, S. T. Coleridge contributed
to it some Essays on the Spaniards; and in 1811 he
wrote for it on a salary. At this time the paper was
much under ministerial direction. From about the
year 1818 till 1829 The Courier was conducted by W.
Mudford, with whom William Stewart was a proprietor.
After 1819 D. Stuart took no interest in it, and parted
with his last share in it in 1822. After the year 1825,
James Stuart, a Scotch gentleman of great talent and
respectability—the same that unfortunately killed Sir
Alexander Boswell in a duel, and was author of Travels
in the United States—became editor. True to his
principles, he gave in this capacity every support in
his power to the Whig or Liberal party. He was
appointed by Lord Melbourne to the situation of
Factory Inspector, which he held till his death, at the
age of 74, in 1849. When Jas. Stuart obtained his
factory appointment, Sam. Laman Blanchard became
editor. The paper having become, like other evening
papers, less profitable than of old, the proprietors
sold it to the party they had so long opposed. It took
Tory politics; Laman Blanchard, of course, resigned;
and a few short years were sufficient to destroy a
journal which had once been the most valuable
newspaper property in England. Its last number
appeared 6th July, 1842.
It is a curious, but not creditable, circumstance
that The Courier was in the habit of re-printing, from
year to year, without acknowledgment, the able
leading articles from The Liverpool Courier, written
by the Rev. Richard Watson, secretary to the
Wesleyan Missionary Society, by whom, in
conjunction with his friend, Mr. Kaye, this newspaper
was established upon loyal and constitutional
principles.
“The Courier, in 1814, was supplied by R. Peel,
Lord Palmerston, and J. W. Croker, with political
squibs and lyrics, resembling in general features The
Anti-Jacobin and The Rolliad. The verses are chiefly
parodies of Moore’s Irish Melodies, or of Byron’s
songs, and are far above the ordinary level of such
compositions.... The various pieces were collected
and published in 1815, under the title of The New
Whig Guide.”—Croker Papers, vol. i., p. 58.
This statement contains several inaccuracies. The
pieces forming The New Whig Guide were first
collected and published in 1819, and not in 1815, for
Byron’s Fare thee well was not written till April, 1816.
The parody on it was entitled The Leader’s Lament.
By the Right Hon. George Ponsonby. A. Hayward
says in his review of The Poetry of the Anti-Jacobin,
in The Edinburgh Review, 1858—that “Canning has
been traditionally credited with the parody of
Moore’s. Believe me, if all those endearing young
charms, the gentleman addressed being a
distinguished commoner afterwards ennobled (the
first Lord Methuen), who was far from meriting the
character [of a foolish fop] thereby fastened on him”.
The other parodies were by John Calcraft, the Hon.
W. H. Lyttelton, Dudley North, M.P., Kirkman Finlay,
M.P. for Glasgow, &c. Mr. Methuen, in return, wrote
many clever squibs and parodies against the Tories,
which were collected, under the title of The New
Tory Guide, and reproduced, like its rivals in 1819.
“Talking of The Morning Chronicle,” says T. Moore
(Diary, 19th March, 1831), “Paul Methuen told us he
was the author of almost all those about The Rat
Club; which are certainly some of the best.”
THE STAR.

The Star, the first London daily Evening


Newspaper, was started in 1788 by Peter Stuart,
brother to Daniel Stuart, of The Morning Post. Its first
editor was Andrew Macdonald, author of Vimonda, a
tragedy, and other works: and after him another
Scottish poet, John Mayne, author of The Siller Gun,
was editor. Robert Burns was offered an engagement
to write poetry for it, at the rate of one guinea an
article per week. The arrangement was not
completed. It was to Peter Stuart that Burns
addressed his “Poem, written to a gentleman who
had sent him a Newspaper, and offered to continue it
free of expense”. The facetious Bob Allen, of whom
Charles Lamb has such pleasant reminiscences, was
for many years a contributor to this paper.
Subsequently, Dr. A. Tilloch, editor of The
Philosophical Magazine, was for many years editor of
The Star. After Oct. 15, 1831, The Star became
incorporated with The Albion newspaper, under the
title of The Albion and Evening Star.
The Star was during many years the leading
newspaper on the Whig side, Campbell the poet being
one of its writers after 1804, when he was engaged
at a salary of four guineas a week. The clear profits
of this paper in 1820 were said, on apparently good
authority, to amount to £6000.
THE MORNING CHRONICLE.

The Morning Chronicle was, with one exception (The


Public Ledger, which started in 1760), the oldest of
the daily papers up to the period of its
discontinuance March 19, 1862. The latest number in
the British Museum is dated Dec. 31, 1861.
It was established on Whig principles, 28th June,
1769, by William Woodfall, who carried it on with
great success till 1789.
Woodfall, in addition to other talents requisite to
the success of a newspaper, possessed two, which
were of essential service to it, namely, his prodigious
memory, which enabled him to report Parliamentary
Debates without the aid of notes, and the excellence
of his Theatrical Criticisms, which, as Mr. Fox Bourne,
in his copious and valuable work on English
Newspapers, 2 vols., 8vo., 1887—one to which the
editor of the present publication has been under
frequent obligations—says, “are a neglected mine of
wealth for students of Theatrical History”.
On Woodfall’s death, in 1803, it was sold to James
Perry, who borrowed £500 from Ransome & Co., the
bankers, and some more from Bellamy, the wine
merchant—who was also caterer and doorkeeper to
the House of Commons—and entered into
partnership with a Charterhouse schoolmaster
named Gray, who had just received a legacy of £500.
With that joint capital, the two bought The Chronicle,
the Duke of Norfolk making Perry a present of a
house in the Strand, which he converted into a new
publishing office. A few other influential Whigs, also,
contributed a further sum, which, as the late Sir
Robert Adair, who is so often satirized in The Anti-
Jacobin, and who was a subscriber to the fund,
informed the editor of the present work, was £300.
Perry was on good terms with his contributors, and
made The Morning Chronicle a more prosperous and
influential journal than had ever before been known
in England. Gray provided the heavy articles, Perry
those of lighter sort; and after Gray’s death, which
happened when he had been part proprietor for only
a few years, other writers were employed, among
them Jas. Mackintosh and Sheridan, and in later times
T. Campbell and T. Moore, who contributed verse, and
John Campbell, then a young barrister, who was the
Theatrical Critic, and was still so in 1810. T. Campbell,
on coming to London in 1802, was engaged as a
political writer, but this not being his forte, he, with
great judgment, confined himself to poetical pieces,
among which were Ye Mariners of England, and The
Exile of Erin. Perry had another and equally famous
contributor. In Sept., 1793, S. T. Coleridge, then aged
nineteen, “sent a poem of a few lines to Perry,
soliciting a loan of a guinea for a distressed author,”
which prayer was immediately granted. In 1796, he
accepted an offer of Perry’s to write in it, but the
arrangement was never carried out. In later years,
Coleridge wrote some other poems for The Morning
Chronicle, and his friend Charles Lamb was an
occasional writer of prose for it.
Perry continued as the general manager of the
paper till his death on 6th Dec., 1821; but before this
he had left much of the editing to others, his first
assistant after Gray’s death being Robert Spankie,
ultimately attorney-general of Bengal. The next was
John Black, who had joined him in 1810; and upon
him, when Perry died, the entire management
devolved.
After Perry’s death the paper was purchased for
£42,000, by William Clement, by whom it was held till
1834, when it was sold to Sir John Easthope for
£16,500.
In 1843, John Black was dismissed to make way for
Andrew Doyle, who had been Foreign Editor, and had
married Sir John’s daughter. Black died in 1855.
On 26th July, 1847, Sir John Easthope, who had
been carrying on the paper at a loss for some time,
sold it to the Duke of Newcastle, W. E. Gladstone,
Sidney Herbert, and other influential Peelites. Its new
Editor was John Douglas Cook, who had for some time
been one of the reporters of The Times, and who
gathered round him a brilliant staff of contributors,
including George Sydney Smythe, afterwards Lord
Strangford, Gilbert Venables, Abraham Hayward,
William Vernon Harcourt, and Thackeray. Its business
manager was William Delane, the father of the clever
young editor of The Times, John Thaddeus Delane.
The Chronicle lingered on as a would-be Peelite
organ till the autumn of 1854, when by a curious
arrangement, the paper, with all its plant, was sold to
Serjeant Glover, for £7500, on the understanding
that, if he continued to support in it the Peelite
policy, he should have the money back with interest,
being paid £3000 a year for three years. That
contract soon fell through, as Glover preferred to
draw a subsidy from Louis Napoleon, and to make
other experiments. At the close of 1854, the
circulation of The Morning Chronicle averaged only
about 2500, while that of The Morning Post was
about 3000, that of The Morning Herald about 3500,
that of The Daily News about 5300, that of The
Morning Advertiser about 6600, and that of The
Times about 55,000.
The last number of The Morning Chronicle
appeared March 19, 1862, when what at one time
had been the most influential journal in the country
altogether ceased to exist.
Of this paper Sheridan speaks in The Critic, and to
it Byron addressed a Familiar Epistle. For its columns
W. Hazlitt wrote some of the finest criticisms in our
own or any other language. Some of the early
Sketches by Boz appeared in it, but they were really
commenced in the old Monthly Magazine. Dickens’s
father was one of the staff. Hazlitt also contributed
to it Parliamentary Reports, as at a later period did C.
Dickens.
Among other distinguished writers in The Morning
Chronicle were Lord Brougham, the Duke of Sussex,
David Ricardo, Cyrus Redding, Albany Fonblanque,
James and John Stuart Mill, John Payne Collier, Eyre
Evans Crowe, Charles Buller, Lord Holland, Joseph
Parkes, Michael Joseph Quin, George Hogarth, James
Fraser, W. Hazlitt, secundus, Lord Melbourne, W.
Johnson Fox, Henry Mayhew, Lord Palmerston, A. B.
Reach, Alex. and Charles Mackay, Tom Taylor.
THE MORNING POST.

The Morning Post, the next daily paper in order of


date to The Chronicle, first appeared in 1772, and
was probably projected by John Bell. Three years
subsequently the Rev. Henry Bate (who took in 1784
the name of Dudley, and was created a baronet in
1816) joined it, and was connected with it till the end
of 1780, when he quarrelled with his colleagues, and
set up The Morning Herald, the first number of which
appeared on Nov. 1 in the same year. In June, 1781,
he was sentenced to a year’s imprisonment for an
atrocious libel on the Duke of Richmond. He was
(says Horace Walpole, in his Journal of the Reign of
George III.), the worst of all the scandalous libellers
that had appeared, both on private persons as well
as public. His life was dissolute, and he had fought
more than one duel. Yet Lord Sandwich had procured
for him a good Crown living, and he was believed to
be pensioned by the Court. He died in 1824.
After Bate, as editor, came the Rev. W. Jackman (or
Jackson)—an equally discreditable clergyman,—and
he was succeeded by John Taylor (author of Monsieur
Tonson), for whom Peter Pindar (Dr. John Wolcot)
wrote whimsical verses.
In 1792, Mr. Tattersall was the responsible
proprietor, who, knowing more about horses and
sport than about the elegancies of literature, Dr.
Wolcot continued to be the chief writer; and who,
besides his clever verses, gave much information
upon affairs of the prize-ring and kindred
amusements. In 1795, Tattersall sold the entire
copyright, with house and printing materials, for
£600. The circulation then was only 350 daily.
The purchaser was Mr. Daniel Stuart; and Mr.
Christie, the auctioneer, was also a proprietor.
Previous to this time, Robert Burns was applied to, to
supply poetry, but none was ever sent. Daniel Stuart
was not twenty-nine when he bought The Morning
Post; and James (afterwards Sir Jas.) Mackintosh, who
was his brother-in-law, and was a regular contributor,
was his senior only by a year.
After 1790, the same Andrew Macdonald, who had
been editor of The Star, furnished poems, as did
Wordsworth, Southey, C. Lloyd, and other verse
writers. At the commencement of 1798, S. T.
Coleridge—then only twenty-five—was engaged to
contribute poetry. The Odes, Fire, Famine, and
Slaughter; France; Dejection; and that on The
Departing Year; with twenty or thirty other pieces,
since included in his Poetical Works, among which
was Love—one of the most popular poems of this
age—were first published in The Morning Post. To
these must be added the first draught of The Devil’s
Thoughts, a piece afterwards much altered. About
1800, the paper was supplied with some excellent
pieces, in prose, including Fashionable Intelligence,
short pungent articles, and jokes, by Charles Lamb.
In 1798 its sale was over 2000; and so well had
Daniel Stuart managed his property—being
exceedingly well served by his principal assistant,
George Lane—that when he left The Morning Post for
The Courier, in 1803, the circulation amounted to
4,500. It, therefore, stood higher in point of sale
than any other morning paper, the order in respect of
numbers from high to low being this: Morning Post,
Morning Herald, Morning Advertiser, Times. The
amount received for it was about £25,000. According
to John Taylor, editor of The Sun, in his Records of
my Life, The Morning Post was afterwards purchased
by Government to silence attacks on the Prince
Regent.
Much of the success of The Morning Post was
undoubtedly owing to the writings of Coleridge. He
afterwards declared that he had wasted the prime
and manhood of his intellect in writing for The
Morning Post and Courier. Among his contributions to
the former (March 19, 1800) was his famous
character of William Pitt. The last time he wrote in it
was in August, 1802.
A very competent judge, Thomas De Quincey, thus
alludes to Coleridge’s political writings:—“Worlds of
fine thinking,” he says of the daily press, “lie buried
in that vast abyss, never to be disentombed, or
restored to human admiration. Like the sea, it has
swallowed treasures without end, that no diving-bell
will bring up again. But nowhere throughout its
shoreless magazines of wealth does there lie such a
bed of pearls, confounded with the rubbish and
‘purgamenta’ of ages, as in the political papers of
Coleridge. No more appreciable monument could be
raised to the memory of Coleridge, than a re-
publication of his Essays in The Morning Post, but
still more of those afterwards published in The
Courier.” These have since been reprinted under the
title of Essays on his own Times.
APPENDIX.

THE ANARCHISTS.—An Ode.

[A Parody on Collins’s Ode to the Passions.]


—Numero plures, virtute et honore minores,
Indocti stolidique et depugnare parati.—Hor.
When Anarchy, sworn foe to Kings,
O’er Gallia wav’d her crimson wings,
Ere yet she spoil’d with iron hand
Fair Europe’s desolated land;
Her offspring here, a spurious brood,
In faction nurs’d, inur’d to blood,
Elate with Hope, perplex’d with Fear,
Would often raise the listening ear;
And all their mother’s wonders tell,
And throng around her secret cell,
Ranting, bribing, whispering, trembling,
Urging, boasting, and dissembling.
By turns they felt the Gallic mind
Enlarg’d, unprejudic’d, refin’d;
Till once, by all the goddess fir’d,
Beyond Discretion rapt, inspir’d;
Seditious, false, and prone to ill,
They eager snatch’d the grey-goose quill.
And as they oft had heard apart
The wonders of Sedition’s art,
Each, for Madness rul’d the hour,
Would prove his own subversive power.

First Paine his Rights of Man display’d,


But could no more—for falsely cross’d
Ev’n by the friends himself had made,
Enraged he fled to Gallia’s coast.
Next Priestley tried, to whom ’twas given
Mankind’s free-agency to tell;
Ordain’d to point the road to heaven,
In pure free will he points—to hell!
With meagre visage Thelwall came,
In lectures told his sufferings sore;
Till purple tyrants blush’d with shame
And crowds the suffering saint adore.
But thou, O Godwin! meek and mild;
Speak thy metaphysic page:
Now it cheer’d a laggard age,
And bade new scenes of joy at distance hail;
When tyrant Kings shall be no more,
When human wants and wars shall fail,
And sleep and death shall quit the hallow’d shore.
’Twas thus he strove to sap the throne.
With borrow’d arts and weapons not his own,
While Gallia clapp’d her hands, and hail’d her favourite child.

And longer had he sung—but, strange to say,


Wakefield, the dragon-fly, rush’d on;
Eager he sought the bold rebellious fray,
And burst with anger and disdain
The web of sophistry in twain
Which Godwin, patient sage! had spread
To catch the fluttering insects of the land.
Treason upreared her arm to strike,
Rebellion grasped the murd’rous pike,
And though, sometimes, each maddening pause between,
Soft Discretion, joined with Fear,
Whisper’d her councils in his ear,
Still Anarchy upheld the busy scene,
And raised her shield of brass to guard her vot’ry’s head.

Next Holcroft vowed in doleful tone


No more to fire a thankless age,
Oblivion marked his labours for her own,
Neglected from the press and damn’d upon the stage.
See! faithful to their mighty dam,
Coleridge, Southey, Lloyd, and Lamb,
In splay-foot madrigals of love.
Soft moaning like the widowed dove,
Pour side by side their sympathetic notes.
Of equal rights and civic feasts
And tyrant Kings and knavish Priests
Swift through the land the tuneful mischief floats
Swift through the land the tuneful mischief floats.
And now to softer strains they struck the lyre,
They sung the beetle, or the mole,
The dying kid, or ass’s foal,
By cruel man permitted to expire.
But O, how altered was the sprightlier hour!
When Fox, the Parthian hero, rose to view;
He o’er the rest high-towering like a steeple
Leagued with a “Corresponding” crew,
Pledged in large floods of wine “their Majesties—the People”.

The royal tribe accept the proffered power.


Kings from the forge, dictators from the plough,
Peeping from forth their allies low,
Before the fallen arch-seceder bow;
Lepaux bade Gallia hail his name,
But old St. Stephen bowed his head for shame.

See Norfolk last, with Bedford roll,


He of Bacchus’ favours proud,
The sovereign mob most eloquent addressed;
But soon he spied the mirth-inspiring bowl,
Whose ruby treasures charmed his soul the best;
They would have thought who heard him speak,
’Twas Falstaff, with his minions at his back,
High primed with valour, turbulence, and sack,
Aping the monarch to a wondr’ing crowd.
While Bedford proud his lesson to rehearse,
With studious labours urged the bold reply:
Shouts of applause ran rattling through the sky:
And he, the hero of the day,
Right glad their servile suffrage to repay,
Shook golden bounty from his swelling purse.

O, England! heav’n-defended land!


With power to “threaten and command,”
Say, is thy former spirit broke,
To crouch beneath a foreign yoke,
And listen to the idiot strains
Of slaves thy better sense disdains,
As erst, in many an ardent hour,
You awed an adverse haughty power.
Thy lofty mind, to Freedom true,
May well retain what then it knew.
Where is thy former patriot soul,
Above deceit, above controul?
Arise! as in that happier time
United, fearless, bold, sublime.
’Tis said, and I believe the tale,
Thy efforts then could more avail,
Could more true happiness dispense,
With Order, Morals, virtue, Sense,
Than all that fires with party rage
This boastful philosophic age.
Arise! with manly zeal advance,
To curb the lawless power of France;
O, bid her mad endeavours cease,
And give the willing nations PEACE!
—Fabricius.
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!

ebookfinal.com

You might also like