index

Symbols

& (AND) bitwise logical operator 77

#include directives 133

| (OR) bitwise logical operator 77

A

ABBR option 184

add_noun() function 106

add_word() function 101102, 105, 107

alfa int variable 182

ALPHA constant 277

alpha constant 160

AND operator 200

apt command 11

ar (archive) utility 134135

ASCII (American Standard Code for Information Interchange)

control codes 7173

conversion tricks 7678

generating noncharacter output 7475

overview 6971, 145147

-a switch 183, 185187, 189

atexit() function 176

B

BALLS defined constant 326

balls variable 323

bash shell 11, 1820, 130

Baudot code 141

BCD (Binary Coded Decimal) 141

BG constant 308

binString() function 7475

bits, defined 164

BL defined constant 350

block buffering 53

BOLD attribute 309

bravo int variable 182

buf buffer 123, 208

buffer character array 54

BUFSIZ defined constant 208

build_vocabulary() function 103 – 105, 107

byte_sizes.c code 166

BYTES_PER_LINE constant 82

bytes variable 82

byte unsigned long variable 166

C

Caesarean ciphers 5067

devising variations 6063

filtering words 6567

hex output filters 6364

I/O filters 5157

stream I/O 5154

working filter at command prompt 5657

writing simple filters 5456

NATO filter 6465

rot13 program 5860

calendars 273311

calculating first day of month 280282

cal program 274275

color 303311

coloring holidays 309311

generating colorful calendar 306309

terminal colors 303306

creating constants and enumerating dates 276277

finding day of week 277280

full year

displaying 295298

putting into grid 299303

generating week 286292

leap years 282283

showing month 292295

time zones 283285

cat command 86, 161

cd command 10

C development cycle 24

building 34

compiling 34

editing source code 23

linking 34

center() function 295, 299300

changecwd.c source code 209

character encoding 141163

text representation 142148

ASCII 145147

early text formats 142145

Unicode 147148

wide character programming 148163

character types 150152

generating output 152156

locale settings 149150

receiving input 156160

working with wide characters in files 160163

char array declaration 111

char data type 6970, 74, 110, 137, 150151, 157, 165166

charlie int variable 182

char pointer 33, 44, 101, 257

char-sized chunks 169

char variables 74

ch character input 55

CHCP command 146

chdir() function 208210, 215, 239

check_caps() function 108

checksum01.c program 88

checksum int variable 87

ch int variable 48, 74

chmod command 20, 199

chsh command 18

clang compiler 5, 1213

closedir() function 203204

code, writing 57

Code::Blocks IDE 57

code pages 146

code points 148

code space 148

color 303311

coloring holidays 309311

generating colorful calendar 306309

terminal colors 303306

color_holiday() function 310

color_output() function 308

COLUMNS defined constant 299

command-line compiling 913

accessing terminal window 9

basic shell commands 1011

compiling and running 1213

GUI editor 12

text screen editors 1112

using command-line compiler options 1516

commify() function 317

computer() function 345349, 351

constants, creating 276277

const char arrays 143

const char pointers 137, 276

const char types 215

const classifier 276

core dump 171

COUNTRY command 146

count variable 128, 227, 235

cp command 10

C Programming Language, The (Kernighan and Dennis) 130

Csh shell 19

-c switch 134135

ctime() function 2324, 26, 196, 283

curl libcurl library 15

cwd[] char array 208

cypher program 13

D

Dan Gookin’s Guide to Ncurses Programming 53

data[] array 175

data[] buffer 175

date tm structure 278

day member 257

dayoftheweek() function 279, 281

day variable 286, 292, 294, 301302

DELTA constant 277

depth indent level 221

depth variable 221

dest buffer 115

diff command 86

diff program 86

d_ino member 205

dir() function 213, 215, 217218, 220221, 225

directories

monitoring depth 220222

names 218220

reading 203207

directory char variable 215

directory tree utility 191 – 222

directory trees 217222

directory name 218220

monitoring directory depth 220222

files and directories 194207

file types and permissions 197203

gathering file information 194197

reading directories 203207

filesystem 192194

subdirectories 207217

exploring 210212

recursion 212217

tools for 208210

dirent structure 204206

DIR handle 203204

dirtree03.c online repository 222

dirtree program 220221

dotm[] array 301303

double data type 110

double-quad words 165

doublewords 165

do-while loop 323, 330

dow variable 297298

doy variable 271

DRAW defined constant 326

draw variable 323

d_reclen member 205

dump 170171

dumpfile04.c source code 185

