ajfmt.c


Function ajFmtPuts

Format and emit the converted numeric (ajFmtPutd) or string (ajFmtPuts) in str[0..len-1] according to Fmt's defaults and the values of flags,width and precision. It is a c.r.e for str=null, len less than 0 or flags=null.

Prototype

void ajFmtPuts (
      const char* str,
      ajint len,
      int function put,
      void* cl,
      const ajuint* flags,
      ajint width,
      ajint precision
);

TypeNameRead/WriteDescription
const char*strInputText to write.
ajintlenInputText length.
int functionputFunctionStandard function.
void*clModifyStandard - where to write the output
const ajuint*flagsInputFlags (after the %)
ajintwidthInputWidth (before the dot)
ajintprecisionInputPrecision (after the dot)
void RETURN

From EMBOSS 1.0.0


Function ajFmtFmt

formats and emits the "..." arguments according to the format string fmt

Prototype

void ajFmtFmt (
      ajint function put,
      void* cl,
      const char* fmt,
      ...
);

TypeNameRead/WriteDescription
ajint functionputFunctionStandard function.
void*clModifyStandard - where to write the output
const char*fmtInputFormat string
...varargVarargVariable length argument list
void RETURN

From EMBOSS 1.0.0


Function ajFmtPrint

format and emit the "..." arguments according to fmt;writes to stdout.

Prototype

void ajFmtPrint (
      const char* fmt,
      ...
);

TypeNameRead/WriteDescription
const char*fmtInputFormat string.
...varargVarargVariable length argument list
void RETURN

From EMBOSS 1.0.0


Function ajFmtVPrint

format and emit the "..." arguments according to fmt;writes to stdout.

Prototype

void ajFmtVPrint (
      const char* fmt,
      va_list ap
);

TypeNameRead/WriteDescription
const char*fmtInputFormat string.
va_listapVarargVariable length argument list
void RETURN

From EMBOSS 1.0.0


Function ajFmtError

format and emit the "..." arguments according to fmt;writes to stderr.

Prototype

void ajFmtError (
      const char* fmt,
      ...
);

TypeNameRead/WriteDescription
const char*fmtInputFormat string.
...varargVarargVariable length argument list
void RETURN

From EMBOSS 1.0.0


Function ajFmtVError

format and emit the "..." arguments according to fmt. Writes to stderr.

Prototype

void ajFmtVError (
      const char* fmt,
      va_list ap
);

TypeNameRead/WriteDescription
const char*fmtInputFormat string.
va_listapVarargVariable length argument list
void RETURN

From EMBOSS 1.0.0


Function ajFmtPrintF

format and emit the "..." arguments according to fmt;writes to stream..

Prototype

void ajFmtPrintF (
      AjPFile file,
      const char* fmt,
      ...
);

TypeNameRead/WriteDescription
AjPFilefileModifyOutput file.
const char*fmtInputFormat string.
...varargVarargVariable length argument list
void RETURN

From EMBOSS 1.0.0


Function ajFmtVPrintF

format and emit the "..." arguments according to fmt;writes to stream..

Prototype

void ajFmtVPrintF (
      AjPFile file,
      const char* fmt,
      va_list ap
);

TypeNameRead/WriteDescription
AjPFilefileModifyOutput file.
const char*fmtInputFormat string.
va_listapVarargVariable length argument list
void RETURN

From EMBOSS 1.0.0


Function ajFmtVPrintFp

Format and emit the "..." arguments according to fmt;writes to stream..

Prototype

void ajFmtVPrintFp (
      FILE* stream,
      const char* fmt,
      va_list ap
);

TypeNameRead/WriteDescription
FILE*streamModifyOutput file.
const char*fmtInputFormat string.
va_listapVarargVariable length argument list
void RETURN

From EMBOSS 1.0.0


Function ajFmtPrintFp

format and emit the "..." arguments according to fmt;writes to stream..

Prototype

void ajFmtPrintFp (
      FILE* stream,
      const char* fmt,
      ...
);

TypeNameRead/WriteDescription
FILE*streamModifyOutput file.
const char*fmtInputFormat string.
...varargVarargVariable length argument list
void RETURN

