ajutil.c

Datatypes:
none Exit functions


Datatype: none

Sections:
exitMiscellaneous


Section: exit

Functions for exiting cleanly.

Functions:
ajExitCalls 'exit' with a successful code (zero), but first calls ajReset to call memory clean up and debug reporting functions.
ajExitAbortExits without flushing any files. Needed for exit from, for example, a failed system call (ajFileNewInPipe, and so on) where the parent process has open output files, and the child process needs to exit without affecting them. Failure to exit this way can mean the output buffer is flushed twice.
ajExitBadCalls 'exit' with an unsuccessful code (EXIT_FAILURE defined in stdlib.h).


Function ajExit

Calls 'exit' with a successful code (zero), but first calls ajReset to call memory clean up and debug reporting functions.

Prototype

void ajExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 1.0.0


Function ajExitAbort

Exits without flushing any files. Needed for exit from, for example, a failed system call (ajFileNewInPipe, and so on) where the parent process has open output files, and the child process needs to exit without affecting them. Failure to exit this way can mean the output buffer is flushed twice.

Prototype

void ajExitAbort (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 3.0.0


Function ajExitBad

Calls 'exit' with an unsuccessful code (EXIT_FAILURE defined in stdlib.h).

Prototype

void ajExitBad (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 1.0.0


Section: reset

Functions for memory cleanup

Functions:
ajResetCleans up all internal memory by calling cleanup routines which can report on resource usage etc.


Function ajReset

Cleans up all internal memory by calling cleanup routines which can report on resource usage etc.

Prototype

void ajReset (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 5.0.0


Section: byte manipulation functions

Functions for manipulating bytes.

Functions:
ajByteRevIntReverses the byte order in an integer.
ajByteRevLen2Reverses the byte order in a 2 byte integer.
ajByteRevLen2uReverses the byte order in a 2 byte integer.
ajByteRevLen4Reverses the byte order in a 4 byte integer.
ajByteRevLen4uReverses the byte order in a 4 byte integer.
ajByteRevLen8Reverses the byte order in an 8 byte long.
ajByteRevLen8uReverses the byte order in an 8 byte long.
ajByteRevLongReverses the byte order in a long.
ajByteRevShortReverses the byte order in a short integer.
ajByteRevUintReverses the byte order in an unsigned integer.
ajByteRevUlongReverses the byte order in an unsigned long.


Function ajByteRevInt

Reverses the byte order in an integer.

Prototype

void ajByteRevInt (
      ajint* ival
);

TypeNameRead/WriteDescription
ajint*ivalModifyInteger in wrong byte order. Returned in correct order.
void RETURN

From EMBOSS 5.0.0


Function ajByteRevLen2

Reverses the byte order in a 2 byte integer.

Prototype

void ajByteRevLen2 (
      ajshort* sval
);

TypeNameRead/WriteDescription
ajshort*svalModifyShort integer in wrong byte order. Returned in correct order.
void RETURN

From EMBOSS 5.0.0


Function ajByteRevLen2u

Reverses the byte order in a 2 byte integer.

Prototype

void ajByteRevLen2u (
      ajushort* sval
);

TypeNameRead/WriteDescription
ajushort*svalModifyShort integer in wrong byte order. Returned in correct order.
void RETURN

From EMBOSS 6.2.0


Function ajByteRevLen4

Reverses the byte order in a 4 byte integer.

Prototype

void ajByteRevLen4 (
      ajint* ival
);

TypeNameRead/WriteDescription
ajint*ivalModifyInteger in wrong byte order. Returned in correct order.
void RETURN

From EMBOSS 5.0.0


Function ajByteRevLen4u

Reverses the byte order in a 4 byte integer.

Prototype

void ajByteRevLen4u (
      ajuint* ival
);

TypeNameRead/WriteDescription
ajuint*ivalModifyInteger in wrong byte order. Returned in correct order.
void RETURN

From EMBOSS 6.2.0


Function ajByteRevLen8

Reverses the byte order in an 8 byte long.

Prototype

void ajByteRevLen8 (
      ajlong* lval
);

TypeNameRead/WriteDescription
ajlong*lvalModifyInteger in wrong byte order. Returned in correct order.
void RETURN

From EMBOSS 5.0.0


Function ajByteRevLen8u

Reverses the byte order in an 8 byte long.

Prototype

void ajByteRevLen8u (
      ajulong* lval
);

TypeNameRead/WriteDescription
ajulong*lvalModifyInteger in wrong byte order. Returned in correct order.
void RETURN

From EMBOSS 6.2.0


Function ajByteRevLong

Reverses the byte order in a long.

Prototype

void ajByteRevLong (
      ajlong* lval
);

TypeNameRead/WriteDescription
ajlong*lvalModifyInteger in wrong byte order. Returned in correct order.
void RETURN

From EMBOSS 5.0.0


Function ajByteRevShort

Reverses the byte order in a short integer.

Prototype

void ajByteRevShort (
      ajshort* sval
);

TypeNameRead/WriteDescription
ajshort*svalModifyShort integer in wrong byte order. Returned in correct order.
void RETURN

From EMBOSS 5.0.0


Function ajByteRevUint

Reverses the byte order in an unsigned integer.

Prototype

void ajByteRevUint (
      ajuint* ival
);

TypeNameRead/WriteDescription
ajuint*ivalModifyUnsigned integer in wrong byte order. Returned in correct order.
void RETURN

From EMBOSS 5.0.0


Function ajByteRevUlong

Reverses the byte order in an unsigned long.

Prototype

void ajByteRevUlong (
      ajulong* lval
);

TypeNameRead/WriteDescription
ajulong*lvalModifyInteger in wrong byte order. Returned in correct order.
void RETURN

From EMBOSS 6.4.0


Section: Miscellaneous utility functions

Miscellaneous utility functions.

Functions:
ajUtilBase64DecodeCDecode a base 64 string
ajUtilBase64EncodeCDecode a base 64 string
ajUtilCatchDummy function to be called in special cases so it can be used when debugging in GDB.
ajUtilGetBigendianTests whether the host system uses big endian byte order.
ajUtilGetUidReturns the user's userid
ajUtilLoginfoIf a log file is in use, writes run details to end of file.


Function ajUtilBase64DecodeC

Decode a base 64 string

Prototype

size_t ajUtilBase64DecodeC (
      AjPStr* Pdest,
      const char* src
);

TypeNameRead/WriteDescription
AjPStr*PdestOutputDecoded string
const char*srcInputsource base64 string
size_t RETURNLength of decoded string (zero if decode error)

From EMBOSS 6.4.0


Function ajUtilBase64EncodeC

Decode a base 64 string

Prototype

AjBool ajUtilBase64EncodeC (
      AjPStr* Pdest,
      size_t size,
      const unsigned char* src
);

TypeNameRead/WriteDescription
AjPStr*PdestModifyEncoded string
size_tsizeInputSize of data to encode
const unsigned char*srcInputsource data
AjBool RETURNTrue on success

From EMBOSS 6.4.0


Function ajUtilCatch

Dummy function to be called in special cases so it can be used when debugging in GDB.

Prototype

void ajUtilCatch (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 2.5.0


Function ajUtilGetBigendian

Tests whether the host system uses big endian byte order.

Prototype

AjBool ajUtilGetBigendian (
      void
);

TypeNameRead/WriteDescription
AjBool RETURNajTrue if host is big endian.

From EMBOSS 5.0.0


Function ajUtilGetUid

Returns the user's userid

Prototype

AjBool ajUtilGetUid (
      AjPStr* Puid
);

TypeNameRead/WriteDescription
AjPStr*PuidOutputString to return result
AjBool RETURNajTrue on success

From EMBOSS 5.0.0


Function ajUtilLoginfo

If a log file is in use, writes run details to end of file.

Prototype

void ajUtilLoginfo (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 5.0.0


Section: provenance

Functions providing information about the run-time environment

Functions:
ajUtilGetCmdlineReturns the original command line as qualifiers and values with newline delimiters
ajUtilGetInputsReturns the user non-default inputs in commandline form
ajUtilGetProgramReturns the application (program) name from the ACD definition.


Function ajUtilGetCmdline

Returns the original command line as qualifiers and values with newline delimiters

Prototype

const AjPStr ajUtilGetCmdline (
      void
);

TypeNameRead/WriteDescription
const AjPStr RETURNCommandline with newlines between qualifiers and parameters

From EMBOSS 6.2.0


Function ajUtilGetInputs

Returns the user non-default inputs in commandline form

Prototype

const AjPStr ajUtilGetInputs (
      void
);

TypeNameRead/WriteDescription
const AjPStr RETURNCommandline with newlines between qualifiers and parameters

From EMBOSS 6.2.0


Function ajUtilGetProgram

Returns the application (program) name from the ACD definition.

Prototype

const AjPStr ajUtilGetProgram (
      void
);

TypeNameRead/WriteDescription
const AjPStr RETURNProgram name

From EMBOSS 6.2.0