100% found this document useful (1 vote)
92 views

PDF Build Your Own Redis with C C James Smith download

Build

Uploaded by

tapaulongar
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)
92 views

PDF Build Your Own Redis with C C James Smith download

Build

Uploaded by

tapaulongar
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/ 55

Experience Seamless Full Ebook Downloads for Every Genre at textbookfull.

com

Build Your Own Redis with C C James Smith

https://textbookfull.com/product/build-your-own-redis-with-
c-c-james-smith/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Build Your Own Redis with C C James Smith

https://textbookfull.com/product/build-your-own-redis-with-c-c-james-
smith-2/

textboxfull.com

Build Your Own Database From Scratch James Smith

https://textbookfull.com/product/build-your-own-database-from-scratch-
james-smith/

textboxfull.com

Build Your Own Car Dashboard with a Raspberry Pi:


Practical Projects to Build Your Own Smart Car Joseph
Coburn
https://textbookfull.com/product/build-your-own-car-dashboard-with-a-
raspberry-pi-practical-projects-to-build-your-own-smart-car-joseph-
coburn/
textboxfull.com

Build Your Own AI Investor Damon Lee

https://textbookfull.com/product/build-your-own-ai-investor-damon-lee/

textboxfull.com
The Complete Build Your Own PC Manual 2020 Black Dog

https://textbookfull.com/product/the-complete-build-your-own-pc-
manual-2020-black-dog/

textboxfull.com

Create Computer Games Design and Build Your Own Game


Patrick Mccabe

https://textbookfull.com/product/create-computer-games-design-and-
build-your-own-game-patrick-mccabe/

textboxfull.com

Sew Your Own Wardrobe More Than 80 Techniques 1st Edition


Alison Smith

https://textbookfull.com/product/sew-your-own-wardrobe-more-
than-80-techniques-1st-edition-alison-smith/

textboxfull.com

DIY Lithium Batteries How to Build Your Own Battery Packs


Micah Toll

https://textbookfull.com/product/diy-lithium-batteries-how-to-build-
your-own-battery-packs-micah-toll/

textboxfull.com

100 Weight Loss Bowls Build Your Own Calorie Controlled


Diet Plan Heather Whinney

https://textbookfull.com/product/100-weight-loss-bowls-build-your-own-
calorie-controlled-diet-plan-heather-whinney/

textboxfull.com
Build Your Own Redis with
C/C++

Learn network programming and


data structures

James Smith

2023-01-31
Build Your Own Redis with
C/C++

1. Build Your Own Redis with C/C++


2. 01. Introduction

3. 02. Introduction to Sockets

4. 03. Hello Server/Client

5. 04. Protocol Parsing

6. 05. The Event Loop and


Nonblocking IO
7. 06. The Event Loop
Implementation
8. 07. Basic Server: get, set, del

9. 08. Data Structure: Hashtables

10. 09. Data Serialization


11. 10. The AVL Tree: Implementation
& Testing
12. 11. The AVL Tree and the Sorted

Set
13. 12. The Event Loop and Timers

14. 13. The Heap Data Structure and

the TTL
15. 14. The Thread Pool &
Asynchronous Tasks
16. A1: Hints to Exercises

1. Title Page
2. Cover

3. Table of Contents
Build Your Own Redis with
C/C++
01. Introduction

What Is This Book About?

This book contains a step-by-step


walkthrough of a simple
implementation of a Redis-like server.
It is intended as a practical guide or
tutorial to network programming and
the implementation and application
of basic data structures in C.

What to Learn From This Book?

Redis could be considered one of the


building blocks of modern computing
that stood the test of time. The
knowledge required for building such
a project is broader and deeper than
usual application-level development.
Learning from such projects is a good
way for software developers to level
up their skills.

Redis is a good target for learning


because it covers two important
subjects of software engineering:
network programming and data
structures.

While there are many guides on


socket APIs or high-level libraries,
network programming is more
than calling APIs or libraries. It is
important to understand core
concepts such as the event loop,
protocols, timers, etc, which this
book will cover. The lack of
understanding can result in fatal
mistakes even if you are just
employing high-level networking
libraries or frameworks in your
applications.
Although many people learned
some basic data structures from
textbooks, there is still something
more to learn. Data structures
implemented in real projects often
have some practical considerations
which are not touched by
textbooks. Learning how data
structures are used in a non-toy
environment (especially in C) is a
unique experience from building
Redis.
Like most real-world projects, Redis
is a complex project built with lots of
effort, which can be hard to grasp for
beginners. Instead, this book takes
an opposite approach: learning by
building things from scratch.

