Common Lisp Package: ORG.MIDDLEANGLE.GENERATE-BLAPACK-INTERFACE

README:

FUNCTION

Public

Undocumented

GENERATE-BLAPACK-FILES (&OPTIONAL (BASEDIR *BASEDIR*))

Private

DEPARENTHESIZE (LINE)

Get rid of stupid parentheses around array arguments.

EXTRACT-CONTINUED-LINE

Fortran can't have long lines, and so will use a $ in column 7 to indicate a continued line. We'll pop off these $'s and put them together into one line, and return that extended line and the remainder.

FORTRAN-TRANSFORM (NAME)

Turns a fortran library function into a C library function. May need to be customized.

GENERATE-BINDINGS-FILE (FILENAME PACKAGE-NAME NICKNAME BINDINGS &OPTIONAL (OUTDIR *OUTDIR*))

This does the bulk of the work in getting things automagically done, and is used by generate-blas-bindings etc to automagically do the CFFI binding file.

PARSE-SIGNATURE

Parses the name of the function and the names of all the arguments. Returns three values: the name, the list of arguments, and all remaining lines.

READ-LINES (FILE)

Returns a list of strings, one string per line of file.

SAFE-STRING (STRING)

Use of T as an argument is a proble -- in particular, there are issues with CFFI when using T as a function arg vs. the CL value.

TERPRI2 (STR)

Square the terpri!

TO-STRING (CHAR-LIST)

Original def: (let* ((n (length char-list)) (s (make-string n))) (dotimes (i n) (setf (char s i) (elt char-list i))) s))

TOKENIZE (LINE)

Tokenizes a line. Removes spaces and commas.

Undocumented

CFFI-TYPE-TO-FORTRAN-TYPE (CFFI-TYPE)

COMMENT-LINE-P (LINE)

EXTRACT-TYPE (LINE)

FILL-IN-TYPE (NAMES TYPE VARS ARRAY-MAPS)

GENERATE-BLAS-FILE

GENERATE-CFFI-INTERFACE (PARSED-REPRESENTATION)

GENERATE-LAPACK-FILE

LOOKUP-TYPE (TYPE-STRING-LIST &OPTIONAL (RETURN-TYPE NIL))

PARSE-ARGUMENT-TYPES (NAMES)

PARSE-BLAS-FILES (&OPTIONAL (BASEDIR *BASEDIR*))

PARSE-FORTRAN-FILE (FORTRAN-FILE)

PARSE-LAPACK-FILES (&OPTIONAL (BASEDIR *BASEDIR*))

MACRO

Private

Undocumented

FORTRAN-DIR-PARSING-FN (FN-NAME FORTRAN-FILES-WILDCARD-STRING)

VARIABLE

Private

*LINES*

This special variable holds the lines of the file currently being parsed. It's a kludge that makes life easy.

Undocumented

*BASEDIR*

*CTYPE-TO-FORTRANTYPE*

*OUTDIR*

*TYPEMAP*

*TYPES*