In this part:
"custody" includes confinement.
"defendant" means the person named as the defendant in—
(a) a habeas corpus order; or
(b) an application for a habeas corpus order.
"habeas corpus" order includes an order for the production of a person in custody for the purpose of examination or trial.