Why From Scratch?

A couple of points:

To learn faster. By building


things from scratch, concepts can
be introduced gradually. Starting
from the small, adding things
incrementally, and getting the big
picture in the end.
To learn deeper. While there are
many materials explaining how an
existing stuff works, the
understanding obtained by reading
those materials is often not the
same as building the stuff yourself.
It is easy to mistake memorization
for understanding, and it’s easier
to pick up unimportant details than
principles and basics.
To learn more. The “from
scratch” approach forces you to
touch every aspect of the subject
— there are no shortcuts to
knowledge! And often not every
aspect is known to you
beforehand, you may discover
“things I don’t know I don’t know”
in the process.
Summarized in a quote from
Feynman: “What I cannot create, I
do not understand”.

How to Use This Book?

This book follows a step-by-step


approach. Each step builds on the
previous one, adding a new concept.
The full source code is provided on
the web for reference purposes,
readers are advised to tinker with it
or DIY without it.

The code is written as direct and


straightforwardly as the author could.
It’s mostly plain C with minimal C++
features. Don’t worry if you don’t
know C, you just have the
opportunity to do it in another
language by yourself.

The end result is a mini Redis alike


with only about 1200 lines of code.
1200 LoC seems low, but it illustrates
many important aspects the book
attempts to cover.

The techniques and approaches used


in the book are not exactly the same
as the real Redis. Some are
intentionally simplified, and some are
chosen to illustrate a general topic.
Readers can learn even more by
comparing different approaches.

The code used in this book is


intended to run on Linux only, and
can be downloaded at this URL:

https://build-your-
own.org/redis/src.tgz

The contents and the source code of


this book can be browsed online at:

https://build-your-own.org
02. Introduction to Sockets

This chapter is an introduction to


socket programming. Readers are
assumed to have basic knowledge of
computer networking but no
experience in network programming.
This book does not contain every
detail on how to use socket APIs, you
are advised to read manpages and
other network programming guides
while learning from this book.
(https://beej.us/ is a good source for
socket APIs.)

Redis is an example of the


server/client system. Multiple clients
connect to a single server, and the
server receives requests from TCP
connections and sends responses
back. There are several Linux system
calls we need to learn before we can
start socket programming.

The socket() syscall returns an fd.


Here is a rough explanation of “fd” if
you are unfamiliar with Unix systems:
An fd is an integer that refers to
something in the Linux kernel, like a
TCP connection, a disk file, a
listening port, or some other
resources, etc.

The and listen() syscall: the


bind()
bind() associates an address to a
socket fd, and the listen() enables
us to accept connections to that
address.

The accept() takes a listening fd,


when a client makes a connection to
the listening address, the accept()
returns an fd that represents the
connection socket. Here is the
pseudo-code that explains the typical
workflow of a server:

fd = socket()
bind(fd, address)
listen(fd)
while True:
conn_fd = accept(fd)
do_something_with(conn_fd)
close(conn_fd)

The read() syscall receives data from


a TCP connection. The write() syscall
sends data. The close() syscall
destroys the resource referred by the
fd and recycles the fd number.

We have introduced the syscalls


needed for server-side network
programming. For the client side, the
connect() syscall takes a socket fd
and address and makes a TCP
connection to that address. Here is
the pseudo-code for the client:

fd = socket()
connect(fd, address)
do_something_with(fd)
close(fd)

The next chapter will help you get


started using real code.
03. Hello Server/Client

This chapter continues the


introduction of socket programming.
We’ll write 2 simple (incomplete and
broken) programs to demonstrate the
syscalls from the last chapter. The
first program is a server, it accepts
connections from clients, reads a
single message, and writes a single
reply. The second program is a client,
it connects to the server, writes a
single message, and reads a single
reply. Let’s start with the server first.

First, we need to obtain a socket fd:


int fd = socket(AF_INET, SOCK_STREAM,
0);

The AF_INET is for IPv4, use AF_INET6


for IPv6 or dual-stack socket. For
simplicity, we’ll just use AF_INET
throughout this book.

The SOCK_STREAM is for TCP. We won’t


use anything other than TCP in this
book. All the 3 parameters of the
socket() call are fixed in this book.

Next, we’ll introduce a new syscall:

int val = 1;
setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &val,
sizeof(val));

The setsockopt() call is used to


configure various aspects of a socket.
This particular call enables the
SO_REUSEADDR option. Without this
option, the server won’t able to bind
to the same address if restarted.
Exercise to reader: find out what
exactly is SO_REUSEADDR and why it is
needed.

The next step is the bind() and


