Programming, using and understanding
Pike
by Fredrik Hübinette
Table of contents
- Preface
- Table of contents
- Introduction
- Overview
- The history of Pike
- A comparison with other languages
- What is Pike
- How to read this manual
- 1 Getting started
- 1.1 Your first Pike program
- 1.2 Improving hello_world.pike
- 1.3 Further improvements
- 1.4 Control structures
- 1.5 Functions
- 1.6 True and false
- 1.7 Data Types
- 2 A more elaborate example
- 2.1 Taking care of input
- 2.1.1 add_record()
- 2.1.2 main()
- 2.2 Communicating with files
- 2.2.1 save()
- 2.2.2 load()
- 2.2.3 main() revisited
- 2.3 Completing the program
- 2.3.1 delete()
- 2.3.2 search()
- 2.3.3 main() again
- 2.4 Then what?
- 2.5 Simple exercises
- 3 Control Structures
- 3.1 Conditions
- 3.1.1 if
- 3.1.2 switch
- 3.2 Loops
- 3.2.1 while
- 3.2.2 for
- 3.2.3 do-while
- 3.2.4 foreach
- 3.3 Breaking out of loops
- 3.3.1 break
- 3.3.2 continue
- 3.3.3 return
- 3.4 Exercises
- 4 Data types
- 4.1 Basic types
- 4.1.1 int
- 4.1.2 float
- 4.1.3 string
- 4.2 Pointer types
- 4.2.1 array
- 4.2.2 mapping
- 4.2.3 multiset
- 4.2.4 program
- 4.2.5 object
- 4.2.6 function
- 4.3 Sharing data
- 4.4 Writing data types
- 5 Operators
- 5.1 Arithmetic operators
- 5.2 Comparison operators
- 5.3 Logical operators
- 5.4 Bitwise/set operators
- 5.5 Indexing
- 5.6 The assignment operators
- 5.7 The rest of the operators
- 5.8 Operator precedence
- 5.9 Operator functions
- 6 Object orientation
- 6.1 Terminology
- 6.2 The approach
- 6.3 How does this help?
- 6.4 Pike and object orientation
- 6.5 Inherit
- 6.6 Multiple inherit
- 6.7 Pike inherit compared to other languages
- 6.8 Modifiers
- 6.9 Operator overloading
- 6.10 Simple exercises
- 7 Miscellaneous functions
- 7.1 sscanf
- 7.2 catch & throw
- 7.3 gauge
- 7.4 typeof
- 8 Modules
- 8.1 How to use modules
- 8.2 Where do modules come from?
- 8.3 The . operator
- 8.4 How to write a module
- 8.5 Simple exercises
- 9 File I/O
- 9.1 File management - Stdio.File
- 9.2 Buffered file management - Stdio.FILE
- 9.3 Standard streams - Stdio.stdin, stdout and stderr
- 9.4 Listening to sockets - Stdio.Port
- 9.5 UDP socket and message management - Stdio.UDP
- 9.6 Terminal management - Stdio.Terminfo
- 9.6.1 Stdio.Terminfo.Termcap
- 9.6.2 Stdio.Terminfo.Terminfo
- 9.7 Simple input-by-prompt - Stdio.Readline
- 9.8 Other Stdio functions
- 9.9 A simple example
- 9.10 A more complex example - a simple WWW server
- 10 Threads
- 10.1 Starting a thread
- 10.2 Threads reference section
- 10.3 Threads example
- 11 Modules for specific data types
- 11.1 String
- 11.2 Array
- 12 Image
- 12.1 Image.Image
- 12.2 Image.Colortable
- 12.3 Image.Layer
- 12.4 Image.Font
- 12.5 Image.colortable
- 12.6 Image.Poly
- 12.7 Image.Color
- 12.7.1 Image.Color.Color
- 12.8 Image.X
- 12.9 Image.ANY
- 12.10 Image.AVS
- 12.11 Image.BMP
- 12.12 Image.GD
- 12.13 Image.GIF
- 12.14 Image.JPEG
- 12.15 Image.TIFF
- 12.16 Image.TTF
- 12.16.1 Image.TTF.Face
- 12.16.2 Image.TTF.FaceInstance
- 12.17 Image.XFace
- 12.18 Image.HRZ
- 12.19 Image.ILBM
- 12.20 Image.PCX
- 12.21 Image.PNG
- 12.22 Image.PNM
- 12.23 Image.PSD
- 12.24 Image.TGA
- 12.25 Image.XBM
- 12.26 Image.XCF
- 12.27 Image.XWD
- 13 Protocols
- 13.1 Protocols.HTTP
- 13.1.1 Protocols.HTTP.Query
- 13.2 Protocols.LysKOM
- 13.2.1 Protocols.LysKOM.Session
- 13.2.2 Protocols.LysKOM.Connection
- 13.2.3 Protocols.LysKOM.Request
- 13.2.3.1 Protocols.LysKOM.Request._Request
- 13.3 Protocols.DNS
- 13.3.1 Protocols.DNS.client
- 14 Other modules
- 14.1 System
- 14.2 Process
- 14.3 Regexp
- 14.4 Gmp
- 14.5 Gdbm
- 14.6 Getopt
- 14.7 Gz
- 14.8 Yp
- 14.9 ADT.Table
- 14.10 Yabu transaction database
- 14.10.1 The database
- 14.10.2 Tables
- 14.10.3 Transactions
- 14.11 MIME
- 14.11.1 Global functions
- 14.11.2 The MIME.Message class
- 14.11.2.1 Public fields
- 14.11.2.2 Public methods
- 14.12 Simulate
- 14.13 Mysql.mysql
- 14.14 The Pike Crypto Toolkit
- 14.14.1 Introduction
- 14.14.2 Block ciphers
- 14.14.3 Stream Ciphers
- 14.14.4 Hash Functions
- 14.14.5 Public key algorithms
- 14.14.6 Combining block cryptos
- 14.15 Locale.Gettext
- 14.16 Calendar
- 14.16.1 Calendar.Calendar
- 14.16.2 Calendar.TimeRange
- 14.16.3 Calendar.SuperTimeRange
- 14.16.4 Calendar.Austrian
- 14.16.5 Calendar.Coptic
- 14.16.6 Calendar.Discordian
- 14.16.7 Calendar.Event
- 14.16.8 Calendar.Gregorian
- 14.16.9 Calendar.ISO
- 14.16.10 Calendar.Julian
- 14.16.11 Calendar.Roman
- 14.16.12 Calendar.Stardate
- 14.16.13 Calendar.Swedish
- 14.16.14 Calendar.TZnames
- 14.16.15 Calendar.Time
- 14.16.15.1 Calendar.Time.TimeOfDay
- 14.16.15.2 Calendar.Time.SuperTimeRange
- 14.16.15.3 Calendar.Time.Hour
- 14.16.15.4 Calendar.Time.Minute
- 14.16.15.5 Calendar.Time.Second
- 14.16.15.6 Calendar.Time.Fraction
- 14.16.16 Calendar.Timezone
- 14.16.17 Calendar.YMD
- 14.16.17.1 Calendar.YMD.YMD
- 14.16.17.2 Calendar.YMD.Year
- 14.16.17.3 Calendar.YMD.Week
- 14.16.17.4 Calendar.YMD.Hour
- 14.17 Parser
- 14.17.1 Parser.HTML
- 14.18 Math
- 14.18.1 Math.Matrix
- 14.19 Calendar.Calendar
- 14.20 Calendar.TimeRange
- 14.21 Calendar.SuperTimeRange
- 14.22 Calendar.Austrian
- 14.23 Calendar.Coptic
- 14.24 Calendar.Discordian
- 14.25 Calendar.Event
- 14.26 Calendar.Gregorian
- 14.27 Calendar.ISO
- 14.28 Calendar.Julian
- 14.29 Calendar.Roman
- 14.30 Calendar.Stardate
- 14.31 Calendar.Swedish
- 14.32 Calendar.TZnames
- 14.33 Calendar.Time
- 14.33.1 Calendar.Time.TimeOfDay
- 14.33.2 Calendar.Time.SuperTimeRange
- 14.33.3 Calendar.Time.Hour
- 14.33.4 Calendar.Time.Minute
- 14.33.5 Calendar.Time.Second
- 14.33.6 Calendar.Time.Fraction
- 14.34 Calendar.Timezone
- 14.35 Calendar.YMD
- 14.35.1 Calendar.YMD.YMD
- 14.35.2 Calendar.YMD.Year
- 14.35.3 Calendar.YMD.Week
- 14.35.4 Calendar.YMD.Hour
- 14.36 Calendar_I.time_unit
- 14.37 Calendar_I.Gregorian
- 14.37.1 Calendar_I.Gregorian.
- 14.37.2 Calendar_I.Gregorian.Year
- 14.37.3 Calendar_I.Gregorian.Stardate
- 14.37.3.1 Calendar_I.Gregorian.Stardate.TNGDate
- 14.38 Crypto.randomness
- 14.38.1 Crypto.randomness.pike_random
- 14.38.2 Crypto.randomness.arcfour_random
- 14.39 Geographical.Position
- 14.40 Geographical.Countries
- 14.41 Image.Product(string name, string version)
- 14.42 Parser.SGML
- 14.43 Protocols.HTTP
- 14.43.1 Protocols.HTTP.Query
- 14.44 Protocols.LysKOM
- 14.44.1 Protocols.LysKOM.Session
- 14.44.2 Protocols.LysKOM.Connection
- 14.44.3 Protocols.LysKOM.Request
- 14.44.3.1 Protocols.LysKOM.Request._Request
- 14.45 Protocols.DNS
- 14.45.1 Protocols.DNS.client
- 14.46 Mird.Glue
- 14.46.1 Mird.Glue.Mird
- 14.46.2 Mird.Glue.Transaction
- 14.46.3 Mird.Glue.Scanner
- 14.47 SANE.Scanner
- 15 The preprocessor
- 16 Builtin functions
- 17 Pike internals - how to extend Pike
- 17.1 The master object
- 17.2 Data types from the inside
- 17.2.1 Basic data types
- 17.2.2 struct svalue
- 17.2.3 struct pike_string
- 17.2.4 struct array
- 17.2.5 struct mapping
- 17.2.6 struct object
- 17.2.7 struct program
- 17.3 The interpreter
- Appendix A Terms and jargon
- Appendix B Register program
- Appendix C Reserved words
- Appendix D BNF for Pike
- Appendix E How to install Pike
- Appendix F How to convert from old versions of Pike
- Appendix G Image.Layer modes
- Appendix H Image.Color colors
- Index