dumpfile code 175, 180, 183

dumpfile utility 175179

command-line options 179190

activating octal output 187190

getopt() function 180182

setting abbreviated output 185187

updating program code 182185

fixing uneven output 178179

reading file data 175177

E

easter() function 267269, 271

easter01.c online repository 268

EBCDIC (Extended Binary Coded Decimal Interchange Code) 145

echo command 57, 247

else condition 198

else portion 294

else statement 59

Emacs text mode editor 11

encoding and decoding 6892

hex encoder/decoder 7989

error-checking 8789

writing 7986

plain text 6978

ASCII 6971

control codes 7173

conversion tricks 7678

generating noncharacter output 7475

URL encoder 8992

creating 9192

encoding rules 89

writing 9091

entry pointers 3536

entry variable 3335

enum keyword 276277

EOF (end-of-file) marker 51, 5455

EOF flag 43

EPSILON constant 277

errno variable 204, 208209, 211

exit() function 84, 176, 247

exit command 10

EXIT_FAILURE status 249

exit status 246

EXIT_SUCCESS status 249

extended_ascii.c source code 147

Extended Binary Coded Decimal Interchange Code (EBCDIC) 145

extract() function 219220

F

FALSE constant 277

fclose() function 203

february() function 282283, 288, 294295, 299

fflush() function 54

FG constant 308

fgetc() function 48, 54, 162, 176

fgets() function 41, 48, 84, 111, 114, 158, 161162, 176

fgetwc() function 162

fgetws() function 157159, 161163

file finder utilities 175, 223244

Find Dupe utility 234244

building file list 235239

locating duplicates 239244

Find File utility

coding 225228

find and grep utilities 224225

globbing 228232

using wildcards to find files 232234

FILE handle 203

fileinfo series of programs 201, 203

filename char pointer 176, 195

find() function 225, 227, 232, 236240

find command 224

Find Dupe utility 234244

building file list 235239

locating duplicates 239244

finddupe utility 234

findfile01.c source code 227228

Find File utility 223244

coding 225228

find and grep utilities 224225

globbing 228232

using wildcards to find files 232234

find utility 224225

finfo structure 235, 239, 243

first() function 301

first variable 293294

float data type 137

floor() function 269

fopen() function 160, 176, 179, 203

fork() function 249

fortune program 31

found int variable 241

fputc() function 5455, 160

fputs() function 154

fputwc() function 160

fputws() function 154

fread() function 176, 205

free() statements 37

G

GAMMA constant 277

gcc compiler 5, 12

getchar() function 52, 54, 156, 170

getcwd() function 208209

getcwd.c demo program 208

getopt() function 180183

getopt_long() function 180

getwchar() function 156157

glob() function 228, 230232, 234

globbing 228 – 232

glob (global) 228

GREET.COM program 2526

greetings program 2123

adding general time info to greeting code 2526

adding moon phases to greeting code 3031

adding name as argument 2223

adding phrases to greeting code 37

adding specific time info to greeting code 2627

coding 2122

grep command 224

grep utility 224225

grid[] array 335, 337, 339, 348

guess[] array 328

GUI editor 12

H

hash char variable 151

hello[] array 153

Hello World program 21

hello_wworld01.c code 153

help() function 183185

hexdecode program 84, 86, 88

hexd (hexdefilter01.c) program 81

hexdump utility 161, 164190

dumpfile utility 175179

command-line options 179190

fixing uneven output 178179

reading file data 175177

storage 164175

dumping data 170175

outputting byte values 169170

storage units and size 165168

hexe (hexenfilter01.c) program 81

hexencode program 84, 86

hex encoder/decoder 7989

error-checking 8789

writing 7986

hex integer variable 85

hex output filters 63 – 64

h holiday structure 310

High Performance File System (HPFS) 192

holiday detector utility 245272

calculating Easter 266269

holidays in UK 255256

holidays in US 254255

irregular holidays 261266

obtaining any date 251254

obtaining today's date 250251

regular date holidays 256261

return values 246250

exit status vs. termination status 246

interpreting 247249

preset 249250

setting 246247

testing 270272

holiday integer 261

holiday structure 257259, 268, 310

hostage filter 57

hostage program 57

HPFS (High Performance File System) 192

-h switch 183

I

I/O (input/output) filters 5157

stream I/O 5154

working filter at command prompt 5657

writing simple filters 5456

 

IDEs (integrated development environments) 49

choosing 45

Code 57

linking libraries 1415

XCode IDE 79

if condition 184, 188, 349