listen(), we’ll bind on the wildcard
address 0.0.0.0:1234:

// bind, this is the syntax that deals with


IPv4 addresses
struct sockaddr_in addr = {};
addr.sin_family = AF_INET;
addr.sin_port = ntohs(1234);
addr.sin_addr.s_addr = ntohl(0); //
wildcard address 0.0.0.0
int rv = bind(fd, (const sockaddr *)&addr,
sizeof(addr));
if (rv) {
die("bind()");
}

// listen
rv = listen(fd, SOMAXCONN);
if (rv) {
die("listen()");
}

Loop for each connection and do


something with them.

while (true) {
// accept
struct sockaddr_in client_addr = {};
socklen_t socklen = sizeof(client_addr);
int connfd = accept(fd, (struct sockaddr
*)&client_addr, &socklen);
if (connfd < 0) {
continue; // error
}

do_something(connfd);
close(connfd);
}

The do_something() function is simply


read and write.

static void do_something(int connfd) {


char rbuf[64] = {};
ssize_t n = read(connfd, rbuf, sizeof(rbuf) -
1);
if (n < 0) {
msg("read() error");
return;
}
printf("client says: %s\n", rbuf);

char wbuf[] = "world";


write(connfd, wbuf, strlen(wbuf));
}

Note that the read() and write() call


returns the number of read or written
bytes. A real programmer must deal
with the return value of functions,
but in this chapter, I have omitted
lots of things for brevity. And the
code in this chapter is not the correct
way to do networking anyway.

The client program is much simpler:

int fd = socket(AF_INET, SOCK_STREAM, 0);


if (fd < 0) {
die("socket()");
}

struct sockaddr_in addr = {};


addr.sin_family = AF_INET;
addr.sin_port = ntohs(1234);
addr.sin_addr.s_addr =
ntohl(INADDR_LOOPBACK); // 127.0.0.1
int rv = connect(fd, (const struct sockaddr
*)&addr, sizeof(addr));
if (rv) {
die("connect");
}
char msg[] = "hello";
write(fd, msg, strlen(msg));

char rbuf[64] = {};


ssize_t n = read(fd, rbuf, sizeof(rbuf) - 1);
if (n < 0) {
die("read");
}
printf("server says: %s\n", rbuf);
close(fd);

Compile our programs with the


following command line:

g++ -Wall -Wextra -O2 -g 03_server.cpp -o server


g++ -Wall -Wextra -O2 -g 03_client.cpp -o client

Run ./server in a window and then


run ./client in another window. You
should see the following results:
$ ./server
client says: hello

$ ./client
server says: world

Exercise for readers: read manpages


of APIs used in this chapter, or find
online tutorials for them. Make sure
you know how to find helps on API
usage since this book won’t cover the
details of API usage.

03_client.cpp
03_server.cpp
04. Protocol Parsing

Our server will be able to process


multiple requests from a client, to do
that we need to implement some sort
of “protocol”, at least to split requests
apart from the TCP byte stream. The
easiest way to split requests apart is
by declaring how long the request is
at the beginning of the request. Let’s
use the following scheme.

+-----+------+-----+------+--------
| len | msg1 | len | msg2 | more...
+-----+------+-----+------+--------
The protocol consists of 2 parts: a 4-
byte little-endian integer indicating
the length of the following request,
and a variable length request.

Starts from the code from the last


chapter, the loop of the server is
modified to handle multiple requests:

while (true) {
// accept
struct sockaddr_in client_addr = {};
socklen_t socklen = sizeof(client_addr);
int connfd = accept(fd, (struct sockaddr
*)&client_addr, &socklen);
if (connfd < 0) {
continue; // error
}

// only serves one client connection at


once
while (true) {
int32_t err = one_request(connfd);
if (err) {
break;
}
}
close(connfd);
}

The one_request function only parses


one request and replies, until
something bad happens or the client
connection is gone. Our server can
only handle one connection at once
until we introduce the event loop in
later chapters.

Adding two helper functions before


listing the one_request function:

static int32_t read_full(int fd, char *buf,


size_t n) {
while (n > 0) {
ssize_t rv = read(fd, buf, n);
if (rv <= 0) {
return -1; // error, or unexpected
EOF
}
assert((size_t)rv <= n);
n -= (size_t)rv;
buf += rv;
}
return 0;
}

