0% found this document useful (0 votes)
2 views83 pages

C Standard Library Collection Of Built In Functions Tutorials Point instant download

The document provides an overview of the C Standard Library, detailing its purpose as a reference manual for C programmers and its collection of built-in functions. It includes links to various ebooks related to the C Standard Library, along with a structured table of contents outlining the different header files and their functions. Additionally, it emphasizes the importance of having a basic understanding of C programming to effectively utilize the library's resources.

Uploaded by

siminsilviq
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)
2 views83 pages

C Standard Library Collection Of Built In Functions Tutorials Point instant download

The document provides an overview of the C Standard Library, detailing its purpose as a reference manual for C programmers and its collection of built-in functions. It includes links to various ebooks related to the C Standard Library, along with a structured table of contents outlining the different header files and their functions. Additionally, it emphasizes the importance of having a basic understanding of C programming to effectively utilize the library's resources.

Uploaded by

siminsilviq
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/ 83

C Standard Library Collection Of Built In

Functions Tutorials Point download

https://ebookbell.com/product/c-standard-library-collection-of-
built-in-functions-tutorials-point-32852294

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

C Standard Library Collection Of Builtin Functions Tutorials Point

https://ebookbell.com/product/c-standard-library-collection-of-
builtin-functions-tutorials-point-12128228

C Standard Library Quick Reference Peter Van Weert Marc Gregoire

https://ebookbell.com/product/c-standard-library-quick-reference-
peter-van-weert-marc-gregoire-33556576

C Standard Library Practical Tips 1st Edition Greg Reese

https://ebookbell.com/product/c-standard-library-practical-tips-1st-
edition-greg-reese-1648652

The C Standard Library A Tutorial And Reference 2nd Edition Nicolai M


Josuttis

https://ebookbell.com/product/the-c-standard-library-a-tutorial-and-
reference-2nd-edition-nicolai-m-josuttis-2586504
The C Standard Library Fourth Edition Includes C23 4th Edition Rainer
Grimm

https://ebookbell.com/product/the-c-standard-library-fourth-edition-
includes-c23-4th-edition-rainer-grimm-49419132

The C Standard Library Rainer Grimm

https://ebookbell.com/product/the-c-standard-library-rainer-
grimm-50194818

The C Standard Library Fourth Edition Includes C23 4th Edition Rainer
Grimm

https://ebookbell.com/product/the-c-standard-library-fourth-edition-
includes-c23-4th-edition-rainer-grimm-48367930

The C Standard Library Fourth Edition Includes C23 4th Edition Rainer
Grimm

https://ebookbell.com/product/the-c-standard-library-fourth-edition-
includes-c23-4th-edition-rainer-grimm-49417210

The C Standard Library Rainer Grimm

https://ebookbell.com/product/the-c-standard-library-rainer-
grimm-50193198
C Standard Library

About the Tutorial


C is a general-purpose, procedural, imperative computer programming language
developed in 1972 by Dennis M. Ritchie at the Bell Telephone Laboratories to develop the
Unix operating system.

C is the most widely used computer language that keeps fluctuating at number one scale
of popularity along with Java programming language which is also equally popular and
most widely used among modern software programmers.

The C Standard Library is a set of C built-in functions, constants and header files
like <assert.h>, <ctype.h>, etc. This library will work as a reference manual for C
programmers.

Audience
The C Standard Library is a reference for C programmers to help them in their projects
related to system programming. All the C functions have been explained in a user-
friendly way and they can be copied and pasted in your C projects.

Prerequisites
A basic understanding of the C Programming language will help you in understanding the
C built-in functions covered in this library.

Copyright & Disclaimer


 Copyright 2014 by Tutorials Point (I) Pvt. Ltd.