if decision 178, 257, 288, 294, 308, 348349

if-else conditions 66

if else-if else structure 201, 290

if-else structures 143, 188, 203

if tests 160, 172, 183, 186, 200, 266, 282, 289, 343, 348

index variable 176

inode 194

input buffer 158

input wide character buffer 158

ins pointer 126

int8_t integer type 168

int16_t integer type 168

int32_t integer type 168

int64_t integer type 168

int data type 110, 137, 168, 170

International Telegraph Alphabet No. 2 (ITA2) 144

int variable declarations 85

inword variable 128

isalnum() function 90

isalpha() function 41, 49, 59, 64

isholiday() function 256257, 259263, 266, 268272, 310

isholiday package 271

isspace() function 66

isterm() function 4647

ITA2 (International Telegraph Alphabet No. 2) 144

items int variable 34

items variable 34, 36

J

JANUARY enumerated constant 277

K

Kernighan, Brian 130

key[] array 100

kibibytes 168

kludge technique 54

Ksh shell 19

L

-L (big L) switch 135

LC_CTYPE category 149

-L. (dash-big L-period) switch 135

ld program 4

leap years 282283

Learn Linux in a Month of Lunches (Ovadia) 11

left() function 121122, 124

LEFT$ command 121

len characters 121, 124

length() method 137

LENGTH constant 186

length constant 162

len integer 123

len variable 119, 138

libraries

linking 1415

string 132136

creating 134135

using 135136

writing source and header file 133134

line[] buffer 83, 85, 162

line_out() function 174, 176178, 184186, 188

list_base pointer 35

list_base variable 3436

-l (little L) switch 1516, 135136, 199

LLVM clang compiler 5

-lm switch 166, 267

locale command 149

locale variable 150

localtime() function 24, 250251, 256257, 276278, 286, 288, 294

$LOGNAME environment variable 20

lotto() function 325328, 330

lotto01.c code 321

lotto05.c code 327

lotto08.c code 330

lotto pick utility 312330

avoiding repeated numbers 322324

creating lotto() function 325327

drawing lotto balls 320322

generating random values 317320

matching lottery picks 327328

odds

overview 313314

programming 315317

testing 328330

playing lotteries 313

lotto programs 325, 328

lowercase() function 98, 107

ls command 10, 194

ls -l command 284

M

madlib01.c program 103, 106

madlib02.c program 104, 106

Mad Libs program 108

make command 11

malloc() function 32, 111

man command 10

man fs command 192

man pages 27, 44, 69, 112, 115, 157158, 162, 180, 195, 203204, 208209, 230, 252, 284285

match char pointer 44

math (m) library 166

mday integer 261

mdays[] array 270, 283, 288, 294

mdays variable 294295

message URL http

//brew.sh 11

methods 137

mid() function 122124

MID$ command 121

MinGW 5

mkdir command 10

mktime() function 252, 254, 256

ML constant 350

month[] array 276277

month program 285, 292, 295

months program 295

month variable 286, 289, 294, 301

mood variable 156

moon_phase() function 2930

moon phase program 2731

adding moon phases to greeting code 3031

observing moon phases 2829

writing moon phase algorithm 2930

more filter 6364

mp variable 30

mv command 10

mystring.o object code 135

N

n[] pointer array 268

name member 257

name members 240

-name switch 224

nato[] array 4042, 64

nato03.c program 46

nato04.c progam 47

NATO (North Atlantic Treaty Organization) 38

NATO phonetic alphabet filter 6465

NATO phonetic alphabet translator program 3849

alphabet 3839

from NATO to English 4349

converting NATO input to character output 4447

reading NATO input from file 4749

reading and converting file 4243

writing translator 4142

ncal program 274275

new buffer 127

noglob option 229

North Atlantic Treaty Organization. See NATO

no_sigma constant 160

now time_t variable 250

NULL constant 44, 104

number() function 98, 106

numbers[] array 322323, 325

O

octal output 187190

octet 199

OCT option 184

offset characters 126

offset integer 123, 125126

ohex() function 80

omega constant 160

on_exit() function 176

OOP (object-oriented programming) approach for strings 136140

adding function to structure 137139

creating string 139140

opendir() function 203204, 208

opterr global variable 180

options01.c source code 181

options int variable 183185

options series 183

org pointer 125126

-o switch 13, 16, 183, 188189

Ovadia, Steven 11

P

password[] buffer 99

password generators 93108

random password program 97101

adding conditions 98

building 97

improving password 99101

random word password generator 101108

building 106108