static int32_t write_all(int fd, const char *buf,


size_t n) {
while (n > 0) {
ssize_t rv = write(fd, buf, n);
if (rv <= 0) {
return -1; // error
}
assert((size_t)rv <= n);
n -= (size_t)rv;
buf += rv;
}
return 0;
}
Other documents randomly have
different content
through the library window to increase the bonfire in the courtyard
below.
Very different was the Celestina, first printed in Burgos in 1499,
and now generally believed to be the work of a lawyer, Fernando de
Rojas. Here are no shadowy Knights condemned to struggle through
endless pages with imaginary beasts; but men and women at war
with sin and moved by passions that are as eternal as human life
itself. The author describes it as a “Tragicomedia,” since it begins in
comedy and ends in tragedy. It is the tale of a certain youth, Calisto,
who, rejected by the heroine, Melibea, bribes an old woman,
Celestina, to act as go-between; until at length through her evil
persuasions virtue yields to his advances. The rest of the book works
out the Nemesis; Calisto being surprised and slain at a secret
meeting with his mistress, Celestina murdered for her ill-gotten
money by her associates, while Melibea herself commits suicide. The
whole is related in dialogue, often witty and even brilliant; but
marred for the taste of a later age by gross and indecent passages.
The Celestina has been classed both as novel and play, and might
indeed be claimed as the forerunner of both these more modern
Spanish developments. It is cast in the form of acts; but their number
(twenty-one) and the extreme length of many of the speeches make it
improbable that it was ever acted. Nevertheless its popularity,
besides raising a host of imitations more or less worthless, insured it
a lasting influence on Castilian literature; and the seventeenth
century witnessed its adaptation to the stage.
Other dialogues, with less plot but considerable dramatic spirit,
are the Coplas de Mingo Revulgo, and the Dialogue between Love
and an Old Man by Rodrigo Cota. The former of these represents a
conversation between two shepherds, satirizing the reign of Henry
IV.; the latter the disillusionment of an old man who, having allowed
himself to be tricked by Love whom he believed he had cast out of his
life for ever, finds that Love is mocking him and that he has lost the
power to charm.
Whether these pieces were acted or no is not certain; but they bear
enough resemblance to the Representaciones of Juan del Enzina,
which certainly were produced, to make it probable that they were.
Juan de Enzina was born about the year 1468, and under the
patronage of the Duke of Alva appeared at Ferdinand and Isabel’s
Court, where he became famous as poet and musician. Amongst his
works are twelve “Églogas,” or pastoral poems, six secular in their
tone and six religious, the latter being intended to celebrate the great
church festivals.
The secular Representaciones deal with simple incidents and show
no real sense of dramatic composition; but with the other six they
may be looked on as a connecting link between the old religious
“Mysteries” and “Miracle Plays” of the early Middle Ages and the
coming Spanish drama. Their author indeed stands out as “Father”
of his art in Spain, for a learned authority of the reign of Philip IV.
has placed it on record that “in 1492, companies began to represent
publicly in Castile plays by Juan del Enzina.”
If the literature of Spain during the fifteenth and early sixteenth
centuries may be described by the general term “transitional,”
marking its development from crudity of ideas and false technique
towards a slow unfolding of its true genius, painting at the same date
was still in its infancy; while architecture and the lesser arts of
sculpture, metal-work, and pottery had already reached their period
of greatest glory.
Schools of painting existed, it is true, at Toledo and in Andalusia;
but the three chief artists of the Court of Isabel came from Flanders;
and most of the pictures of the time exhibit a strong Flemish
influence, which can be recognized in their rich and elaborate
colouring, clearly defined outlines, and the tall gaunt figures so dear
to northern taste. Of Spanish painters, the names of Fernando
Gallegos “the Galician,” of Juan Sanchez de Castro a disciple of the
“Escuela Flamenca,” and of Antonio Rincon and his son Fernando,
stand out with some prominence; but it is doubtful if several of the
pictures formerly attributed to Antonio, including a Madonna with
Ferdinand and Isabel kneeling in the foreground, are really his work.
In architecture at this time the evidence of foreign influence is also
strong. On the one hand are Gothic Churches like San Juan de Los
Reyes at Toledo or amongst secular buildings, the massive castle of
Medina del Campo; on the other, in contrast to these northern
designs, Renaissance works with their classic-Italian stamp, such as
the Hospital of Santa Cruz at Toledo or the College of the same name
at Valladolid. Yet a third element is the Moresque, founded on
Mahometan models, such as the horseshoe arch of the Puerta del
Perdón of the old Mosque at Seville overlaid with the emblems of
Christian worship. The characteristics of North, South, and East, are
distinct; yet moulded, as during the previous centuries, by the race
that borrowed them to express ideals peculiarly its own.
“Let us build such a vast and splendid temple,” said the founders
of Seville Cathedral in 1401, “that succeeding generations of men will
say that we were mad.”
It is the arrogant self-assertion of a people absolutely convinced,
from king to peasant, of their divine mission to astonish and subdue
the world in the name of the Catholic Faith and Holy Church. The
triumphant close of their long crusade intensified this spiritual pride;
and Spanish architecture and sculpture ran riot in a wealth of
ornament and detail, that cannot but arrest though it often wearies
the eye.
Such was the “plateresque” or “silversmith” method of elaborate
decoration, seen at its best at Avila in the beautiful Renaissance tomb
of Prince John, which though ornate is yet refined and pure, at its
most florid in the façade of the Convent of San Pablo at Valladolid.
Under its blighting spell the strong simplicity of an earlier age
withered; and Gothic and Renaissance styles alike were to perish
through the false standard of merit applied to them by a decadent
school.
FAÇADE OF SAN PABLO AT
VALLADOLID