From EMBOSS 1.0.0


Function ajFmtVPrintCL

formats the "..." arguments into buf[1...size-1] according to fmt, appends a num character, and returns the length of buf. It is a c.r.e for size to be less than or equal to 0. Raises Fmt_Overflow if more than size-1 characters are emitted.

Prototype

ajint ajFmtVPrintCL (
      char* buf,
      ajint size,
      const char* fmt,
      va_list ap
);

TypeNameRead/WriteDescription
char*bufOutputchar string to be written to.
ajintsizeInputlength of buffer
const char*fmtInputFormat string.
va_listapVarargVariable length argument list
ajint RETURNnumber of characters written to buf.

From EMBOSS 1.0.0


Function ajFmtPrintCL

formats the "..." arguments into buf[1...size-1] according to fmt, appends a num character, and returns the length of buf. It is a c.r.e for size to be lass than or equal to 0. Raises Fmt_Overflow if more than size-1 characters are emitted.

Prototype

ajint ajFmtPrintCL (
      char* buf,
      ajint size,
      const char* fmt,
      ...
);

TypeNameRead/WriteDescription
char*bufOutputchar string to be written to.
ajintsizeInputlength of buffer
const char*fmtInputFormat string
...varargVarargVariable length argument list
ajint RETURNnumber of characters written to buf.

From EMBOSS 1.0.0


Function ajFmtStr

Formats the "..." arguments into a New AjPStr according to fmt. It starts with an initial size of 20 then doubles until the fmt output fits.

Prototype

AjPStr ajFmtStr (
      const char* fmt,
      ...
);

TypeNameRead/WriteDescription
const char*fmtInputFormat string.
...varargVarargVariable length argument list
AjPStr RETURNnew AjPStr with Ptr holding formatted chars

From EMBOSS 1.0.0


Function ajFmtPrintS

Formats the "..." arguments into an AjPStr according to fmt. If AjPStr is not large enough then if it is the only one i.e Use = 1 then increase till it fits. Else return 0 if it does not fit. If it fits return the address of the new AjPStr.

Prototype

AjPStr ajFmtPrintS (
      AjPStr* pthis,
      const char* fmt,
      ...
);

TypeNameRead/WriteDescription
AjPStr*pthisModifyString to be written too.
const char*fmtInputFormat for string.
...varargVarargVariable length argument list
AjPStr RETURNOutput string

From EMBOSS 1.0.0


Function ajFmtVPrintS

Formats the "..." arguments into an AjPStr according to fmt. If AjPStr is not large enough then if it is the only one i.e Use = 1 then increase till it fits. Else return 0 if it does not fit. If it fits return the address of the new AjPStr.

Prototype

AjPStr ajFmtVPrintS (
      AjPStr* pthis,
      const char* fmt,
      va_list ap
);

TypeNameRead/WriteDescription
AjPStr*pthisModifyString to be written too.
const char*fmtInputFormat for string.
va_listapVarargVariable length argument list
AjPStr RETURNOutput string

From EMBOSS 2.7.0


Function ajFmtPrintAppS

Formats the "..." arguments and appends to an AjPStr according to fmt. If AjPStr is not large enough then if it is the only one i.e Use = 1 then increase till it fits. Else return 0 if it does not fit. If it fits return the address of the new AjPStr.

Prototype

AjPStr ajFmtPrintAppS (
      AjPStr* pthis,
      const char* fmt,
      ...
);

TypeNameRead/WriteDescription
AjPStr*pthisModifyString to be written too.
const char*fmtInputFormat for string.
...varargVarargVariable length argument list
AjPStr RETURNOutput string.

From EMBOSS 1.0.0


Function ajFmtVfmtStrCL

Same as ajFmtPrintCL but takes arguments from the list ap.

Prototype

ajint ajFmtVfmtStrCL (
      char** pbuf,
      ajint pos,
      size_t* size,
      const char* fmt,
      va_list ap
);

TypeNameRead/WriteDescription
char**pbufOutputchar string to be written to.
ajintposInputposition in buffer to start writing
size_t*sizeModifyallocated size of the buffer
const char*fmtInputFormat string.
va_listapVarargVariable length argument list.
ajint RETURNnumber of characters written to buf.