generating random words 101106

strategies 9497

avoiding basic and useless passwords 9495

complexity 9596

word strategy 9697

PATH_MAX defined constant 208

permissions_out() function 203

pithy05.c code 105

pithy saying program 3137

adding phrases to greeting code 37

creating phrase repository 3132

randomly reading phrases 3237

plain text 6978

ASCII 6971

control codes 7173

conversion tricks 7678

generating noncharacter output 7475

ply integer variable 337

pmonth variable 289

pointers (memory locations) 32

popen() function 249

pow() function 166

printf()() function 13, 27, 30, 3435, 64, 69, 76, 79, 85, 90, 100, 112, 114, 130, 146, 150, 152, 166, 186, 198, 205206, 220221, 241, 251252, 283, 285, 291, 294, 308309, 318

-print switch 224

prntf() function 300

prompt() function 337340, 346, 348

pseudo random 317

putchar(' ') statement 301, 309

putchar() function 5455, 69, 170, 172

putenv() function 284285

puts() function 114, 337

putwchar() function 153, 163

putwchar(ch) statement 163

p variable 337, 348

pwd command 10, 208209

Q

qsort() function 137

quadwords 165

R

rand() function 317319, 346

random() function 317, 319

random02.c code 319

random password program 97101

adding conditions 98

building 97

improving password 99101

randomp series of programs 106

random values, generating 317320

random word password generator 101108

building 106108

generating random words 101106

randwords01.c code 102

ransom program 57

readdir() function 204207

readdir02.c source code 205

readdir04.c source code 207

realloc() function 32, 36

recursion 212217

repeat member 240241, 243

reset[] sequence 335

reset command 73

return01 program 248

return keyword 176

return values 246250

exit status vs. termination status 246

interpreting 247249

preset 249250

setting 246247

right() function 122124

RIGHT$ command 121

Ritchie, Dennis 130

rot13 filter 5860

rot13 program 5860

-r switch 135, 225

S

say command 43

saying variable 37

scanf() function 158159, 338

scramble() function 99100, 107, 115

screen dump 171

set +o noglob command 229

set_abbr() macro 184

setbuf() function 53

setlocale() function 149150, 152153

set macro 184

set -o command 229

set_oct() macro 184

shell commands 1011

shell startup 1821

overview 18

scripts

editing 2021

overview 1819

shift variable 61

sholiday() function 263

showgrid() function 335336

Sh shell 19

S_IRGRP defined constant 200201

S_IROTH defined constant 200

S_IRUSR defined constant 200

S_ISBLK() macro 198

S_ISCHR() macro 198

S_ISDIR() macro 198

S_ISFIFO() macro 198

S_ISLNK() macro 198

S_ISREG() macro 197198

S_ISSOCK() macro 198

S_IWGRP defined constant 200

S_IWOTH defined constant 200

S_IWUSR defined constant 200

S_IXGRP defined constant 200

S_IXOTH defined constant 200

S_IXUSR defined constant 200

size characters 208

SIZE constant 178

sizeof operator 112113, 119, 166

slice[] array 341342

srand() function 319, 346

srandom() function 319

sscanf() function 86

-s switch 135

start_day variable 271

stat() function 195197, 203, 206207, 211

statbuf structure 195

stat command 197

stderr (standard error device) 176

stdin input device 51, 158

stdin (standard input) 162

stdlib.h library 284

stdout device 154

st_mode member 197, 199200, 203

storage 164175

dumping data 170175

outputting byte values 169170

storage units and size 165168

str1.length function 138

strappend() function 115116

strcaps() function 118, 128, 136

strcasecmp() function 45, 115

strcat() function 114116, 125126

strchr() function 114

strcmp() function 45, 113115

strcoll() function 114

strcpy() function 34, 114, 125126

strcpy() statement 35

strcspn() function 115

stream I/O 5154

strfry() function 115

strftime() function 2627, 291292

string_create() function 139

string_destroy() function 140

string functions 116132

changing case 117118

converting tabs to spaces 130132

counting words in strings 128130

inserting one string into another 125128

reversing strings 118120

splitting strings 124125

trimming strings 121124

string library 132136

creating 134135

using 135136

writing source and header file 133134

strings 110116

counting words in 128130

inserting one into another 125128

measuring 112114

overview 110111

returning vs. modifying directly 115116

reversing 118120

splitting 124125

string functions 114115

trimming 121124

string structure 139140

string utilities 109140

OOP approach 136140

adding function to structure 137139

creating string 139140

string functions 116132

changing case 117118