FROM A PHOTOGRAPH BY LACOSTE,


MADRID

The first impression emerging from a survey of Queen Isabel’s


reign is the thought of the transformation those thirty years had
wrought in the character of her land. It is not too much to say that in
this time Spain had passed from mediævalism to take her place in a
modern world. She had conquered not only her foes abroad but
anarchy at home. She had evolved a working-system of government
and discovered a New World. She had trampled out heresy; and thus
provided a solution of the religious problem at a time when most of
the other nations of Europe were only beginning to recognise its
difficulties.
Not all these changes were for the best. On the heavy price paid in
blood and terror for the realization of the ideal “One people, one
Faith” we have already remarked. We can see it with clear eyes now;
but at the time the sense of orthodoxy above their fellows, that arose
from persecuting zeal, gave to the Spanish nation a special power;
and Isabel “the Catholic” was the heroine of her own age above all for
the bigotry that permitted the fires and tortures of the Inquisition.

A woman ... [says Martin Hume] whose saintly devotion to her Faith blinded her
eyes to human things, and whose anxiety to please the God of Mercy made her
merciless to those she thought His enemies.

With this verdict, a condemnation yet a plea for understanding,


Isabel, “the persecutor” must pass before the modern judgment-bar.
In her personal relations, both as wife and mother, and in her
capacity as Queen on the other hand she deserves our unstinted
admiration.

The reign of Ferdinand and Isabel [says Mariéjol] may be summarized in a few
words. They had enjoyed great power and they had employed it to the utmost
advantage both for themselves and the Spanish nation. Royal authority had been in
their hands an instrument of prosperity. Influence abroad,—peace at home,—these
were the first fruits of the absolute monarchy.

If criticism maintains that this benevolent government


degenerated into despotism during the sixteenth century, while
Spain became the tool and purse of imperial ambitions, it should be
remembered that neither Castilian Queen nor Aragonese King could
have fought the evils they found successfully with any other weapon
than their own supremacy, nor is it fair to hold them responsible for
the tyranny of their successors. Ferdinand indeed may be blamed for
yielding to the lure of an Italian kingdom; but even his astuteness
could not have foreseen the successive deaths that finally secured the
Spanish Crown for a Hapsburg and an Emperor.
These were the tricks of Fortune, who according to Machiavelli is
“the mistress of one-half our actions.” The other half is in human
reckoning; and Isabel in her sincerity and strength shaped the
destiny of Castile as far as in her lay with the instinct of a true ruler.
“It appeared the hand of God was with her,” says the historian,
Florez, “because she was very fortunate in those things that she
undertook.”
APPENDIX I
HOUSE OF TRASTAMARA IN CASTILE AND
ARAGON
APPENDIX II
PRINCIPAL AUTHORITIES FOR THE LIFE
AND TIMES OF ISABEL OF CASTILE

