Preface
Part Ⅰ. C Patterns
1.ErrorHandling
Running Example
Function Split
Guard Clause
Samurai Principle
Goto Error Handling
Cleanup Record
Object—Based Error Handling
Summary
Further Reading
0uflook
2.Returning Error Information
Running Example
Return Status Codes
Return Relevant Errors
Special Return Values
Log Errors
Summary
Further Reading
0utlook
3.MemowManagement
Data Storage and Problems with Dynamic Men
Running Example
Stack First
Eternal Memory
Lazy Cleanup
Dedicated Ownership
Allocation Wrapper
Pointer Check
Memory Pool
Summary
Further Reading
0utlook
4.ReturningDatafromC Functions
Running Example
Return V甜ue
out.Parameters
Aggregate Instance
Immutable Instance
Caller.Owned Buffer
Callee灿locates
Summary
0utlook
5.Data LifetimeandOwnership
Stateless Software—Module
Software.Module with Global State
Caller.Owned Instance
Shared Instance