converting tabs to spaces 130132

counting words in strings 128130

inserting one string into another 125128

reversing strings 118120

splitting strings 124125

trimming strings 121124

string library 132136

creating 134135

using 135136

writing source and header file 133134

strings 110116

measuring 112114

overview 110111

returning vs. modifying directly 115116

string functions 114115

strinsert() function 126128

strlen() function 112114, 119, 124, 127

strlower() function 118

strncat() function 114115

strncmp() function 84, 114

strncpy() function 114, 125

strpbrk() function 114

strrchr() function 115

strrev() function 119

strsplit() function 125

strspn() function 115

strstr() function 115

Str string variable 137

str structure 137

strtabs() function 131

strtabs.c program 132

strtok() function 4445, 86, 115

strtol() function 247

struct finfo variable 240

struct term *t pointer 105

strupper() function 117118

strwords() function 128, 130

strwords.c program 129

strxfrm() function 115

subdir01.c source code 211

subdirectories 207217

exploring 210212

recursion 212217

tools for 208210

subdir program 212213, 220

switch-case structure 180, 182

switches 179

syllables 165

symbol() function 98, 106

system() function 248

T

tabs command 130

terminal window, accessing 9

termination status 246

term structure 104

test_abbr() macro 185186, 188

test macro 184

test_oct() macro 188

text representation 142148

ASCII 145147

early text formats 142145

Unicode 147148

text screen editors 1112

thefirst() function 282, 294

THETA constant 277

three() function 349351

THURSDAY defined constant 262

tic-tac-toe 331352

approaching game mathematically 333334

basic game 334344

adding game play 337339

creating game grid 334337

determining winner 340344

limiting input to free squares 339340

computer plays 344352

adding intelligence 348352

choosing number of players 344346

coding dumb opponent 346348

playing 332333

time() function 23, 250251, 257, 278, 283, 286, 294, 319

time of day program 2327

adding general time info to greeting code 2526

adding specific time info to greeting code 2627

obtaining current time 2325

timespec structure 196

time_t data type 23, 278

time_t defined constant 225

time_t pointer 196

time_t variable 23

time zones 283285

time zone (TZ) environment variable 284285

tm_day member 252

tm_hour member 252

tm_isdst member 252

tm_mday member 252, 257, 286

tm_min member 252

tm_mon member 252, 257, 276

tm_sec member 252

tm structure 252254, 256257, 259, 276, 286, 291

tm_wday member 252, 259, 276, 286

tm_wday tm structure member 291

tm_yday member 252, 291

tm_year member 252

toblock() function 349

today tm structure 250

today variable 294

tohex() function 81, 9192

tolower() ctype function 78

tomatch constant 328, 330

tomatch variable 329

toMorse() function 143144

toupper() function 59, 78

towin() function 349

TREE command 220, 222

TREE utility 217218

Tsch shell 19

ttt01.c code 337

ttt02.c code 339

type data type 137

tzset() function 284285

TZ (time zone) environment variable 284285

U

Unicode 147148

unlink command 10

unsigned char pointer 174

unsigned long value 137

uppercase() function 98, 107

url_decoder01.c source code 92

URL encoder 8992

creating 9192

encoding rules 89

writing 9091

urlencoder program 90

UTF (Unicode Transformation Format) 148

V

value variable 318

version() function 190

vi editor 11

VIM text mode editor 11

vocabulary[] array 102, 107

-v switch 190

W

wait() function 249

-Wall switch 13

wchar_t buffer 158

wchar_t data type 150153

wday integer 261

wday variable 282

WEDNESDAY enumerated constant 281

week01.c program 286

weekday variable 286, 294, 298, 301

weekend() function 261, 268, 271

weekno variable 291

WEOF end-of-file marker 162

wide character programming 148163

character types 150152

generating output 152156

locale settings 149150

receiving input 156160

working with wide characters in files 160163

wide_hello.c program 154

wide_in.c source code 158

wildcards,using to find files 232234

winner() function 327328, 341343

winners[] array 321

wint_t ch single wint_t variable 162

wint_t data type 160, 162

word[] buffer 48, 6667

words 165

wprintf()() function 152153, 155156, 158, 162

wscanf() function 158159

WSL (Windows Subsystem for Linux) 9, 17

X

XCode IDE 79

Y

year01.c code 295, 298299

year03.c code 308

year04.c code 310

year program 295, 303, 306

year variable 294

yen wchar_t variable 151, 155

yen wide character 151

Z

zsh shell 11, 19, 130

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.22.169