A. Contemporary.
Bernaldez (Andrés) (Curate of Los Palacios), Historia de Los
Reyes.
Carvajal (Galindez), Anales Breves.
Castillo (Enriquez del), Crónica del Rey Enrique IV.
Martyr (Peter), Opus Epistolarum.
Pulgar (Hernando de), Crónica de Los Reyes Católicos.
—— Claros Varones.
Siculo (Lucio Marineo), Sumario de la ... Vida ... de Los
Católicos Reyes.
Zurita, Anales de Aragon, vols. v. and vi.
B. Later Authorities.
Altamira, Historia de España, vol. ii.
Bergenroth, Calendar of State Papers, vol. i.
Butler Clarke, “The Catholic Kings,” (Cambridge Modern
History, vol. i.).
—— Spanish Literature.
Clemencin, Elogio de La Reina Isabel.
Flores, Reinas Católicas.
Hume (Martin), Queens of Old Spain.
Irving (Washington), Conquest of Granada.
—— Life of Christopher Columbus.
Lafuente, Historia de España, vols. vi. and vii.
Lea, History of the Inquisition in Spain. 4 v.
Mariéjol, L’Espagne sous Ferdinand et Isabelle.
Prescott, History of the Reign of Ferdinand and Isabella.
Sabatini (Rafael), Torquemada and the Spanish Inquisition.
Thacher (John Boyd), Christopher Columbus. 3 v.
Ticknor, History of Spanish Literature, v. i.
Young (Filson), Life of Christopher Columbus. 2 v.
Some Additional Authorities Consulted.
Volumes xiv., xxxix., lxxxviii., and others of the Documentos
Inéditos.
Volume lxii. and others of the Boletin de La Real Academia.
Amador de los Rios, Historia de Madrid.
Armstrong (E.), Introduction to Spain, Her Greatness and
Decay, by Martin Hume.
Berwick and Alba, Correspondencia de Fuensalida.
Colmenares, Historia de Segovia.
Diary of Roger Machado.
Fitzmaurice-Kelly, History of Spanish Literature.
Mariéjol, Pierre Martyr d’Anghera: Sa vie et ses œuvres.
Memoirs of Philip de Commines.
INDEX