All the content and graphics published in this e-book are the property of Tutorials Point
(I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain, copy, distribute or
republish any contents or a part of contents of this e-book in any manner without written
consent of the publisher.

We strive to update the contents of our website and tutorials as timely and as precisely
as possible, however, the contents may contain inaccuracies or errors. Tutorials Point (I)
Pvt. Ltd. provides no guarantee regarding the accuracy, timeliness or completeness of
our website or its contents including this tutorial. If you discover any errors on our
website or in this tutorial, please notify us at [email protected]

i
C Standard Library

Table of Contents
About the Tutorial .................................................................................................................................... i

Audience .................................................................................................................................................. i

Prerequisites ............................................................................................................................................ i

Copyright & Disclaimer ............................................................................................................................. i

Table of Contents .................................................................................................................................... ii

1. C LIBRARY ─ <ASSERT.H> ..................................................................................................... 1

Introduction ............................................................................................................................................ 1

Library Macros ........................................................................................................................................ 1

2. C LIBRARY ─ <CTYPE.H> ....................................................................................................... 3

Introduction ............................................................................................................................................ 3

Library Functions ..................................................................................................................................... 3

Character Classes .................................................................................................................................. 24

3. C LIBRARY ─ <ERRNO.H> .................................................................................................... 26

Introduction .......................................................................................................................................... 26

Library Macros ...................................................................................................................................... 26

4. C LIBRARY ─ <FLOAT.H> ..................................................................................................... 31

Introduction .......................................................................................................................................... 31

Library Macros ...................................................................................................................................... 31

5. C LIBRARY ─ <LIMITS.H> .................................................................................................... 34

Introduction .......................................................................................................................................... 34

Library Macros ...................................................................................................................................... 34

6. C LIBRARY ─ <LOCALE.H> ................................................................................................... 37

Introduction .......................................................................................................................................... 37

Library Macros ...................................................................................................................................... 37

ii
C Standard Library

Library Functions ................................................................................................................................... 38

Library Structure ................................................................................................................................... 42

7. C LIBRARY ─ <MATH.H> ..................................................................................................... 45

Introduction .......................................................................................................................................... 45

Library Macros ...................................................................................................................................... 45

Library Functions ................................................................................................................................... 45

8. C LIBRARY ─ <SETJMP.H> ................................................................................................... 68

Introduction .......................................................................................................................................... 68

Library Variables ................................................................................................................................... 68

Library Macros ...................................................................................................................................... 68

Library Functions ................................................................................................................................... 70

9. C LIBRARY ─ <SIGNAL.H> ................................................................................................... 72

Introduction .......................................................................................................................................... 72

Library Variables ................................................................................................................................... 72

Library Macros ...................................................................................................................................... 72

Library Functions ................................................................................................................................... 73

10. C LIBRARY ─ <STDARG.H> .................................................................................................. 78

Introduction .......................................................................................................................................... 78

Library Variables ................................................................................................................................... 78

Library Macros ...................................................................................................................................... 78

11. C LIBRARY ─ <STDDEF.H> ................................................................................................... 83

Introduction .......................................................................................................................................... 83

Library Variables ................................................................................................................................... 83

Library Macros ...................................................................................................................................... 83

iii
C Standard Library

12. C LIBRARY ─ <STDIO.H> ..................................................................................................... 87

Introduction .......................................................................................................................................... 87

Library Variables ................................................................................................................................... 87

Library Macros ...................................................................................................................................... 87

Library Functions ................................................................................................................................... 88

13. C LIBRARY ─ <STDLIB.H> .................................................................................................. 167

Introduction ........................................................................................................................................ 167

Library Variables ................................................................................................................................. 167

Library Macros .................................................................................................................................... 167

Library Functions ................................................................................................................................. 168

14. C LIBRARY ─ <STRING.H> ................................................................................................. 205

Introduction ........................................................................................................................................ 205

Library Variables ................................................................................................................................. 205

Library Macros .................................................................................................................................... 205

Library Functions ................................................................................................................................. 205

15. C LIBRARY ─ <TIME.H> ..................................................................................................... 233

Introduction ........................................................................................................................................ 233

Library Variables ................................................................................................................................. 233

Library Macros .................................................................................................................................... 234

Library Functions ................................................................................................................................. 234

iv
C Standard Library
1. C Library ─ <assert.h>

Introduction
The assert.h header file of the C Standard Library provides a macro called assert which
can be used to verify assumptions made by the program and print a diagnostic message
if this assumption is false.

The defined macro assert refers to another macro NDEBUG which is not a part of
<assert.h>. If NDEBUG is defined as a macro name in the source file, at the point where
<assert.h> is included, the assert macro is defined as follows:

#define assert(ignore) ((void)0)

Library Macros
Following is the only function defined in the header assert.h:

S.N. Function & Description

1 void assert(int expression)

This is actually a macro and not a function, which can be used to add
diagnostics in your C program.

void assert(int expression)


Description
The C library macro void assert(int expression) allows diagnostic information to be
written to the standard error file. In other words, it can be used to add diagnostics in
your C program.

Declaration
Following is the declaration for assert() Macro.

void assert(int expression);

Parameters
 expression -- This can be a variable or any C expression.
If expression evaluates to TRUE, assert() does nothing. If expression evaluates
to FALSE, assert() displays an error message on stderr (standard error stream to
display error messages and diagnostics) and aborts program execution.

Return Value
This macro does not return any value.

1
C Standard Library

Example
The following example shows the usage of assert() macro:

#include <assert.h>
#include <stdio.h>

int main()
{
int a;
char str[50];

printf("Enter an integer value: ");


scanf("%d\n", &a);
assert(a >= 10);
printf("Integer entered is %d\n", a);

printf("Enter string: ");


scanf("%s\n", &str);
assert(str != NULL);
printf("String entered is: %s\n", str);

return(0);
}

Let us compile and run the above program in the interactive mode as shown below:

Enter an integer value: 11


Integer entered is 11
Enter string: tutorialspoint
String entered is: tutorialspoint

2
C Standard Library
2. C Library ─ <ctype.h>

Introduction
The ctype.h header file of the C Standard Library declares several functions that are
useful for testing and mapping characters.

All the functions accepts int as a parameter, whose value must be EOF or representable
as an unsigned char.

All the functions return non-zero (true) if the argument c satisfies the condition
described, and zero (false) if not.

Library Functions
Following are the functions defined in the header ctype.h:

S.N. Function & Description

int isalnum(int c)
1
This function checks whether the passed character is alphanumeric.

int isalpha(int c)
2
This function checks whether the passed character is alphabetic.

int iscntrl(int c)
3
This function checks whether the passed character is control character.

int isdigit(int c)
4
This function checks whether the passed character is decimal digit.

int isgraph(int c)
5 This function checks whether the passed character has graphical representation
using locale.

int islower(int c)
6
This function checks whether the passed character is lowercase letter.

int isprint(int c)
7
This function checks whether the passed character is printable.

3
C Standard Library

int ispunct(int c)
8
This function checks whether the passed character is a punctuation character.

int isspace(int c)
9
This function checks whether the passed character is white-space.

int isupper(int c)
10
This function checks whether the passed character is an uppercase letter.

int isxdigit(int c)
11
This function checks whether the passed character is a hexadecimal digit.

int isalnum(int c)
Description
The C library function void isalnum(int c) checks if the passed character is
alphanumeric.

Declaration
Following is the declaration for isalnum() function.

int isalnum(int c);

Parameters
 c -- This is the character to be checked.

Return Value
This function returns non-zero value if c is a digit or a letter, else it returns 0.

Example
The following example shows the usage of isalnum() function.

#include <stdio.h>
#include <ctype.h>

int main()
{
int var1 = 'd';
int var2 = '2';
int var3 = '\t';
int var4 = ' ';

4
C Standard Library

if( isalnum(var1) )
{
printf("var1 = |%c| is alphanumeric\n", var1 );
}
else
{
printf("var1 = |%c| is not alphanumeric\n", var1 );
}
if( isalnum(var2) )
{
printf("var2 = |%c| is alphanumeric\n", var2 );
}
else
{
printf("var2 = |%c| is not alphanumeric\n", var2 );
}
if( isalnum(var3) )
{
printf("var3 = |%c| is alphanumeric\n", var3 );
}
else
{
printf("var3 = |%c| is not alphanumeric\n", var3 );
}
if( isalnum(var4) )
{
printf("var4 = |%c| is alphanumeric\n", var4 );
}
else
{
printf("var4 = |%c| is not alphanumeric\n", var4 );
}

return(0);
}

5
C Standard Library

Let us compile and run the above program to produce the following result:

var1 = |d| is alphanumeric


var2 = |2| is alphanumeric
var3 = | | is not alphanumeric
var4 = | | is not alphanumeric

int isalpha(int c)
Description
The C library function void isalpha(int c) checks if the passed character is alphabetic.

Declaration
Following is the declaration for isalpha() function.

int isalpha(int c);

Parameters
 c -- This is the character to be checked.

Return Value
This function returns non-zero value if c is an alphabet, else it returns 0.

Example
The following example shows the usage of isalpha() function.

#include <stdio.h>
#include <ctype.h>

int main()
{
int var1 = 'd';
int var2 = '2';
int var3 = '\t';
int var4 = ' ';

if( isalpha(var1) )
{
printf("var1 = |%c| is an alphabet\n", var1 );
}
else
{
printf("var1 = |%c| is not an alphabet\n", var1 );
6
C Standard Library

}
if( isalpha(var2) )
{
printf("var2 = |%c| is an alphabet\n", var2 );
}
else
{
printf("var2 = |%c| is not an alphabet\n", var2 );
}
if( isalpha(var3) )
{
printf("var3 = |%c| is an alphabet\n", var3 );
}
else
{
printf("var3 = |%c| is not an alphabet\n", var3 );
}
if( isalpha(var4) )
{
printf("var4 = |%c| is an alphabet\n", var4 );
}
else
{
printf("var4 = |%c| is not an alphabet\n", var4 );
}

return(0);
}

Let us compile and run the above program to produce the following result:

var1 = |d| is an alphabet


var2 = |2| is not an alphabet
var3 = | | is not an alphabet
var4 = | | is not an alphabet

int iscntrl(int c)
Description
7
C Standard Library

The C library function void iscntrl(int c) checks if the passed character is a control
character.

According to standard ASCII character set, control characters are between ASCII codes
0x00 (NUL), 0x1f (US), and 0x7f (DEL). Specific compiler implementations for certain
platforms may define additional control characters in the extended character set (above
0x7f).

Declaration
Following is the declaration for iscntrl() function.

int iscntrl(int c);

Parameters
 c -- This is the character to be checked.

Return Value
This function returns non-zero value if c is a control character, else it returns 0.

Example
The following example shows the usage of iscntrl() function.

#include <stdio.h>
#include <ctype.h>

int main ()
{
int i = 0, j = 0;
char str1[] = "all \a about \t programming";
char str2[] = "tutorials \n point";

/* Prints string till control character \a */


while( !iscntrl(str1[i]) )
{
putchar(str1[i]);
i++;
}

/* Prints string till control character \n */


while( !iscntrl(str2[j]) )
{
putchar(str2[j]);
j++;
}
8
C Standard Library

return(0);
}

Let us compile and run the above program to produce the following result:

all tutorials

int isdigit(int c)
Description
The C library function void isdigit(int c) checks if the passed character is a decimal
digit character.

Decimal digits are (numbers): 0 1 2 3 4 5 6 7 8 9.

Declaration
Following is the declaration for isdigit() function.

int isdigit(int c);

Parameters
 c -- This is the character to be checked.

Return Value
This function returns non-zero value if c is a digit, else it returns 0.

Example
The following example shows the usage of isdigit() function.

#include <stdio.h>
#include <ctype.h>

int main()
{
int var1 = 'h';
int var2 = '2';

if( isdigit(var1) )
{
printf("var1 = |%c| is a digit\n", var1 );
}
else
{
printf("var1 = |%c| is not a digit\n", var1 );

9
C Standard Library

}
if( isdigit(var2) )
{
printf("var2 = |%c| is a digit\n", var2 );
}
else
{
printf("var2 = |%c| is not a digit\n", var2 );
}

return(0);
}

Let us compile and run the above program to produce the following result:

var1 = |h| is not a digit


var2 = |2| is a digit

int isgraph(int c)
Description
The C library function void isgraph(int c) checks if the character has graphical
representation.

The characters with graphical representations are all those characters that can be
printed except for whitespace characters (like ' '), which is not considered as isgraph
characters.

Declaration
Following is the declaration for isgraph() function.

int isgraph(int c);

Parameters
 c -- This is the character to be checked.

Return Value
This function returns non-zero value if c has a graphical representation as character, else
it returns 0.

Example
The following example shows the usage of isgraph() function.

#include <stdio.h>
10
C Standard Library

#include <ctype.h>

int main()
{
int var1 = '3';
int var2 = 'm';
int var3 = ' ';

if( isgraph(var1) )
{
printf("var1 = |%c| can be printed\n", var1 );
}
else
{
printf("var1 = |%c| can't be printed\n", var1 );
}
if( isgraph(var2) )
{
printf("var2 = |%c| can be printed\n", var2 );
}
else
{
printf("var2 = |%c| can't be printed\n", var2 );
}
if( isgraph(var3) )
{
printf("var3 = |%c| can be printed\n", var3 );
}
else
{
printf("var3 = |%c| can't be printed\n", var3 );
}
return(0);
}

Let us compile and run the above program to produce the following result:

var1 = |3| can be printed


var2 = |m| can be printed
11
C Standard Library

var3 = | | can't be printed

int islower(int c)
Description
The C library function int islower(int c) checks whether the passed character is a
lowercase letter.

Declaration
Following is the declaration for islower() function.

int islower(int c);

Parameters
 c -- This is the character to be checked.

Return Value
This function returns a non-zero value(true) if c is a lowercase alphabetic letter else,
zero (false).

Example
The following example shows the usage of islower() function.

#include <stdio.h>
#include <ctype.h>

int main()
{
int var1 = 'Q';
int var2 = 'q';
int var3 = '3';

if( islower(var1) )
{
printf("var1 = |%c| is lowercase character\n", var1 );
}
else
{
printf("var1 = |%c| is not lowercase character\n", var1 );
}
if( islower(var2) )
{

12
C Standard Library

printf("var2 = |%c| is lowercase character\n", var2 );


}
else
{
printf("var2 = |%c| is not lowercase character\n", var2 );
}
if( islower(var3) )
{
printf("var3 = |%c| is lowercase character\n", var3 );
}
else
{
printf("var3 = |%c| is not lowercase character\n", var3 );
}

return(0);
}

Let us compile and run the above program to produce the following result:

var1 = |Q| is not lowercase character


var2 = |q| is lowercase character
var3 = |3| is not lowercase character

int isprint(int c)
Description
The C library function int isprint(int c) checks whether the passed character is
printable. A printable character is a character that is not a control character.

Declaration
Following is the declaration for isprint() function.

int isprint(int c);

Parameters
 c -- This is the character to be checked.

Return Value
This function returns a non-zero value(true) if c is a printable character else, zero
(false).

13
C Standard Library

Example
The following example shows the usage of isprint() function.

#include <stdio.h>
#include <ctype.h>

int main()
{
int var1 = 'k';
int var2 = '8';
int var3 = '\t';
int var4 = ' ';

if( isprint(var1) )
{
printf("var1 = |%c| can be printed\n", var1 );
}
else
{
printf("var1 = |%c| can't be printed\n", var1 );
}
if( isprint(var2) )
{
printf("var2 = |%c| can be printed\n", var2 );
}
else
{
printf("var2 = |%c| can't be printed\n", var2 );
}
if( isprint(var3) )
{
printf("var3 = |%c| can be printed\n", var3 );
}
else
{
printf("var3 = |%c| can't be printed\n", var3 );
}
if( isprint(var4) )

14
C Standard Library

{
printf("var4 = |%c| can be printed\n", var4 );
}
else
{
printf("var4 = |%c| can't be printed\n", var4 );
}

return(0);
}

Let us compile and run the above program to produce the following result:

var1 = |k| can be printed


var2 = |8| can be printed
var3 = | | can't be printed
var4 = | | can be printed

int ispunct(int c)
Description
The C library function int ispunct(int c) checks whether the passed character is a
punctuation character. A punctuation character is any graphic character (as in isgraph)
that is not alphanumeric (as in isalnum).

Declaration
Following is the declaration for ispunct() function.

int ispunct(int c);

Parameters
 c -- This is the character to be checked.

Return Value
This function returns a non-zero value(true) if c is a punctuation character else, zero
(false).

Example
The following example shows the usage of ispunct() function.

15
C Standard Library

#include <stdio.h>
#include <ctype.h>

int main()
{
int var1 = 't';
int var2 = '1';
int var3 = '/';
int var4 = ' ';

if( ispunct(var1) )
{
printf("var1 = |%c| is a punctuation character\n", var1 );
}
else
{
printf("var1 = |%c| is not a punctuation character\n", var1 );
}
if( ispunct(var2) )
{
printf("var2 = |%c| is a punctuation character\n", var2 );
}
else
{
printf("var2 = |%c| is not a punctuation character\n", var2 );
}
if( ispunct(var3) )
{
printf("var3 = |%c| is a punctuation character\n", var3 );
}
else
{
printf("var3 = |%c| is not a punctuation character\n", var3 );
}
if( ispunct(var4) )
{
printf("var4 = |%c| is a punctuation character\n", var4 );
}
16
C Standard Library

else
{
printf("var4 = |%c| is not a punctuation character\n", var4 );
}

return(0);
}

Let us compile and run the above program that will produce the following result:

var1 = |t| is not a punctuation character


var2 = |1| is not a punctuation character
var3 = |/| is a punctuation character
var4 = | | is not a punctuation character

int isspace(int c)
Description
The C library function int isspace(int c) checks whether the passed character is white-
space.

Standard white-space characters are:

' ' (0x20) space (SPC)


'\t' (0x09) horizontal tab (TAB)
'\n' (0x0a) newline (LF)
'\v' (0x0b) vertical tab (VT)
'\f' (0x0c) feed (FF)
'\r' (0x0d) carriage return (CR)

Declaration
Following is the declaration for isspace() function.

int isspace(int c);

Parameters
 c -- This is the character to be checked.

Return Value
This function returns a non-zero value(true) if c is a white-space character else, zero
(false).

17
C Standard Library

Example
The following example shows the usage of isspace() function.

#include <stdio.h>
#include <ctype.h>

int main()
{
int var1 = 't';
int var2 = '1';
int var3 = ' ';

if( isspace(var1) )
{
printf("var1 = |%c| is a white-space character\n", var1 );
}
else
{
printf("var1 = |%c| is not a white-space character\n", var1 );
}
if( isspace(var2) )
{
printf("var2 = |%c| is a white-space character\n", var2 );
}
else
{
printf("var2 = |%c| is not a white-space character\n", var2 );
}
if( isspace(var3) )
{
printf("var3 = |%c| is a white-space character\n", var3 );
}
else
{
printf("var3 = |%c| is not a white-space character\n", var3 );
}

return(0);

18
C Standard Library

Let us compile and run the above program that will produce the following result:

var1 = |t| is not a white-space character


var2 = |1| is not a white-space character
var3 = | | is a white-space character

int isupper(int c)
Description
The C library function int isupper(int c) checks whether the passed character is
uppercase letter.

Declaration
Following is the declaration for isupper() function.

int isupper(int c);

Parameters
 c -- This is the character to be checked.

Return Value
This function returns a non-zero value(true) if c is an uppercase alphabetic letter else,
zero (false).

Example
The following example shows the usage of isupper() function.

#include <stdio.h>
#include <ctype.h>

int main()
{
int var1 = 'M';
int var2 = 'm';
int var3 = '3';

if( isupper(var1) )
{
printf("var1 = |%c| is uppercase character\n", var1 );
}
else

19
C Standard Library

{
printf("var1 = |%c| is not uppercase character\n", var1 );
}
if( isupper(var2) )
{
printf("var2 = |%c| is uppercase character\n", var2 );
}
else
{
printf("var2 = |%c| is not uppercase character\n", var2 );
}
if( isupper(var3) )
{
printf("var3 = |%c| is uppercase character\n", var3 );
}
else
{
printf("var3 = |%c| is not uppercase character\n", var3 );
}

return(0);
}

Let us compile and run the above program that will produce the following result:

var1 = |M| is uppercase character


var2 = |m| is not uppercase character
var3 = |3| is not uppercase character

int isxdigit(int c)
Description
The C library function int isxdigit(int c) checks whether the passed character is a
hexadecimal digit.

Declaration
Following is the declaration for isxdigit() function.

int isxdigit(int c);

Parameters
20
C Standard Library

 c -- This is the character to be checked.

Return Value
This function returns a non-zero value(true) if c is a hexadecimal digit else, zero (false).

Example
The following example shows the usage of isxdigit() function.

#include <stdio.h>
#include <ctype.h>

int main()
{
char var1[] = "tuts";
char var2[] = "0xE";

if( isxdigit(var1[0]) )
{
printf("var1 = |%s| is hexadecimal character\n", var1 );
}
else
{
printf("var1 = |%s| is not hexadecimal character\n", var1 );
}

if( isxdigit(var2[0] ))
{
printf("var2 = |%s| is hexadecimal character\n", var2 );
}
else
{
printf("var2 = |%s| is not hexadecimal character\n", var2 );
}

return(0);
}

Let us compile and run the above program to produce the following result:

var1 = |tuts| is not hexadecimal character


var2 = |0xE| is hexadecimal character

21
C Standard Library

The library also contains two conversion functions that accepts and returns an "int".

S.N. Function & Description

int tolower(int c)
1
This function converts uppercase letters to lowercase.

int toupper(int c)
2
This function converts lowercase letters to uppercase.

int tolower(int c)
Description
The C library function int tolower(int c) converts a given letter to lowercase.

Declaration
Following is the declaration for tolower() function.

int tolower(int c);

Parameters
 c -- This is the letter to be converted to lowercase.

Return Value
This function returns lowercase equivalent to c, if such value exists, else c remains
unchanged. The value is returned as an int value that can be implicitly casted to char.

Example
The following example shows the usage of tolower() function.

#include <stdio.h>
#include <ctype.h>

int main()
{
int i = 0;
char c;
char str[] = "TUTORIALS POINT";

while( str[i] )
{
putchar(tolower(str[i]));

22
C Standard Library

i++;
}

return(0);
}

Let us compile and run the above program to produce the following result:

tutorials point

int toupper(int c)
Description
The C library function int toupper(int c) converts lowercase letter to uppercase.

Declaration
Following is the declaration for toupper() function.

int toupper(int c);

Parameters
 c -- This is the letter to be converted to uppercase.

Return Value
This function returns uppercase equivalent to c, if such value exists, else c remains
unchanged. The value is returned as an int value that can be implicitly casted to char.

Example
The following example shows the usage of toupper() function.

#include <stdio.h>
#include <ctype.h>

int main()
{
int i = 0;
char c;
char str[] = "Tutorials Point";

while(str[i])
{
putchar (toupper(str[i]));
i++;

23
C Standard Library

return(0);
}

Let us compile and run the above program to produce the following result:

TUTORIALS POINT

Character Classes
S.N. Character Class & Description

Digits
1
This is a set of whole numbers { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }.

Hexadecimal digits
2
This is the set of - { 0 1 2 3 4 5 6 7 8 9 A B C D E F a b c d e f }.

Lowercase letters
3 This is a set of lowercase letters { a b c d e f g h i j k l m n o p q r s t u v w x y
z }.

Uppercase letters
4 This is a set of uppercase letters {A B C D E F G H I J K L M N O P Q R S T U V
W X Y Z }.

Letters
5
This is a set of lowercase and uppercase letters.

Alphanumeric characters
6
This is a set of Digits, Lowercase letters and Uppercase letters.

Punctuation characters
7
This is a set of ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~

Graphical characters
8
This is a set of Alphanumeric characters and Punctuation characters.

24
C Standard Library

Space characters
9
This is a set of tab, newline, vertical tab, form feed, carriage return, and space.

Printable characters
10 This is a set of Alphanumeric characters, Punctuation characters and Space
characters.

Control characters
11
In ASCII, these characters have octal codes 000 through 037, and 177 (DEL).

Blank characters
12
These are spaces and tabs.

Alphabetic characters
13
This is a set of Lowercase letters and Uppercase letters.

25
C Standard Library
3. C Library ─ <errno.h>

Introduction
The errno.h header file of the C Standard Library defines the integer variable errno,
which is set by system calls and some library functions in the event of an error to
indicate what went wrong. This macro expands to a modifiable lvalue of type int,
therefore it can be both read and modified by a program.

The errno is set to zero at program startup. Certain functions of the standard C library
modify its value to other than zero to signal some types of error. You can also modify its
value or reset to zero at your convenience.

The errno.h header file also defines a list of macros indicating different error codes,
which will expand to integer constant expressions with type int.

Library Macros
Following are the macros defined in the header errno.h:

S.N. Macro & Description

1 extern int errno

This is the macro set by system calls and some library functions in the event of
an error to indicate what went wrong.

2 EDOM Domain Error

This macro represents a domain error, which occurs if an input argument is


outside the domain, over which the mathematical function is defined and errno
is set to EDOM.

3 ERANGE Range Error

This macro represents a range error, which occurs if an input argument is


outside the range, over which the mathematical function is defined and errno is
set to ERANGE.

extern int errno


Description
The C library macro extern int errno is set by system calls and some library functions in
the event of an error to indicate if anything went wrong.

26
C Standard Library

Declaration
Following is the declaration for errno macro.

extern int errno

Parameters
 NA

Return Value
 NA

Example
The following example shows the usage of errno Macro.

#include <stdio.h>
#include <errno.h>
#include <string.h>

extern int errno ;

int main ()
{
FILE *fp;

fp = fopen("file.txt", "r");
if( fp == NULL )
{
fprintf(stderr, "Value of errno: %d\n", errno);
fprintf(stderr, "Error opening file: %s\n", strerror(errno));
}
else
{
fclose(fp);
}

return(0);
}

27
C Standard Library

Let us compile and run the above program that will produce the following result in case
file file.txt does not exist:

Value of errno: 2
Error opening file: No such file or directory

EDOM Domain Error


Description
As mentioned above, the C library macro EDOM represents a domain error, which occurs
if an input argument is outside the domain, over which the mathematical function is
defined and errno is set to EDOM.

Declaration
Following is the declaration for EDOM Macro.

#define EDOM some_value

Parameters
 NA

Return Value
 NA

Example
The following example shows the usage of EDOM Macro.

#include <stdio.h>
#include <errno.h>
#include <math.h>

int main()
{
double val;

errno = 0;
val = sqrt(-10);
if(errno == EDOM)
{
printf("Invalid value \n");
}
else
{

28
C Standard Library

printf("Valid value\n");
}

errno = 0;
val = sqrt(10);
if(errno == EDOM)
{
printf("Invalid value\n");
}
else
{
printf("Valid value\n");
}

return(0);
}

Let us compile and run the above program that will produce the following result:

Invalid value
Valid value

ERANGE Range Error


Description
As mentioned above, the C library macro ERANGE represents a range error, which
occurs if an input argument is outside the range, over which the mathematical function
is defined and errno is set to ERANGE.

Declaration
Following is the declaration for ERANGE Macro.

#define ERANGE some_value

Parameters
 NA

Return Value
 NA

29
C Standard Library

Example
The following example shows the usage of ERANGE Macro.

#include <stdio.h>
#include <errno.h>
#include <math.h>

int main()
{
double x;
double value;

x = 1.000000;
value = log(x);
if( errno == ERANGE )
{
printf("Log(%f) is out of range\n", x);
}
else
{
printf("Log(%f) = %f\n", x, value);
}
x = 0.000000;
value = log(x);
if( errno == ERANGE )
{
printf("Log(%f) is out of range\n" x);
}
else
{
printf("Log(%f) = %f\n", x, value);
}
return 0;
}

Let us compile and run the above program that will produce the following result:

Log(1.000000) = 1.609438
Log(0.000000) is out of range

30
C Standard Library
4. C Library ─ <float.h>

Introduction
The float.h header file of the C Standard Library contains a set of various platform-
dependent constants related to floating point values. These constants are proposed by
ANSI C. They allow making more portable programs. Before checking all the constants, it
is good to understand that floating-point number is composed of following four
elements:

Component Component Description

S sign ( +/- )

base or radix of the exponent representation, 2 for binary, 10 for


b
decimal, 16 for hexadecimal, and so on...

e exponent, an integer between a minimum emin and a maximum emax.

p precision, the number of base-b digits in the significand

Based on the above 4 components, a floating point will have its value as follows:

floating-point = ( S ) p x be

or

floating-point = (+/-) precision x baseexponent

Library Macros
The following values are implementation-specific and defined with the #define directive,
but these values may not be any lower than what is given here. Note that in all instances
FLT refers to type float, DBL refers to double, and LDBL refers to long double.

Macro Description

Defines the rounding mode for floating point addition and it


can have any of the following values:
FLT_ROUNDS
-1 - indeterminable

0 - towards zero

31
C Standard Library

1 - to nearest

2 - towards positive infinity

3 - towards negative infinity

This defines the base radix representation of the exponent.


FLT_RADIX 2 A base-2 is binary, base-10 is the normal decimal
representation, base-16 is Hex.

FLT_MANT_DIG
These macros define the number of digits in the number (in
DBL_MANT_DIG
the FLT_RADIX base).
LDBL_MANT_DIG

FLT_DIG 6
These macros define the maximum number decimal digits
DBL_DIG 10 (base-10) that can be represented without change after
rounding.
LDBL_DIG 10

FLT_MIN_EXP
These macros define the minimum negative integer value
DBL_MIN_EXP
for an exponent in base FLT_RADIX.
LDBL_MIN_EXP

FLT_MIN_10_EXP -37
These macros define the minimum negative integer value
DBL_MIN_10_EXP -37
for an exponent in base 10.
LDBL_MIN_10_EXP -37

FLT_MAX_EXP
These macros define the maximum integer value for an
DBL_MAX_EXP
exponent in base FLT_RADIX.
LDBL_MAX_EXP

FLT_MAX_10_EXP +37
These macros define the maximum integer value for an
DBL_MAX_10_EXP +37
exponent in base 10.
LDBL_MAX_10_EXP +37

FLT_MAX 1E+37
These macros define the maximum finite floating-point
DBL_MAX 1E+37
value.
LDBL_MAX 1E+37

FLT_EPSILON 1E-5 These macros define the least significant digit

32
C Standard Library

DBL_EPSILON 1E-9 representable.

LDBL_EPSILON 1E-9

FLT_MIN 1E-37

DBL_MIN 1E-37 These macros define the minimum floating-point values.

LDBL_MIN 1E-37

Example
The following example shows the usage of few of the constants defined in float.h file.

#include <stdio.h>
#include <float.h>

int main()
{
printf("The maximum value of float = %.10e\n", FLT_MAX);
printf("The minimum value of float = %.10e\n", FLT_MIN);

printf("The number of digits in the number = %.10e\n", FLT_MANT_DIG);


}

Let us compile and run the above program that will produce the following result:

The maximum value of float = 3.4028234664e+38


The minimum value of float = 1.1754943508e-38
The number of digits in the number = 7.2996655210e-312

33
C Standard Library
5. C Library ─ <limits.h>

Introduction
The limits.h header determines various properties of the various variable types. The
macros defined in this header, limits the values of various variable types like char, int
and long.

These limits specify that a variable cannot store any value beyond these limits, for
example an unsigned character can store up to a maximum value of 255.

Library Macros
The following values are implementation-specific and defined with the #define directive,
but these values may not be any lower than what is given here.

Macro Value Description

CHAR_BIT 8 Defines the number of bits in a byte.

Defines the minimum value for a signed


SCHAR_MIN -128
char.

Defines the maximum value for a signed


SCHAR_MAX 127
char.

Defines the maximum value for an


UCHAR_MAX 255
unsigned char.

Defines the minimum value for type char


and its value will be equal to SCHAR_MIN
CHAR_MIN 0
if char represents negative values,
otherwise zero.

Defines the value for type char and its


value will be equal to SCHAR_MAX if char
CHAR_MAX 127
represents negative values, otherwise
UCHAR_MAX.

Defines the maximum number of bytes in


MB_LEN_MAX 1
a multi-byte character.

SHRT_MIN -32768 Defines the minimum value for a short int.

34
C Standard Library

Defines the maximum value for a short


SHRT_MAX +32767
int.

Defines the maximum value for an


USHRT_MAX 65535
unsigned short int.

INT_MIN -32768 Defines the minimum value for an int.

INT_MAX +32767 Defines the maximum value for an int.

Defines the maximum value for an


UINT_MAX 65535
unsigned int.

LONG_MIN -2147483648 Defines the minimum value for a long int.

LONG_MAX +2147483647 Defines the maximum value for a long int.

Defines the maximum value for an


ULONG_MAX 4294967295
unsigned long int.

Example
The following example shows the usage of few of the constants defined in limit.h file.

#include <stdio.h>
#include <limits.h>

int main()
{

printf("The number of bits in a byte %d\n", CHAR_BIT);

printf("The minimum value of SIGNED CHAR = %d\n", SCHAR_MIN);


printf("The maximum value of SIGNED CHAR = %d\n", SCHAR_MAX);
printf("The maximum value of UNSIGNED CHAR = %d\n", UCHAR_MAX);

printf("The minimum value of SHORT INT = %d\n", SHRT_MIN);


printf("The maximum value of SHORT INT = %d\n", SHRT_MAX);

printf("The minimum value of INT = %d\n", INT_MIN);


printf("The maximum value of INT = %d\n", INT_MAX);

35
C Standard Library

printf("The minimum value of CHAR = %d\n", CHAR_MIN);


printf("The maximum value of CHAR = %d\n", CHAR_MAX);

printf("The minimum value of LONG = %ld\n", LONG_MIN);


printf("The maximum value of LONG = %ld\n", LONG_MAX);

return(0);
}

Let us compile and run the above program that will produce the following result:

The number of bits in a byte 8


The minimum value of SIGNED CHAR = -128
The maximum value of SIGNED CHAR = 127
The maximum value of UNSIGNED CHAR = 255
The minimum value of SHORT INT = -32768
The maximum value of SHORT INT = 32767
The minimum value of INT = -32768
The maximum value of INT = 32767
The minimum value of CHAR = -128
The maximum value of CHAR = 127
The minimum value of LONG = -2147483648
The maximum value of LONG = 2147483647

36
C Standard Library
6. C Library ─ <locale.h>

Introduction
The locale.h header defines the location specific settings, such as date formats and
currency symbols. You will find several macros defined along with an important
structure struct lconv and two important functions listed below.

Library Macros
Following are the macros defined in the header and these macros will be used in two
functions listed below:

S.N. Macro & Description

LC_ALL
1
Sets everything.

LC_COLLATE
2
Affects strcoll and strxfrm functions.

LC_CTYPE
3
Affects all character functions.

LC_MONETARY
4
Affects the monetary information provided by localeconv function.

LC_NUMERIC
5 Affects decimal-point formatting and the information provided by localeconv
function.

LC_TIME
6
Affects the strftime function.

37
C Standard Library

Library Functions
Following are the functions defined in the header locale.h:

S.N. Function & Description

char *setlocale(int category, const char *locale)


1
Sets or reads location dependent information.

struct lconv *localeconv(void)


2
Sets or reads location dependent information.

char *setlocale(int category, const char *locale)


Description
The C library function char *setlocale(int category, const char *locale) sets or
reads location dependent information.

Declaration
Following is the declaration for setlocale() function.

char *setlocale(int category, const char *locale)

Parameters
 category -- This is a named constant specifying the category of the functions
affected by the locale setting.

o LC_ALL for all of the below.

o LC_COLLATE for string comparison. See strcoll().

o LC_CTYPE for character classification and conversion. For example:


strtoupper().
o LC_MONETARY for monetary formatting for localeconv().

o LC_NUMERIC for decimal separator for localeconv().

o LC_TIME for date and time formatting with strftime().

o LC_MESSAGES for system responses.

 locale -- If locale is NULL or the empty string "", the locale names will be set
from the values of environment variables with the same names as the above
categories.

Return Value
A successful call to setlocale() returns an opaque string that corresponds to the locale
set. The return value is NULL if the request cannot be honored.

38
C Standard Library

Example
The following example shows the usage of setlocale() function.

#include <locale.h>
#include <stdio.h>
#include <time.h>

int main ()
{
time_t currtime;
struct tm *timer;
char buffer[80];

time( &currtime );
timer = localtime( &currtime );

printf("Locale is: %s\n", setlocale(LC_ALL, "en_GB"));


strftime(buffer,80,"%c", timer );
printf("Date is: %s\n", buffer);

printf("Locale is: %s\n", setlocale(LC_ALL, "de_DE"));


strftime(buffer,80,"%c", timer );
printf("Date is: %s\n", buffer);

return(0);
}

Let us compile and run the above program that will produce the following result:

Locale is: en_GB


Date is: Thu 23 Aug 2012 06:39:32 MST
Locale is: de_DE
Date is: Do 23 Aug 2012 06:39:32 MST

39
C Standard Library

struct lconv *localeconv(void)


Description
The C library function struct lconv *localeconv(void) sets or reads location dependent
information. These are returned in an object of the lconv structure type.

Declaration
Following is the declaration for localeconv() function.

struct lconv *localeconv(void)

Parameters
 NA

Return Value
This function returns a pointer to a struct lconv for the current locale, which has the
following structure:

typedef struct {
char *decimal_point;
char *thousands_sep;
char *grouping;
char *int_curr_symbol;
char *currency_symbol;
char *mon_decimal_point;
char *mon_thousands_sep;
char *mon_grouping;
char *positive_sign;
char *negative_sign;
char int_frac_digits;
char frac_digits;
char p_cs_precedes;
char p_sep_by_space;
char n_cs_precedes;
char n_sep_by_space;
char p_sign_posn;
char n_sign_posn;
} lconv

40
C Standard Library

Example
The following example shows the usage of localeconv() function.

#include <locale.h>
#include <stdio.h>

int main ()
{
struct lconv * lc;

setlocale(LC_MONETARY, "it_IT");
lc = localeconv();
printf("Local Currency Symbol: %s\n",lc->currency_symbol);
printf("International Currency Symbol: %s\n",lc->int_curr_symbol);

setlocale(LC_MONETARY, "en_US");
lc = localeconv();
printf("Local Currency Symbol: %s\n",lc->currency_symbol);
printf("International Currency Symbol: %s\n",lc->int_curr_symbol);

setlocale(LC_MONETARY, "en_GB");
lc = localeconv();
printf ("Local Currency Symbol: %s\n",lc->currency_symbol);
printf ("International Currency Symbol: %s\n",lc->int_curr_symbol);
printf("Decimal Point = %s\n", lc->decimal_point);

return 0;
}

Let us compile and run the above program that will produce the following result:

Local Currency Symbol: EUR


International Currency Symbol: EUR
Local Currency Symbol: $
International Currency Symbol: USD
Local Currency Symbol: £
International Currency Symbol: GBP
Decimal Point = .

41
C Standard Library

Library Structure
typedef struct {
char *decimal_point;
char *thousands_sep;
char *grouping;
char *int_curr_symbol;
char *currency_symbol;
char *mon_decimal_point;
char *mon_thousands_sep;
char *mon_grouping;
char *positive_sign;
char *negative_sign;
char int_frac_digits;
char frac_digits;
char p_cs_precedes;
char p_sep_by_space;
char n_cs_precedes;
char n_sep_by_space;
char p_sign_posn;
char n_sign_posn;
} lconv

Following is the description of each of the fields:

S.N. Field & Description

decimal_point
1
Decimal point character used for non-monetary values.

thousands_sep
2
Thousands place separator character used for non-monetary values.

grouping

A string that indicates the size of each group of digits in non-monetary


3 quantities. Each character represents an integer value, which designates the
number of digits in the current group. A value of 0 means that the previous
value is to be used for the rest of the groups.

4 int_curr_symbol

42
C Standard Library

It is a string of the international currency symbols used. The first three


characters are those specified by ISO 4217:1987 and the fourth is the
character, which separates the currency symbol from the monetary quantity.

currency_symbol
5
The local symbol used for currency.

mon_decimal_point
6
The decimal point character used for monetary values.

mon_thousands_sep
7
The thousands place grouping character used for monetary values.

mon_grouping

A string whose elements defines the size of the grouping of digits in monetary
8 values. Each character represents an integer value which designates the
number of digits in the current group. A value of 0 means that the previous
value is to be used for the rest of the groups.

positive_sign
9
The character used for positive monetary values.

negative_sign
10
The character used for negative monetary values.

int_frac_digits
11 Number of digits to show after the decimal point in international monetary
values.

frac_digits
12
Number of digits to show after the decimal point in monetary values.

p_cs_precedes

13 If equals to 1, then the currency_symbol appears before a positive monetary


value. If equals to 0, then the currency_symbol appears after a positive
monetary value.

p_sep_by_space
14
If equals to 1, then the currency_symbol is separated by a space from a
positive monetary value. If equals to 0, then there is no space between the

43
C Standard Library

currency_symbol and a positive monetary value.

n_cs_precedes

15 If equals to 1, then the currency_symbol precedes a negative monetary


value. If equals to 0, then the currency_symbol succeeds a negative
monetary value.

n_sep_by_space

16 If equals to 1, then the currency_symbol is separated by a space from a


negative monetary value. If equals to 0, then there is no space between the
currency_symbol and a negative monetary value.

p_sign_posn
17
Represents the position of the positive_sign in a positive monetary value.

n_sign_posn
18
Represents the position of the negative_sign in a negative monetary value.

The following values are used for p_sign_posn and n_sign_posn:

Value Description

0 Parentheses encapsulates the value and the currency_symbol.

1 The sign precedes the value and currency_symbol.

2 The sign succeeds the value and currency_symbol.

3 The sign immediately precedes the value and currency_symbol.

4 The sign immediately succeeds the value and currency_symbol.

44
C Standard Library
7. C Library ─ <math.h>

Introduction
The math.h header defines various mathematical functions and one macro. All the
functions available in this library take double as an argument and return double as the
result.

Library Macros
There is only one macro defined in this library:

S.N. Macro & Description

HUGE_VAL

This macro is used when the result of a function may not be representable as
a floating point number. If magnitude of the correct result is too large to be
represented, the function sets errno to ERANGE to indicate a range error, and
1
returns a particular, very large value named by the macro HUGE_VAL or its
negation (- HUGE_VAL).

If the magnitude of the result is too small, a value of zero is returned instead.
In this case, errno might or might not be set to ERANGE.

Library Functions
Following are the functions defined in the header math.h:

S.N. Function & Description

double acos(double x)
1
Returns the arc cosine of x in radians.

double asin(double x)
2
Returns the arc sine of x in radians.

double atan(double x)
3
Returns the arc tangent of x in radians.

double atan2(doubly y, double x)


4
Returns the arc tangent in radians of y/x based on the signs of both values to

45
Discovering Diverse Content Through
Random Scribd Documents
Eroismo di Stamura 207
Un vecchio impedisce agli
Anconitani d'arrendersi 209
Gli Anconitani mandano a
domandar soccorsi in Romagna 211
Generosità d'una dama d'Ancona 212
Un'armata romagnola ne fa
levare l'assedio 213
Federico rientra in Italia in
ottobre 215
Forza Asti a sottomettersi ivi
Intraprende l'assedio
d'Alessandria 216
Lo continua per quattro mesi
d'inverno 217
1176 La dieta de' Lombardi a Modena
leva un'armata per soccorrere
Alessandria 218
Federico, durante una tregua,
tenta sorprenderla 219
Leva l'assedio e marcia verso
Pavia ivi
L'incontrano i Lombardi e per
rispetto non lo attaccano 220
Conferenza per la pace e
sospensione d'armi 221
L'imperatore eccita sospetti nella
lega 222
1175 I legati del papa vanno a Pavia
da Federico 223
Romponsi i trattati e ricomincia la
guerra 225
Cristiano attacca i Bolognesi ivi
1176 Federico riceve il soccorso di una
nuova armata 226
Preparativi de' Milanesi per
difendersi 227
Vittoria de' Milanesi a Legnano 228
Federico abbandonato cerca di
far pace 231
Manda ambasciatori a chiederla
ad Alessandro III ivi
Il papa promette di venire al
congresso lombardo 232
L'imperatore trova partigiani tra i
Lombardi ivi
Cremona e Tortona segnano la
pace 233
1177 Il papa e gli ambasciatori di
Napoli arrivano a Venezia 235
Discussioni intorno al luogo delle
conferenze 236
Si sceglie Venezia 237
Pretensioni delle città 238
Pretensioni dell'imperatore 239
Condotta ambigua del papa 242
Propone una tregua di più anni ivi
La tregua vien segnata il 6 luglio ivi
Federico ricevuto in Venezia, e
riconciliato col papa 245
1178 Il papa tornato a Roma si
riconcilia col senato 246
1178-1183 Trattati per una pace definitiva 247
1183 Defezione di Tortona e di
Alessandria 248
Dieta a Costanza per trattare la
pace 250
Trattato di Costanza il 25 giugno
1183 251

Capitolo XII. Ultimi anni di Federico


Barbarossa. — Enrico VI suo figlio riunisce
all'impero il regno delle due Sicilie. — Torbidi
eccitati nelle repubbliche italiane dalla nobiltà.
— 1183-1200. 255

Le dissensioni civili compresse in


tempo di guerra si rinnovano
dopo la pace nelle città libere ivi
1183 I Milanesi cambiano la
costituzione 258
Prime gelosie tra i nobili ed il
popolo 260
Costituzione di Bologna 261
Nuove leggi nelle altre
repubbliche 263
1183-1197 Rapida successione de' sovrani in
quindici secoli 264
1184 Ritorno pacifico di Federico in
Italia 267
Fa sposare l'erede dei re di Sicilia
ad Enrico 268
Decadimento del regno delle Due
Sicilie 270
Federico per averlo mantiene la
pace in Italia 272
1187 Gerusalemme presa da Saladino
il 2 ottobre 274
1187 Terza crociata 275
Gl'Italiani vi s'impegnano con
calore 276
1188 Pace de' Cristiani per far guerra a
gl'infedeli ivi
1189 Federico prende la croce 278
1190 S'annega nel fiume Salef in
Armenia 279
Enrico VI paragonato a suo
padre 280
1189 Guglielmo II muore a Palermo 281
1190 Tancredi, figlio naturale di
Ruggero, gli succede ivi
Enrico VI cerca ajuto dai
Genovesi e dai Pisani per
conquistare la Sicilia 282
È forzato a fuggire, e sua moglie
è fatta prigioniera 283
1194 Morte di Tancredi e di suo figlio 284
Gli succede Enrico VI e si rende
odioso ai popoli ivi
1197 Muore improvvisamente l'otto
settembre 285
Gli succede Federico II di
quattr'anni ivi
1191 Guerra tra Brescia e Cremona 286
Vittoria de' Bresciani sui
Cremonesi 288
1198-1199 Guerra tra Parma e Piacenza 289
Potenza dei Gentiluomini della
Venezia 290
Fortezze nell'interno delle città 292
Discordia tra i gentiluomini 293
Potere dei podestà nelle città 294
L'elezione dei podestà divisa
spesso tra due famiglie rivali 295
Casa da Romano nella Marca
Trivigiana 297
Inimicizia d'Ezelino e di Tisolino 298
1194 Ezzelino II in guerra con Vicenza 299
Nascita d'Ezzelino III 300
1197 Seconda guerra d'Ezzelino II con
Vicenza 301
1198 Si riconcilia con Vicenza e si
disgusta con Padova 302
Antico patrimonio dei marchesi
d'Este 303
Obizzo d'Este sposa la figlia
d'Adelaide di Ferrara 305
1180-1220 Guerre civili a Ferrara 306
Le repubbliche transpadane
sottomettono i nobili 307
1192-1193 Gerardo Scannabecchi, pretore di
Bologna 308
1200 Guerra civile a Brescia tra i nobili
ed il popolo 310

Capitolo XIII. Pontificato d'Innocenzo III. —


Stabilimento del potere temporale della
Chiesa. — Abbassamento del partito
ghibellino. — 1197-1216. 313

Preponderanza del partito


imperiale sotto Enrico VI 315
1197 Innocenzo III eletto papa di 37
anni 316
Rivalità fra due contendenti al
trono imperiale 318
1192 Il senatore in Roma sostituito al
senato 320
1197 Innocenzo III ne limita l'autorità 321
1207 Attribuzioni del senatore fissate
nel 1207 322
1197 Innocenzo III ordina ai suoi
cardinali di togliere ai generali
d'Enrico VI le province loro
infeudate 324
Tutte le città dichiaransi per il
papa 325
Lega Guelfa di Toscana sotto la
protezione del papa 326
Costituzione di questa lega 327
Fedeltà all'impero della
repubblica di Pisa 329
Innocenzo III reclama la tutela di
Federico II 331
1198 Fa la guerra al generale
Marcovaldo 332
Debolezza del papa in Sicilia, sua
potenza altrove 333
Gualtieri, conte di Brienna,
reclama la sua eredità 335
1205 Gualtieri ucciso in una battaglia
coi Tedeschi 336
1206 Ottone IV battuto da Filippo. Il
papa tratta con questo 337
1208 Assassinio di Filippo. Enrico IV
riconosciuto imperatore 338
1209 Viene in Italia a prendere la
corona imperiale 339
Vuole riconciliare i nobili della
Marca Trivigiana 341
Ezzelino II sfida Azzo VI d'Este;
lo stesso fa Salinguerra 343
Riconciliazione di questi
gentiluomini 344
Ottone IV coronato a Roma 346
Si avvicina ai capi del partito
ghibellino ivi
Innocenzo III gli oppone
Federico II 348
1210 Ottone muove guerra a Federico,
ed invade il regno 349
1212 Viene chiamato in Allemagna da'
nuovi torbidi 350
Federico II va a Genova per
passare in Allemagna 351
Viene secondato dalle città
ghibelline 352
Attraversa la Lombardia ed i
Grigioni 352
1214 Ottone IV disfatto a Bouvines da
Filippo Augusto 353
1215 Prime dissensioni di Firenze 357
Governo di questa città fino al
1207 ivi
Bondelmonti offende le famiglie
ghibelline 358
Bondelmonti ucciso presso alla
statua di Marte 359
Tutta la nobiltà divisa tra i
Bondelmonti ed Uberti ivi
1215-1248 La guerra si continua in Fiorenza 360
Successi delle intraprese
d'Innocenzo III 361
Sua smisurata ambizione,
ingiustizia ed orgoglio 363
Fonda l'inquisizione. Crociata
contro gli Albigesi 365
Dottrina de' Pauliciani ed Albigesi 366
Moltiplicazione de' Pauliciani e
Paterini nelle città d'Italia 369
Ardore del papa nel perseguitarli 370
Chiama in suo ajuto san
Francesco e san Domenico 371
1203 San Domenico comincia a
predicare contro gli eretici 372
1206-1211 Crociata contro gli Albigesi. Sue
crudeltà 373
Costanza di san Domenico
arrestato dagli Albigesi 375
1214 Quarto concilio ecumenico di
Laterano 376
1216 Morte d'Innocenzo III a Perugia 377

Capitolo XIV. Digressione sulla quarta crociata.


— Conquiste delle repubbliche italiane in
Oriente. — 1198-1207. 379
La conquista di Costantinopoli è
opera dei Veneziani e dei
Francesi 380
L'impero greco snervato dal
despotismo 381
Tutti i suoi vantaggi resi nulli dal
despotismo 384
Impotenza e sterilità de' Greci
per dieci secoli 387
Colonie de' Latini a
Costantinopoli 388
1152-1201 Contese de' Veneziani coi Greci 389
Alessio Angelo imperatore
d'Oriente 391
1198 Quarta crociata predicata da
Folco di Neuilly 392
1201 I crociati domandano vascelli a
Venezia ivi
I deputati dell'alta nobiltà di
Francia mandano deputati a
Venezia 393
1202 I crociati fuor di stato di
mantener la promessa ai
Veneziani 397
Il doge Dandolo propone per
prezzo de' vascelli di ajutarlo
nella presa di Zara 398
Prende anch'egli la croce per
marciare coi crociati 399
Il figlio d'Isacco Angelo implora il
soccorso de' crociati 401
Prendono Zara 403
Il papa rimprovera ai crociati la
presa di Zara ivi
1203 I crociati promettono protezione
al principe greco 405
I legati del papa, e più baroni si
separano dalla crociata 407
I crociati arrivano innanzi a
Costantinopoli 410
Descrizione della città e porto 411
Dopo essersi riposati a Scutari
attraversano il golfo 412
Viltà de' Greci che fuggono
innanzi ai crociati 413
Galata presa dai Latini, ed il
porto aperto ai Veneziani ivi
I crociati s'accampano al palazzo
di Blancherna 415
Primo assalto di Costantinopoli il
17 luglio 416
Andrea Dandolo padrone del
Muro, fermato da un incendio 417
Rinuncia al suo vantaggio per
soccorrere i Francesi 419
Alessio Angelo fugge la seguente
notte co' suoi tesori 420
Il deposto Isacco Angelo viene
tolto di prigione e rimesso sul
trono 421
Promette ai crociati di mantener
le promesse di suo figlio ivi
I crociati stabiliti ne' sobborghi di
Pera e Galata 422
La rapacità de' Latini eccita l'odio
de' Greci 423
Il giovane Alessio cerca di
tenerseli amici 425
Lagnanze de' Latini pei ritardati
sussidj ivi
Mandano a sfidare l'imperatore 426
Si ricomincia la guerra e si fa
debolmente 427
1204 Il 25 gennajo. Rivolta dei Greci 429
Alessio duca proclamato
imperatore 430
Suoi vani sforzi per destare il
coraggio dei Greci 431
I crociati ricominciano l'assedio di
Costantinopoli 432
Sono respinti dalla parte del
porto 433
Il 12 aprile s'impadroniscono
delle mura 434
Alessio duca fugge 436
I Latini mettono il fuoco alla città
che s'arrende ivi
Convenzione dei Latini per
dividere la conquista 437
Saccheggio di Costantinopoli 438
Oppressione e patimenti dei
Greci 439
Il popolaccio insulta i senatori
fuggitivi 440
Baldovino di Fiandra eletto
imperatore 443
Divisioni delle province tra
Francesi e Veneziani 444
L'isola di Candia è ceduta ai
Veneziani 446
I Veneziani rendono diviso in
tanti feudi il territorio ai loro
cittadini 447
Tentativi dei Genovesi per
partecipare allo spoglio dei Greci 448
La conquista della Grecia più
nociva che utile ai Veneziani 449

Capitolo XV. Stato delle repubbliche italiane ne'


primi tempi del regno di Federico II. — Guerre
civili. — Rinnovamento della lega lombarda. —
1216-1234. 453

Guerre causate dalla rivalità di


Federico II e di Ottone ivi
Non possono darsi circostanziate
notizie delle guerre di
quest'epoca 454
1216 Odio ereditario dei Milanesi verso
la casa di Hohenstauffen 456
Rimangono costantemente
attaccati al partito d'Ottone 457
1217 Loro alleanza con Tomaso di
Savoja e con molte città
lombarde 458
Pavia ed Asti forzate di seguire le
loro parti 459
I Cremonesi li battono il 6 giugno
a Ghibello ivi
1218 Gelosie eccitate dai gentiluomini
nelle città lombarde 460
Occupano esclusivamente la
carica di podestà 461
1221 I nobili esiliati da Milano e da
Piacenza 462
Confronto delle guerre dell'età di
mezzo con quelle de' nostri giorni 464
Aumento di popolazione e di
ricchezze malgrado le frequenti
guerre 466
Potenza di Bologna 468
1080-1100 Cominciamento dell'università di
Bologna 469
Alcune altre università rivali 470
Guerre dei Bolognesi coi loro
vicini 472
1222 Forzano gli abitanti d'Imola a
ceder loro le porte della città ivi
1218 Ottone IV muore il 19 maggio.
Federico II fa prova
dell'ingratitudine del papa 474
Carattere di Federico II ivi
1220 Il 22 novembre. Riceve da
Onorio III la corona imperiale 475
1222 Costringe ad ubbidirgli i grandi
signori della Puglia 476
1223 Trasporta a Lucera i Saraceni di
Sicilia 478
1224 Fabbrica fortezze nelle principali
sue città ivi
Fonda l'università di Napoli 479
1226 Sposa Yolante di Lusignano
erede del regno di Gerusalemme 480
1227 Si dispone a partire crociato, e
n'è impedito da una malattia 481
Il 29 settembre viene dal papa
scomunicato, per non essere
partito all'epoca che avea fissata 482
Federico riclama contro questa
scomunica 483
1228 Passa in Terra santa ove lo
seguono le scomuniche papali 484
1229 Ottiene dal Sultano d'Egitto una
pace vantaggiosa e la
restituzione di Gerusalemme 486
Torna in Italia e disperde le
crociate armate dal papa contro
di lui 488
1226 2 marzo. La lega lombarda
rinnovata contro l'imperatore 489
Il papa la prende sotto la sua
protezione ivi
1230 La fa comprendere in un trattato
di pace coll'imperatore 491
1238 Persecuzioni contro i Paterini in
Lombardia 494
Carattere de' persecutori;
mescolanza di religione e di
ferocia 495
Predicazione di tre celebri
domenicani 498
Predicazione della pace 499
Frate Giovanni, di Vicenza,
predicatore della pace 500
1233 18 agosto. Assemblea di Paquara
in cui fra Giovanni predica la
pace a dodici popoli adunati per
udirlo 503
Autorità di cui si fa investire in
Vicenza ed in Verona 505
Potere dell'eloquenza de' Monaci 507
Predicano in latino al popolo 509
1212-1233 Cominciamento della poesia
italiana in Sicilia 510
La lingua provenzale allora
coltivata in Lombardia 512
Trovatori italiani che scrivono in
provenzale 514
Sordello mantovano di tutti il più
celebre ivi

Fine della Tavola.


NOTE:

1. Campi, Istoria di Cremona l. I, p. 17. — Ludov. Cavitelli Cremon. Annales


apud Grævium t. III, p. 1293.
2. Galvan. Fiamma Manip. Florum c. 159. Rer. Ital. t. XI. p. 628.
3. Johan. Bap. Villanove Laudis Pomp. Hist. ap. Craevium t. III, l. I, p. 856. —
Landulphi Junior. Hist. Mediol. c. 16, p. 486.
4. Galvan. Flam. Manipulus Florum c. 163. t. XI. R. It. p. 629. — Trist. Calchi
Hist. Patriæ l. VII, p. 208.
5. Cumanus, seu de Bello comensi anonimum Poema ap. Scr. Rer. Ital t. V. p.
399. Cum notis Jo. Mariæ Stampæ.
6.

Testantur montes, testatur, et hoc Baradellus.


Troja suis ducibus defenditur; Hector in illis
Affuit, Æneas, nec non Paris, Hectoris omnes
Pugnabant fratres, pugnat fortissimus Adam
Deque Piro dictus, duros deverberat hostes,
Hortatur socios, in pugna recreat omnes.
Cuman. V. 38. p. 414.

7. Guido Grimoldi di Galavesca. Gli storici milanesi risguardano come una cosa
vergognosa per la loro patria l'avere sostenuto lo scisma, onde o non ne
fanno parola, o cercano di darne colpa ai Comaschi loro nemici; e per tal
modo resero oscura assai questa parte del loro racconto: ma ciò che non è
dubbioso, si è che Landolfo Carcano, difeso dai Milanesi, era un vescovo
scismatico eletto da Enrico V (Scheda Antiqu. ap. Jos. Mariam Stampam
præfatio ad Cumanum p. 407.); e che il poeta comasco dà ad Anselmo da
Clivio, uno degli arcivescovi di Milano, l'aggiunto di male pactus, che pare
corrispondere al vocabolo di simoniaco. Veggasi Cumanus v. 686, p. 428.; la
prefazione premessa al Poema dal Muratori p. 402, e Landolfo di s. Paolo c.
37, t. V, p. 507.
8. Landulph. Junior Hist. Mediol. c. 34, p. 504. Notæ Saxii ad eundem. —
Trist. Calcus Hist. pat. l. VII, p. 210.
9. Cum. v. 63.-114, p. 415. — Trist. Cal. Hist. Patriæ l. VII, p. 211. — Bern.
Corio Stor. Mil. p. I, p. 28.
10. Quest'isoletta, a sedici miglia al nord di Como, e cinquanta passi
solamente lontana dalla spiaggia, può avere un miglio di circuito. Ebbe un
castello assai forte fabbricato dai Lombardi.
11. Cumano v. 200.-215. Malgrado la positiva testimonianza del poeta
comasco, seguito poi da tutti gli storici lombardi, io dubito tuttavia di questa
lega fra tante città, che non avevano verun motivo di nimicizia verso i
Comaschi, ed erano anzi fra di loro rivali. Forse eransi soltanto arrolati
all'armata milanese pochi volontarj di quelle città; forse il poeta ne accrebbe il
numero per render più gloriosa la lunga resistenza e la caduta della sua
patria.
12. Piano di Como presso Alessandro Ducker. Grævius t. III, p. 1199.
13. Cumanus v. 263. Trovansene altri esempi ne' successivi anni v. 271 e 313.
14. Cum. V. 1834 e segu. p. 452. — Veggasi la nota a p. 15.
15. Lecco è posto all'estremità del Golfo a Levante, dove le acque del lago
tornano a formare l'Adda.
16. Cum. v. 1815, e segu. p. 452.
17. Cumanus v. 1900, e segu. p. 454.
18. Cum. v. 1953 p. 455.
19. Id. v. 1974 ad finem p. 455.
20. Otto Frising. de Gest. Friderici I lib. II c. 2. Rer. Ital. t. VI pag. 699. —
Mascovius Commen. de Reb. Imp. sub Conrado III lib. III p. 141.
21. Chron. Weingartense de Guelfis ap. Leibn. t. I. p. 781. Stando ad una
cronaca bavara citata da Mascovio lib. III, p. 141, tali nomi furono dati alle
parti dopo la battaglia di Winsberg tra Corrado III e Guelfo il 21 dicembre del
1140.
22. Otto Fris. in Chr. l. VII, c. 17, p. 137. — Mascov. Comment. de Reb. Imp.
sub Lothario II l. I, p. 1.
23. L'anno 1127 alla Dieta di Mersburgo. Mascov. p. 12.
24. Mascov. Comment. l. I, § 6, p. 9.
25. Otto Frising. Chron. l. VII c. 17, p. 137.
26. Landulphus Tun. l. I § 23, p. 37.
27. Mascov. Comment. l. I § 23, p. 37.
28. Otto Fris. Chron. l. VII, c. 18, p. 138.
29. Fulconis Benev. Chron. t. V, p. 115. Se crediamo a quest'autore, Lotario
non aveva con lui più di duemila soldati.
30. Stando anche alla relazione del Fleury, Stor. Eccles. lib. LXVIII, c. 1 e 2,
qualunque uomo imparziale giudicherà illegale l'elezione d'Innocente.
31. Baron. Ann. Eccl. ad ann. 1130, p. 183.
32. Ventisette contro diecinove. Tra i primi contavasi il vescovo di Porto
decano del sacro Collegio ed il più vecchio Cardinale, che godeva del favore
del popolo e della nobiltà.
33. Anonimus apud Baronium ann. 1130, § 2, t. XII, p. 184.
34. Mascovius l. II, § 7 et 9, p. 59-64.
35. Otto Fris. de Gest, Frid. I, l. II, c. 21, p. 719.
36. Gunt. in Ligur. l. III, v. 170, p. 41 apud Pitheum Scrip. Germ. Basileæ
1569.
37. Bar. ad an. 1140, § 4-19. — Fleury St. Eccl. l. LXVII.
38. Intorno ad Arnaldo da Brescia merita di esserne letta l'Apologia
pubblicatasi in Pavia l'anno 1790 in due volumi in 8.º, e dedicata al Patrizio
veneto Andrea Quirini. Oltre l'apologia trovasi nel secondo volume la di lui
vita, nella quale il dottissimo autore raccolse ed illustrò tutto ciò che intorno a
questo celebre teologo era stato scritto nel suo secolo, o nel susseguente. N.
d. T.
39. Baron. Ann. Eccl. an. 1199, § 10 et 11.
40. Sancti Bernardi Epist. 195, 196. Questo Santo così scriveva al vescovo di
Costanza: «Voi scorgerete in costui un uomo che apertamente si ribella contro
il clero, confidando nel tirannico potere della gente di spada; un uomo che
insorge contro i medesimi vescovi, ed inveisce contro tutto l'ordine
ecclesiastico. Sapendo io ciò, non saprei in tanto pericolo meglio consigliarvi e
più sanamente, che a seguire il precetto apostolico, di allontanare il male che
vi sta vicino. Un amico della Chiesa vorrebbe piuttosto che fosse legato, che
posto in fuga, onde pellegrinando di più non faccia danno ad altri. Il Papa
nostro Signore, quand'era ancora con noi, ne aveva dato l'ordine in iscritto,
dietro le informazioni avute del male che quest'uomo andava facendo; ma
sgraziatamente non trovossi alcuno che volesse fare una così buona azione.»
41. Otto Fris. in Chron. lib. VII, p. 143.
42. Si suppone che questa colonna appartenesse al tempio di Giove
conservatore. È di marmo greco d'ordine corinzio di sessantaquattro palmi
d'altezza. Vast. Itin. t. I, p. 110.
43. Otto in Frisin. Chron. l. VII, c. 31, p. 145.
44. Corrado II per l'Italia è III per la Germania.
45. Mascov. Com. de rebus Imp. sub Corrado III, l. III, pag. 114. — Otto Fris.
Chron., l. VII, c. 22, p. 140. — Id. de gestis Frid. I. l. I, c. 22, p. 656.
46. De gestis Friderici I, l. I, c. 27 et 28, p. 662.
47. Godef. Viterb. in Pant. pars XVII, t. VII. R. It. p. 461.
48. J. de Muller scrive che, stando ad una cronaca di Corbia, duemila Svizzeri
delle montagne accompagnarono Arnaldo a Roma, e lo assistettero a
ristabilirvi la libertà. B. I, c. 14, p. 410.
49. Gunt. in Ligurino, lib. III, p. 43. — Otto Fris. de gestis Frid. I, l. II, c. 21,
p. 719. — Le vite dei papi scritte da Bernardo Guidoni, e dal Cardinale di
Arragona, t. III, p. 437 439, quasi niente contengono d'importante.
50. A torto si è tentato di attribuire ad Arnaldo da Brescia opinioni troppo
libere in punto di religione e di governo. Lasciando da banda le prime perchè
affatto straniere alla presente storia, non credo inutile il dare qualche
schiarimento rispetto alle seconde, trattandosi di un uomo ch'ebbe tanta parte
ne' movimenti popolari di Roma e di Brescia; e vedremo che tutta la sua colpa
si riduce all'aver predicato contro il dominio secolare del clero. Lunga fu la
lotta che sostenne nella sua patria contro il vescovo Mainfredo, il quale faceva
ogni sforzo per rialzare in Brescia il prostrato edificio della signoria episcopale,
onde andava accarezzando i nobili, mirando a valersi delle forze loro per
distruggere i consoli, e farsi egli principe. Lo che conoscendo Arnaldo
contrario allo spirito, alle leggi ed all'utilità della Chiesa, animò i consoli ed il
popolo ad opporsi agli attentati dell'ambizioso vescovo. Colle scritture e coi
sacri canoni mostrava al popolo che i vescovi, siccome descritti in capo alla
milizia di Dio, non devono prender parte nelle faccende secolaresche; che
come successori degli apostoli debbono esserne gl'imitatori; non essendo
giusto che abbandonino la parola di Dio per occuparsi di governi temporali, di
milizie, ec. Queste spiacevoli verità annunciate da Arnaldo al popolo con
robusta eloquenza, e confermate dalla santità de' suoi costumi, riunirono
contro di lui il vescovo, tutto il clero, gli abati ed i monaci, i quali accusando
Arnaldo di eresia al concilio lateranese, ottennero, colla calunnia, di farlo
condannare. S. Bernardo chiama pessimo scisma, non eresia il titolo d'accusa
dato ad Arnaldo. E tale doveva veramente essere in faccia alla corte pontificia
la dottrina d'Arnaldo, che non solo non concedeva agli ecclesiastici la
superiorità da loro pretesa sopra il temporale dei principi, ma accordava ai
principi una piena autorità sopra i beni ecclesiastici per regolarne l'uso a
tenore dei canoni.
Obbligato di abbandonare la patria per sottrarsi alle calde persecuzioni del
clero, fu alcun tempo a Costanza, e nella Svizzera, di dove passò in Francia
per difendere il suo maestro Abaelardo accusato da s. Bernardo. Ma sul
principio del pontificato d'Eugenio III si ridusse a Roma per appoggiare colla
sua eloquenza e co' suoi consigli la fazione de' Romani, che contrastavano al
papa la temporale signoria. E forse vi fu chiamato dai Romani medesimi,
conoscendo quanto poteva esser utile al loro partito. Nè Arnaldo mancò alle
loro speranze, perchè distinguendo accuratamente le incumbenze
ecclesiastiche dalle secolari, persuase al popolo, che il Papa doveva
accontentarsi della cura spirituale di tutta la cristianità, ma non addossarsi
ancora il peso del governo temporale, la di cui alta ispezione doveva lasciare
all'imperator de' Romani suo sovrano, e l'immediata amministrazione al senato
ed al popolo romano. A tal fine confortava i Romani non solo a conservare il
senato, ma a repristinare ancora tutti gli antichi ordini e costumanze, l'ordine
equestre, i tribuni, i censori, i consoli, e l'antica forma de' giudizj e delle
milizie. N. d. T.
51. Vedasi intorno a questo regno, Mascovius Comment. de rebus Imp. sub
Corrado III lib. IV et V.
52. Otto Frisin. de Gestis Frid. I. l. II, cap. 2. Scrip. Rer. Ital. tom. VI, p. 699.
53. Ibid. — Gunteri Ligurinus lib. I, p. 12. ap. Pitheum.
54. Gunt. Ligur. lib. I, p. 6. — È anche dubbioso che vi fossero Genovesi,
perciocchè il nome di Ligures viene dato da Guntero a tutti i Lombardi.
55. Otto Frisin. Frid. I. lib. II, cap. 7, p. 703.
56. Otto Frising. I. II, cap. 7.
57. Otto Morena Hist. Land. t. VI. Rer. Ital. p. 957. — Galvan. Flamma Manip.
Flor. c. 173, t. XI, p. 634.
58. Otto Morena Rerum Laudensium p. 965.
59. Otto Morena p. 971.
60. Otto Fris. lib. II, cap. 12. 15, p. 706. — Otto Morena p. 969. — Sire Raul,
seu Radulphus Mediol. De gestis Frid. I. p. 1175, t. VI. — Ligurinus l. II, p. 24.
61. Sire Raul p. 1175.
62. De rebus gestis Frid. I. l. II, cap. 14, p. 710.
63. Otto Morena p. 973.
64. Otto Fris. de gest. Frid. I, l. II, cap. 13, e 15.
65. Ibid. Cap. 14.
66. Epist. Frid. ad Ottonem Frisin. ap. Scrip. Rer. Ital. t. VI, p. 635.
67. Tristani Calchi Hist. Patriæ, l. VIII, p. 222.
68. Otto Fris. de Gest. Frid. I. l. II, cap. 15.
69. Tutti gli storici contemporanei chiamano questa borgata Cairo, ed il
Muratori suppone che si parli d'un castello di tal nome posto alle falde delle
Alpi liguri quaranta miglia lontano da Asti. Ma ponendo mente alla strada
tenuta da Federico, non può essere che Chieri. Questa borgata, ch'egli
attraversò passando da Torino ad Asti, ebbe governo repubblicano fino alla
fine del tredicesimo secolo.
70. Otto Fris. l. II, c. 17. p. 712. — Trist. Calchi l. VIII, p. 222.
71. Tristano Calco ci diede i nomi de' capi di questi valorosi.
72. Otto Fris. de gestis Frid. I. l. II, c. 17.
73. Ibid. cap. 19.
74. Otto Morena, p. 981. — Otto Fris. l. II, c. 20 e 21, p. 718. — Abbas Usp.
in Chron., p. 283. — Godafr. Viterbiensis in Pantheo. pars XVIII, t. VII, p. 464.
— Sicardi Ep. Crem. Chron., p. 599, tom. VII Rer. Ital.
75. Otto Fris. l. II c. 21. p. 718.
76. Bar. Ann. Ecc. ad ann. 1155, §. 2, 3, e 4. Card. Aragonius in Vit. Ad. IV. p.
442. Sc. Rer. Ital T. III. P. 1.
77. Vita ad Pap. — Otto Fris. l. II, c. 21, p. 721.
78. Mur. Ant. It. Dis. IV. vol. I, p. 117.
79. Otto Fris. l. II, cap. 22.
80. Anast. Bibl. de vita Leonis IV, p. 240. Sc. Rer. It., t. III.
81. Si chiama oggi Ponte S. Angiolo, prima Pons Aelii Adriani.
82. Otto Fris. L. II, c. 23, p. 724.
83. Otto Frising. Lib. II, c. 24, p. 725. — Se l'imperatore aveva realmente
diritto di sovranità sovra di Roma, non è meraviglia che il papa facesse la
surriferita dichiarazione. N. d. T.
84. Idem. Ibid. p. 726.
85. Romualdi Salernit. Chron. p. 197. t. VII.
86. Otto Frising. l. II, cap. 25.
87. De Gestis Frid. I, l. II, c. 26.
88. Otto Mor. Hist. Ver. Land. p. 983. — Trist. Calchi Hist. Patriæ l. VIII, p.
223.
89. Sire Raul de Gest. Frid. I, p. 1176.
90. Carol. Sigon. de Regn. It. l. XII, p. 293. — Sire Raul p. 1179. — Trist.
Calch. l. VIII, p. 225.
91. Ibid.
92. Romualdi Salernit. Chronicon p. 198.
93. Willelmus Tyrius l. XVIII, c. 8. p. 937, Gesta Dei per Francos.
94. Baronius Annales an. 1166, § 1.
95. Ibid. § 4.-9.
96. Radevicus Frisingensis, Appendix ad Ottonem de rebus gestis Friderici I. l.
I, cap. 8. tom. VI. Rer. Ital. Radevico fu canonico di Frisinga che continuò
l'istoria incominciata dal suo vescovo Ottone. Noi siamo per congedarci da
costui che pure è uno de' più eleganti storici, illuminati ed imparziali de' mezzi
tempi. Ottone di Frisinga aveva sortiti illustri natali, essendo figliuolo di
Leopoldo marchese d'Austria e di Agnese sorella dell'imperatore Enrico V: era
fratello di Corrado III, re dei Romani, e zio di Federico Barbarossa. Ci
rimangono di lui due opere: una cronaca dal principio del mondo fino a' suoi
tempi pubblicata a Basilea in fog. nel 1569, da Pitteo, divisa in otto libri. Noi
abbiamo più volte citato il settimo, che contiene il secolo precedente al suo.
L'ottavo è consacrato alla storia religiosa. L'altra sua opera è ancora più
interessante, contenendo il racconto della prima discesa di Federico in Italia,
ed è divisa in due libri. Fu pubblicato nel t. VI, Rer. Ital. Ottone morì del 1158.
Benchè il suo continuatore Radevico non sia senza merito, non compensa la
perdita d'Ottone, che è quasi il solo autore che sparga qualche luce sopra un
secolo barbaro ed oscuro.
97. Otto Fris. l. II, c. 31.
98. Radevic. Fris. l. I, c. 19.
99. Radev. Frisin. l. I, c. 22.
100. Idem cap. 25.
101. Otto Morena Hist. Laud. p. 995.
102. Ibid.
103. Radev. Frigius. l. I, c. 25.
104. Tale regolamento viene riferito per intero da Radevico, lib. I, c. 26. Un
Tedesco contemporaneo, e suddito di Federico, chiamato Guntero, fece un
poema di 12 canti dei quattro libri d'Ottone di Frisinga, e del continuatore
Radevico. Gli ha quasi sempre servilmente parafrasati ne' suoi versi, che pure
sono i meno cattivi dei poeti storici di questo secolo. Egli tradusse perfino
questo regolamento, lib. VII, p. 101, ciò che forma una strana sorte di poesia.
Il suo Ligurinus si stampò in Basilea del 1569 in seguito alla storia di Ottone di
Frisinga per cura di Pitteo.
105. Otto Morena, p. 1007. — Sire Raul, p. 1180. — Radevic. Frising. l. I, c.
29. — Gunterus in Ligurino, l. VII, p. 105.
106. Otto Morena, p. 1009. — Joh. Bapt. Villanovæ, Laudis Pomp. hist. ap.
Grævium, t. III, lib. II, p. 863.
107. Radev. Frising. l. I, c. 31.
108. Idem l. I, c. 32. — Sire Raul, p. 1180.
109. Radevico dice che la città aveva cento stadj di circuito. Questa misura
greca ugualmente straniera allo storico tedesco ed agli assediati, non ci dà
che un'idea assai inesatta. Le mura presenti hanno circa sei mila tese di
lunghezza.
110. Eranvi altravolta in tutte le piazze di Roma, e probabilmente in tutte le
colonie romane, di tali portici chiamati archi di Giano, destinati a difendere i
mercanti dal sole e dalla pioggia. L'arco di Giano quadriforme nel Velabro di
Roma è il solo che siasi conservato fino ai nostri giorni. La torre posta sull'uno
e sull'altro erano opere posteriori de' tempi barbari.
111. Rad. Fris. l. I, c. 38. — Otto Morena, p. 1013.
112. Tre franchi. Le monete de' tempi d'Ottone erano state alterate assai:
Federico le ristabilì. Il suo danaro d'argento pesava un danaro ed un grano;
ma lasciò ugualmente in corso il danaro di terzuolo pesante 18 grani con un
terzo di fino e due di rame. Venti di questi grani formavano il soldo in
discorso. Devo al conte Luigi Castiglione di Milano, ed alla sua ricca collezione
di monete milanesi, tutte le mie teorie intorno alla storia monetaria di
Lombardia, che gli antiquarj hanno lasciata nella più profonda oscurità.
113. Forse alcuno l'avrà scritto, ma non so che nemmeno a que' tempi
potessero provare gli ulivi presso Milano. N. d. T.
114. Radev. Frising. L. II, c. 39.
115. Rad. Fris. t. I, c. 40 — Ligur. l. VIII, p. 114.
116. Questo trattato viene fedelmente riportato da Radevico Frisingense. L. II,
c. 41.
117. Il preambolo di questo trattato non ricorda nè l'umiliazione dei Milanesi
d'implorare perdono, nè la clemenza dell'imperatore di accordarla. Niente
ritrovasi nella sua forma che sia più duro delle condizioni. Comincia con
semplicità in tal modo. «In nomine Domini nostri Jesu Christi, haec est
conventio per quam Mediolanenses in gratiam imperatoris redituri sunt et
permansuri.»
118. Le nostre guide in questa parte di Storia fino alla conquista di Milano
sono tre scrittori contemporanei. Radevico Canonico di Frisinga di cui ho già
parlato, è il primo. Allievo di Ottone di Frisinga di cui ne continuò la storia,
adotta i suoi pregiudizj di famiglia, ed è come il maestro, appassionato
ammiratore di Federico cui dedicò la sua Storia, cercando ad ogni modo di dar
risalto alla sua gloria, a spese de' suoi nemici. Pure non era insensibile
all'entusiasmo della libertà, e siccome d'ordinario riporta estesamente gli atti
originali, la verità traspira dalla sua narrazione ancora quando non è
favorevole al suo Eroe. Il secondo è Ottone Morena: magistrato lodigiano, ed
impiegato da Federico nell'ufficio di giudice, scrisse una storia de' suoi tempi,
intitolata Historia rerum laudensium assai voluminosa, ed abbondante di
curiose particolarità, ma marcata dell'impronta di quella servilità che io
rimprovero ai legisti italiani, e piena d'invettive contro Milano. Abbiamo
finalmente uno storico milanese Sire Raul, o Rodolfo milanese, la di cui storia
di Federico I sempre abbreviatissima, e probabilmente interpolata in più
luoghi, c'istruisce assai più delle passioni de' Lombardi, che de' fatti.
Qualunque ella siasi, ci è pertanto preziosa, perchè Rodolfo è il solo scrittore
repubblicano di questo mezzo secolo, di cui siasi conservata l'opera, col di cui
sussidio si possano rettificare gli esagerati racconti degli scrittori del contrario
partito. Lessi pure, ma con pochissimo profitto, due scrittori tedeschi
contemporanei Otto de Sancto Biasio, ed Abbas Uspergensis Chronicon.
119. Rad. Fris. lib. II, c. 4. p. 786. — Gunther. Ligurinus, l. XVIII, p. 124.
120. Otto Mor., p. 1019. — Radev. Fris., l. II, c. 7.
121. Radev. Fris. l. II, c. 6.
122. Radev. Frisin. l. II, c. 7.
123. Idem, l. II, c. 9.
124. Caffari Annal. Gen. l. I, p. 270 et 271.
125. Sire Raul p. 1181, 1182. — Otto Morena p. 1021. — Radev. Frisin. l. II. c
21.
126. Radev. Fris. l. II. c. 32. — Otto Morena p. 1023. — Sire Raul p. 1182.
127. Radev. Fris. l. II, c. 18.-20, et 30, 31. — Baron. ad ann. 1159, § 1.-19.
128. Ho riportata fedelmente questa declamazione più da retore che da
storico, perchè non è in facoltà d'un traduttore di mutilare il testo. Il discreto
lettore darà quel peso che merita a quest'uscita dell'autore, non perdonabile
che in un lungo lavoro pregevole per infinite bellezze. N. d. T.
129. Radev. Fris. l. II, c. 23.
130. Sire Raul, p. 1182.
131. Radev. Fris. l. II, c. 45, p. 823.
132. Radev. Fris. l. II, c. 47. — Gunt. Lig. l. X, p. 146.
133. Otto Mor. p. 1037, 1139. — Sire Raul p. 1183. — Trist. Calchi Hist. patr. l.
II, c. 48, et 49.
134. Radev. Frising. l. II, c. 48, et 49.
135. Otto Morena p. 1046.
136. Radev. Fris. l. II, c. 59. — Otto Moren. 1045, 1047. — Guntheri Ligurinus
l. X. p. 148, 150.
137. Radev. Fris, l. II, c. 62.
138. Quantunque le repubbliche lombarde impugnassero le armi per
difendersi contro le armate imperiali, non cessarono però mai, anche in tempo
che trovaronsi vittoriose, di riconoscere le prerogative dell'Impero e di
rispettare l'imperatore, che non avrebbe facilmente trovato veruna città
ribelle, se loro avesse lasciati i privilegi accordati da Ottone il grande, e non si
fosse collegato, per opprimerne alcune, colle città rivali, le di cui milizie
sfogavano sotto il di lui nome i loro odj privati sui vinti. Del resto quante
lagrime e quanto sangue dovettero versare quelle semi-repubbliche per una
larva di libertà, ed in sostanza mancanti di vera indipendenza, di unione fra
loro e per conseguenza di quiete e di ogni civile felicità! N. d. T.
139. Barron. ad ann. 1159, § 70, et sequ. — Vita Alexan. papæ III a Card.
Arragon. t. III, Rer. Ital. p. 448.-450.
Qui incominciamo a far uso della storia di Alessandro III, scritta da un autore
contemporaneo e raccolta con alcune altre dal cardinale di Arragona. Questa
preziosa opera ci compensa di quella di Radevico che termina poco dopo
quest'epoca. Essa devesi piuttosto risguardare come la storia della guerra di
Lombardia, che come quella del pontefice. Questa storia, ordinatamente
scritta, è particolarizzata in modo che ben si conosce dettata da un testimonio
oculare; e vi si trova tutta quella imparzialità che può pretendersi da una
storia scritta in mezzo alle guerre civili. Sembra probabile che l'autore morisse
prima di papa Alessandro, poichè il racconto non arriva che fino al 1178. Le
altre due vite, quasi contemporanee, dello stesso papa raccolte da Amalrico
Augerio e da Bernardo Guidone, non meritano pure di essere ricordate.
140. L'elogio che il nostro autore fa alla vita anonima di papa Alessandro III,
non deve farci dimenticare dell'epoca in cui fu scritta, nè l'autore di essa,
quantunque assai diligente, s'innalza però sopra il livello del suo secolo. N. d.
T.
141. Otto Mor. p. 1061. — Radev. Fris. l. II, c. 75. Questa è l'ultima notizia che
prendiamo da così pregevole scrittore, il quale dettò la sua storia lo stesso
anno 1160, e la terminò allorchè furono licenziate le truppe allemanne. Alla
stessa epoca termina Guntero il suo poema; onde dei Tedeschi non ci
rimangono che Ottone da s. Biagio e l'abate Uspergense. Sussidio assai
debole.
142. Otto Morena Hist. Laud. p. 1087.
143. Otto Morena Hist. Laud. p. 1087.
144. Otto de Sancto Blasio in Chron. c. 16. Scrip. Rer. Ital. t. VI, p. 874.
145. Morena nel suo barbaro latino li chiamava blava, che è la biada
degl'Italiani, vocabolo adoperato per indicare il raccolto d'autunno e sopra
tutto la biada di Turchia e la sagina, che io credo non ancora coltivata in Italia
nel dodicesimo secolo. Si potrebbe per altro risguardare questo passo come
una prova del contrario.
146. Anticamente il nome generico di biava usavasi in Lombardia per indicare
qualunque specie di granaglie, ma il grano turco s'incominciò a coltivare alcuni
secoli dopo l'epoca di Federico Barbarossa. N. d. T.
147. Sire Raul p. 1186.
148. Otto Morena p. 1099. È vero che l'imperatore lasciava in loro arbitrio di
arrendersi a discrezione o sotto così dure condizioni, che i suoi medesimi
cortigiani non credevano eseguibili; e perciò s'applicarono al primo partito.
Burchardi Ep. de Excid. Med. t. VI, Rer. Ital. p. 915.
149. Otto Mor. p. 1103, 1105. — Sire Raul p. 1187. — Otto de Sancto Blasio c.
16, p. 875. — Trist. Calchi Hist. patr. l. X, p. 253. — Galv. Flamma Manip. Flor.
c. 189, p. 642. — Veggasi sopra tutto, Epist. Burchardi Notarii Imp. ad Nicol.
Sigebergensem abbatem t. VI, Rer. Ital. p. 915.-918. Abbiamo in questa
lettera un assai circostanziato racconto della ruina di Milano e dell'impressione
che fece sui Tedeschi la vittoria dell'imperatore.
150. Queste sono piuttosto crudeltà dei tempi che di Federico, cui il nostro
autore rende più sotto la debita giustizia, dicendo che se incrudelì nel caldo
della guerra, mostrossi poi umano coi nemici sottomessi, non infierendo che
contro le insensibili mura. Nè ai Milanesi doveva riuscire inaspettato l'ordine di
atterrare la loro città, dopo ch'essi avevano usato lo stesso trattamento ai
Lodigiani. N. d. T.
151. Otto Mor. p. 1105, 1107. — Trist. Calc. Hist. Patr. l. X, p. 256. — Joh.
Bapt. Villan. Hist. Laud. Pomp. l. II, p. 875.
152. Sire Raul p. 1188. — Galv. Flam. Manip. Flor. c. 192. p. 644. — Bern.
Corio Stor. Milanesi p. I, p. 54.
153. Caffari Ann. Genuenses l. I, p. 271.
154. Idem. p. 278.
155. Questo trattato viene riportato per intero dal Muratori. Antiqu. Ital. Diss.
XLVIII. t. IV, p. 253.
156. Caffari Ann. Gen. p. 280.-283. — Breviarium Pisanæ Hist. p. 173.-174. —
Uber. Fol. Gen. Hist. l. II, p. 268. — Marang. Cronache di Pisa. Scrip. Etr. t. I,
p. 387.
157. Obertus Cancel. Ann. Gen. l. II. p. 292.
158. Obertus Cancel. Ann. Genuens. p. 293, 294. — Breviar. Pisanæ Hist. p.
175, 176. — B. Marangoni Cron. di Pisa p. 394.
159. Obert. Can. p. 295.-298. — B. Maran. Cron. di Pisa p. 398.
160. Obertus Canc. p. 310.
161. Obertus Canc. Ann. Genuens. p. 324-327. Uberti Foliettæ Genuensis Hist.
l. II, p. 278.
162. Otto Mor. Hist. Laud. p. 1123.
163. Id. Ibid. p. 1127-1129. Non sappiamo per altro se Otto Morena sia
sempre l'autore di questa parte della storia, o se abbia a quest'epoca
incominciato la continuazione scritta da suo figliuolo Acerbo. La narrazione dal
padre viene senza interrompimento continuata dal figliuolo e da uno
sconosciuto, senza che possa sapersi ove termina l'uno, ed incomincia l'altro.
Acerbo Morena militò sotto l'imperatore, e morì nella spedizione di Roma
l'anno 1167. Acerbo manifesta sentimenti più generosi e più liberali del padre.
164. Sire Raul p. 1189.
165. Vita Alex. III a Card. Arragonio p. 456 — Se può darsi fede allo storico
greco Cinnamo (L. V, c. 13. p. 103. Bisan. t. XI), quest'alleanza fu conchiusa
ad istigazione dell'imperatore Manuele Comneno geloso del crescente potere
di Federico. Egli contestavagli il titolo d'imperatore, e mandò Niceforo Calufi a
Venezia, ed altri agenti di minor conto nelle altre città con ragguardevoli
somme di danaro per eccitare alle armi i Lombardi in difesa della loro libertà.
166. Acerbus Morena p. 1123.
167. Vita Alex. III. a Card. Arrag. p. 456.
168. Otto de Sancto Blasio Chron. c. 18. et 19. t. VI. Rer. It. p. 875 — Conradi
ab. Usper. Chron. p. 293. apud Pithaeum.
169. Vita Alex. III. a Card. Arrag. p. 456.
170. Ibid. p. 457. — Romuald. Saler. Chron. p. 205.
171. Guglielmo I, coronato ancora vivente il padre l'anno 1150, morì del 1166.
Romual. Saler. p. 205. Questo storico che dopo la congiura di Matteo Bonella
fu il principale liberatore del re, fu pure uno de' principali suoi ministri, uno dei
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like