Next: , Up: pathname   [Contents][Index]


8.1 Type definitions for the pathname trait

Struct Typedef: ccstructs_pathname_T

Type of the pathname trait. Instances of this type are meant to be handed by value to function calls.

Struct Typedef: ccstructs_pathname_T_methods_t

Type of methods table for the pathname trait. It has the following fields:

ccname_trait_method_type(ccstructs_pathname_T, asciiz) * asciiz

Pointer to function implementing the asciiz() method.

ccname_trait_method_type(ccstructs_pathname_T, is_static) * is_static

Pointer to function implementing the is_static() method.

ccname_trait_method_type(ccstructs_pathname_T, is_absolute) * is_absolute

Pointer to function implementing the is_absolute() method.

ccname_trait_method_type(ccstructs_pathname_T, is_relative) * is_relative

Pointer to function implementing the is_relative() method.

ccname_trait_method_type(ccstructs_pathname_T, is_normalised) * is_normalised

Pointer to function implementing the is_normalised() method.

ccname_trait_method_type(ccstructs_pathname_T, is_realpath) * is_realpath

Pointer to function implementing the is_realpath() method.

ccname_trait_method_type(ccstructs_pathname_T, dtor) * dtor

Pointer to function implementing the dtor() method.

ccname_trait_method_type(ccstructs_pathname_T, dumpable) * dumpable

Pointer to function implementing the dumpable() method.

ccname_trait_method_type(ccstructs_pathname_T, serialiser) * serialiser

Pointer to function implementing the serialiser() method.

ccname_trait_method_type(ccstructs_pathname_T, deserialiser) * deserialiser

Pointer to function implementing the deserialiser() method.

Function Prototype: ccmem_asciiz_t ccname_trait_method_type(ccstructs_pathname_T, asciiz) (cce_destination_t L, ccstructs_pathname_T I)

Type of functions implementing the asciiz() method. Return an instance of ccmem_asciiz_t holding an ASCIIZ representation of the pathname. If an error occurs generating the representation: raise an exception by performing a non–local exit to L.

Function Prototype: bool ccname_trait_method_type(ccstructs_pathname_T, is_static) (ccstructs_pathname_T I)

Type of functions implementing the is_static() method. In general, the user of I should make a copy of the ASCIIZ pathname representation, returned by the asciiz() method, if it needs to keep it independently from the extent (the lifetime) of I; but if this function returns true: it can rely on the existence of the representation for the time it needs it.

Function Prototype: bool ccname_trait_method_type(ccstructs_pathname_T, is_absolute) (cce_destination_t L, ccstructs_pathname_T I)

Type of functions implementing the is_absolute() method. When successful: return true is the pathname is absolute; otherwise return false. If an error occurs (for example: because this method is not implemented): raise an exception by performing a non–local exit to L.

Function Prototype: bool ccname_trait_method_type(ccstructs_pathname_T, is_relative) (cce_destination_t L, ccstructs_pathname_T I)

Type of functions implementing the is_relative() method. When successful: return true is the pathname is relative; otherwise return false. If an error occurs (for example: because this method is not implemented): raise an exception by performing a non–local exit to L.

Function Prototype: bool ccname_trait_method_type(ccstructs_pathname_T, is_normalised) (cce_destination_t L, ccstructs_pathname_T I)

Type of functions implementing the is_normalised() method. When successful: return true is the pathname has been normalised with a procedure not involving access to the file system; otherwise return false. If an error occurs (for example: because this method is not implemented): raise an exception by performing a non–local exit to L.

Examples of normalisation for a Unix pathname: removal of redundant dots; removal of redundant double–dots; removal of double–slashes.

Function Prototype: bool ccname_trait_method_type(ccstructs_pathname_T, is_realpath) (cce_destination_t L, ccstructs_pathname_T I)

Type of functions implementing the is_realpath() method. When successful: return true is the pathname has been normalised with a function like the standard realpath(); otherwise return false. If an error occurs (for example: because this method is not implemented): raise an exception by performing a non–local exit to L.

Function Prototype: ccstructs_dtor_T ccname_trait_method_type(ccstructs_pathname_T, dtor) (ccstructs_pathname_T I)

Type of functions implementing the dtor() method. Return an instance of the ccstructs_dtor_T trait that destroys the underlying pathname representation; The dtor trait.

Function Prototype: ccstructs_dumpable_T ccname_trait_method_type(ccstructs_pathname_T, dumpable) (cce_destination_t L, ccstructs_pathname_T I)

Type of functions implementing the dumpable() method. Return an instance of the ccstructs_dumpable_T that prints the underlying pathname representation; The dumpable trait. If an error occurs creating the trait (for example: because the trait is not implemented): raise an exception by performing a non–local exit to L.

Function Prototype: ccstructs_serialiser_T ccname_trait_method_type(ccstructs_pathname_T, serialiser) (cce_destination_t L, ccstructs_pathname_T I)

Type of functions implementing the serialiser() method. Return an instance of the ccstructs_serialiser_T that serialises the underlying pathname representation; The serialiser trait. If an error occurs creating the trait (for example: because the trait is not implemented): raise an exception by performing a non–local exit to L.

Function Prototype: ccstructs_deserialiser_T ccname_trait_method_type(ccstructs_pathname_T, deserialiser) (cce_destination_t L, ccstructs_pathname_T I)

Type of functions implementing the deserialiser() method. Return an instance of the ccstructs_deserialiser_T that deserialises the underlying pathname representation; The deserialiser trait. If an error occurs creating the trait (for example: because the trait is not implemented): raise an exception by performing a non–local exit to L.


Next: , Up: pathname   [Contents][Index]

This document describes version 0.3.0-devel.3 of CCStructs.