A
Abraham “El Gerbi,” 211, 213
Aguilar, Alonso de, 177, 180, 182, 281–3
Ajarquia, 176, 181
Alcabala, 384, 394, 395
Alcalá de Henares, University of, 402
Alexander VI. (Rodrigo Borgia), 85, 236, 239, 248, 261, 306, 353,
354, 360, 363
Alfonso V. of Aragon, 24, 25, 35, 115–119, 350
Alfonso of Castile, brother of Isabel, 22, 35, 46, 52, 56, 60, 64, 65
Alfonso II. of Naples, 350, 353, 354, 356
Alfonso V. of Portugal, 52, 70, 96, et seq.; 107, et seq.
Alfonso, son of John II. of Portugal, 223, 337
Alfonso, Archbishop of Saragossa, 244, 330
Alhama, 165, 170
Aliator, 176, 181, 182
Aljubarrota, Battle of, 30
Almeria, 161, 204, 216, 220, 280
Alpujarras, The, 278, 280
Alvaro, Don, of Portugal, 212
Amadis de Gaula, 414
Anne of Beaujeu, 340
Anne of Brittany, 340
Aranda, Council of, 239
Aranda, Pedro de, 261
Architecture, Castilian, 419–420
Arras, Cardinal of, 73, 81
Arthur, Prince of Wales, 373, 374
Atella, capitulation of, 362
“Audiences” in Seville, 136
Auto-de-Fe, 256
Ayora, Gonsalvo de, 192
Azaator, Zegri, 274
B
Baeza, 216, 217, 219, 220, 223, 280
Bahamas, discovery of, 304
Barbosa, Arias, 406
Barcelona, 38, 39, 40, 50, 75, 305, 328, 352
Bernaldez, Andres, Curate of Los Palacios, 168, 263, 412
Berri, Charles, Duke of (later of Guienne), 72, 81, 83
Biscay, Province of, 100, 101, 112, 117
Blanche of Navarre, 26
Blanche, dau. of John II. of Aragon, 27, 28, 43, 44
Boabdil, 172, 181, et seq.; 198, 203, et seq.; 208, 221–223, 227, et seq.
Bobadilla, Beatriz de (Marchioness of Moya), 62, 74, 84, 85, 212, 213,
298
Bobadilla, Francisco de, 314
Borgia, Cæsar, 364. (See also Alexander VI.)
Burgos, 54, 55, 60, 103, 106;
Bishop of, 72, 74
C
Cabrera, Andres de (later Marquis of Moya), 83, 86, 112, 114, 298
Cadiz, Marquis of, 136, 139, 140, 165 et seq.; 175, 177, 180, 183, 200,
201, 209, 212, 216
Cancionero General, 410
Carcel de Amor, 415
Cardenas, Alonso de, 153, 176;
Gutierre de, 88, 217, 229
Carrillo, Archbishop, 58, 59, 60, 63, 64, 68, 76, 78, 79, 80, 85, 89,
90, 94, 96, 100, 105, 108, 109, 111, 232, 239, 240
Castillo, Enriquez del, 87, 411
Catherine of Aragon, 334, 372, 374
Celestina, 416
Charles of Austria, son of Archduke Philip, 378, 384, 390, 396, 408
Charles, The Bold, 116, 117
Charles VIII. of France, 186, 340, 347, 348, 351, et seq.; 363
Charles of Viana, 26, 36, et seq.
Church, Castilian, 13, et seq.; 104, 231, et seq.; 249, 250
Cid Haya, 216, 220, 223
Cifuentes, Count of, 177, 180
Cisneros, Ximenes de, 242, et seq.; 273, et seq.; 402, 403
Claude, dau. of Louis XII., 378
Columbus, Bartholomew, 289, 315
Columbus, Christopher, early life, 286;
nautical theories, 291;
appears at Spanish Court, 295;
character, 294, 298, 300, 302, 314;
appearance, 295;
prepares to leave Spain, 299;
first voyage, 303, 305;
reception at Barcelona, 305;
second voyage, 307;
views on slavery, 310;
third voyage, 314;
arrest, 315;
fourth voyage, 316;
devotion to Queen Isabel, 298, 313, 317;
death, 317
Columbus, Diego, 294, 299, 317
Commines, Philip de, 48
Conversos, The, 251, 252, 253
Coplas de Manrique, 408
Coplas de Mingo Revulgo, 417
Cordova, Gonsalvo de, 189, 206, 280, 361, 367, 371
Cortes, the Castilian, 18
Cota, Rodrigo, 417
Cueva, Beltran de La (Count of Ledesma, Duke of Alburquerque), 32,
33, 45, 48, 51, 52, 54, 57, 62, 64, 89, 151
D
D’Aubigny, Stuart, 361
Davila, Juan Arias, 261
De Puebla, 374
Diaz, Bartholomew, 289
E
Edict of Grace, 255
Egypt, Sultan of, 219, 278
Eleanor, dau. of John II. of Aragon, 43, 44, 359
Emmanuel of Portugal, 273, 338, 343, 372
Enriquez, Fadrique, Admiral of Castile, 36, 58, 59, 60, 74
Enzina, Juan del, 417, 418
Escalas, Conde de, 205, 206, 207
Española, 305, 309, 313, 314, 316
Estella, 49, 51
Estepar, El Feri Ben, 281, 282
F
Fadrique (the younger), 155
Federigo of Naples, 355, 364, 370
Ferdinand of Aragon (The Catholic) character, 2, 69, 174, 210, 324,
325, 330, 332, 370, 371, 387, 391;
appearance, 89;
diplomacy, 346, 352, 358, 359, 364, 372, 375;
birth, 26;
becomes heir to throne of Aragon, 40;
alliance with Isabel, 35, 69, 77, et seq.;
meeting with Isabel, 208;
reconciliation with Henry IV., 86;
becomes King of Aragon, 118;
attempted assassination of, 328;
military measures, 102, 103, 166, et seq.; 112, 168, 175, 191, 196,
201, 216, 219, 280, 379;
attitude to Jews, 264, 265, 271;
to Mudejares, 283;
to the Inquisition, 249, 255, 258;
to Roman See, 235, 239, 254;
to his children, 335;
to Columbus, 296, 297, 313;
foreign policy of, 335;
receives submission of Boabdil, 229;
second marriage, 388;
regent of Castile, 390;
estimate of his work, 422
Ferdinand, son of Archduke Philip, 379
Ferrante I. of Naples, 36, 349, 350, 353, 356
Ferrante II., 354, 356, 361, 364, 369
Fez, King of, 221, 229
Florence, 349, 350, 353
Foix, Catherine de, 339
Foix, Gaston de, 43, 75
Foix, Gaston de (the younger), 43
Foix, Germaine de, 388, 390
Fonseca, Alonso de, 30, 240
Fornovo, battle of, 361
Francis Phœbus of Navarre, 111, 339
Fuenterrabia, meeting of, 48
G
Galicia, settlement of, 133
Galindo, Beatriz de, 332, 407
Genoa, 25
Geraldino, Alessandro, 299, 333
Giron, Pedro, Master of Calatrava, 36, 60, 62, 63
Granada, City of, 215, 224, 227, et seq.;
Kingdom of, 160, 188;
partition Treaty of, 365, 366
Guadix, 173, 206, 216, 220, 221, 223, 224, 280
Guejar, 280
Guiomar, Doña, 31, 233
Guipuzcoa, 100, 106, 112, 117
Guzman, Ramir Nuñez de, 155, 156
H
Hamet, “El Zegri,” 199, 200, 201, 202, 206, 210, 211, 213, 214
Haro, Count of, 101, 129
Henry IV. of Castile (Prince of Asturias), 23, 27, 28;
(King), 24, 36, 39, 44, 54, 55, 56, 70, 71, 80, et seq.; 158, 160, 253
Henry VII. of England, 373
Henry, “The Navigator,” of Portugal, 289
I
Inquisition in Castile, 249, 253–261
Isabel of Castile, character, 1, 4, 5, 131, 233, 319, 324, 327, 328, 336;
love of her Faith, 325;
attitude to her confessors, 241, 242, 243, 326, 327, 329;
love of learning, 332, 333, 400 et seq.;
devotion to Ferdinand, 329;
her magnificence, 321, 323, 399;
her justice, 130, 135, 136, et seq.; 155;
birth, 22;
childhood, 34, 46, 52, 67;
suggested alliances, 35, 39, 53, 62, 68, 70, 72, 73;
marriage with Ferdinand, 69, 74, 76, 77, et seq.;
joins her brother Alfonso, 65;
reconciliation with Henry IV., 84, 85, 86;
accession, 88, 91, 92;
appeals to Archbishop Carrillo, 100;
celebrates battle of Toro, 109;
quells riot in Segovia, 112, et seq.;
visits Seville, 115, 136;
disputes with Ferdinand, 186;
legislation and reforms of, 147, 150, 153, 392, et seq.;
military measures of, 106, 168, 187, et seq.; 192, 194, et seq.; 218;
visits camps, 207, 211, 226;
entry into Granada, 230;
attitude to the Castilian Church, 234, 235, 236, 247, 248;
to the Inquisition, 249, 254, 255, 258;
to the Jews, 264, 265, 271;
to the Mudejares, 273, 279, 280, 284;
to the Roman See, 235–239, 254;
to Columbus, 285, 295, 297, 298, 303, 315;
to slavery, 312–313;
to her children, 331, 334, 377, 380, 381;
her will, 383;
her death, 384;
survey of her reign, 421.
Isabel, mother of Isabel of Castile, 33, 34
Isabel, dau. of Isabel of Castile, 82, 207, 223, 337, 338, 343, 344, 345
Isabella, the city, 313
Ismail, Sultan, 162
J
James IV. of Scotland, 374, 375
Jews, 6, 250, 252, 263, et seq.
Joanna, “La Beltraneja,” 45, 46, 81–83, 93, 94, 99, 119, 120, 336
Joanna of Portugal, wife of Henry IV., 30, 31, 32, 33, 44, 45, 52
Joanna of Aragon, dau. of Isabel of Castile, 334, 341, 342, 375, et
seq.; 390
Joanna (Queen of Aragon), 26, 27, 40, 41, 42, 75
John II. of Aragon, 24, 25, 26, 28, 36, 40, 101, 364
John II. of Castile, 22, 23, 27
John II. of Portugal, 107, 108, 118, 289, 292, 307, 338
John, son of Ferdinand and Isabel, 115, 216, 223, 331, 332, 339, 344
L
Lebrija, Antonio de, 406
Lerin, Count of, 280
Lisbon, Treaty of, 118, 336
Literature, Castilian, 407, et seq.
Loja, 175, 176, 201, 205
Lopera, battle of, 200
Louis XI. of France, 42, 43, 47, et seq.; 81, 100, 106, 110, 115, 116, 117,
118, 186, 339, 346, 347
Louis XII. of France (Duke of Orleans), 355, 357;
(King), 363, 365, 388, 389
Lucena, 181
Ludovico, “Il Moro,” 348, et seq.; 364
M
Machado, Roger, 321, 323, 373
Madeleine, sister of Louis XI., 43, 339
Madrigal, Cortes of, 124
Malaga, 173, 204, 208, 209, et seq.
Margaret of Austria, 340–344
Maria, dau. of Ferdinand and Isabel, 338, 372
Marineo, Lucio, 405
Marriage-settlement of Ferdinand and Isabel, 79
Martyr, Peter, 195, 219, 385, 404–405
Mary of Burgundy, 83, 117
Maximilian, King of the Romans, 340, 358
Medina-Celi, Duke of, 295
Medina del Campo, Concord of, 56, 253;
Junta of, 57
Medina-Sidonia, Duke of, 136, 140, 168, 189, 190
Mendoza, family of, 52, 76, 82, 84, 89;
Diego Hurtado de, 246;
Pedro Gonsalez de (Bishop of Calahorra), 62;
(Bishop of Siguenza), 67;
(Cardinal of Spain), 84, 89, 90, 108, 150, 154, 187, 229, 232, 233,
234, 240, 243, 244, 255, 299, 404
Merlo, Diego de, 165, 169
Miguel, grandson of Ferdinand, 345
Military Orders, 10, et seq., 152, 154
Moclin, 207
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!

textbookfull.com

You might also like