From EMBOSS 2.4.0


Function ajFmtVfmtCL

Same as ajFmtPrintCL but takes arguments from the list ap.

Prototype

ajint ajFmtVfmtCL (
      char* buf,
      ajint size,
      const char* fmt,
      va_list ap
);

TypeNameRead/WriteDescription
char*bufOutputchar string to be written to.
ajintsizeInputlength of buffer
const char*fmtInputFormat string.
va_listapVarargVariable length argument list.
ajint RETURNnumber of characters written to buf.

From EMBOSS 1.0.0


Function ajFmtString

formats the "..." arguments into a null-terminated string according to fmt and returns that string.

Prototype

char* ajFmtString (
      const char* fmt,
      ...
);

TypeNameRead/WriteDescription
const char*fmtInputFormat string
...varargVarargVariable length argument list
char* RETURNOutput string.

From EMBOSS 1.0.0


Function ajFmtVString

as ajFmtString but takes arguments from the list ap.

Prototype

char* ajFmtVString (
      const char* fmt,
      va_list ap
);

TypeNameRead/WriteDescription
const char*fmtInputFormat string.
va_listapVarargVariable length argument list.
char* RETURNOutput string.

From EMBOSS 1.0.0


Function ajFmtVfmt

as ajFmtPrint but takes arguments from the list ap.

Prototype

void ajFmtVfmt (
      int function put,
      void* cl,
      const char* fmt,
      va_list ap
);

TypeNameRead/WriteDescription
int functionputFunctionStandard function
void*clModifyWhere we are going to write the results
const char*fmtInputFormat string
va_listapVarargVariable argument list
void RETURN

From EMBOSS 1.0.0


Function ajFmtPutd

Given a string containing a number in full, converts it using the width and precision values.

Prototype

void ajFmtPutd (
      const char* str,
      ajint len,
      int function put,
      void* cl,
      const ajuint* flags,
      ajint width,
      ajint precision
);

TypeNameRead/WriteDescription
const char*strInputText to write.
ajintlenInputText length.
int functionputFunctionStandard function.
void*clModifyStandard - where to write the output
const ajuint*flagsInputFlags (after the %)
ajintwidthInputWidth (before the dot)
ajintprecisionInputPrecision (after the dot)
void RETURN

From EMBOSS 1.0.0


Function ajFmtPrintSplit

Block and print a string. String is split at given delimiters

Prototype

void ajFmtPrintSplit (
      AjPFile outf,
      const AjPStr str,
      const char* prefix,
      ajint len,
      const char* delim
);

TypeNameRead/WriteDescription
AjPFileoutfModifyoutput stream
const AjPStrstrInputtext to write
const char*prefixInputprefix string
ajintlenInputmaximum span
const char*delimInputdelimiter string
void RETURN

From EMBOSS 1.8.0


Function ajFmtScanS

Scan a string according to fmt and load the ... variable pointers Like C function sscanf.

Prototype

ajint ajFmtScanS (
      const AjPStr thys,
      const char* fmt,
      ...
);

TypeNameRead/WriteDescription
const AjPStrthysInputString.
const char*fmtInputFormat string.
...varargVarargVariable length argument list
ajint RETURNnumber of successful conversions

From EMBOSS 1.10.0


Function ajFmtScanC

Scan a string according to fmt and load the ... variable pointers Like C function sscanf.

Prototype

ajint ajFmtScanC (
      const char* thys,
      const char* fmt,
      ...
);

TypeNameRead/WriteDescription
const char*thysInputString.
const char*fmtInputFormat string.
...varargVarargVariable length argument list
ajint RETURNnumber of successful conversions

From EMBOSS 2.8.0


Function ajFmtScanF

Scan an AjPFile object according to fmt and load the ... variable pointers Like C function fscanf.

Prototype

ajint ajFmtScanF (
      AjPFile thys,
      const char* fmt,
      ...
);

TypeNameRead/WriteDescription
AjPFilethysModifyInput file object
const char*fmtInputFormat string.
...varargVarargVariable length argument list
ajint RETURNnumber of successful conversions

From EMBOSS 3.0.0