Common Lisp Package: TOOLS

README:

FUNCTION

Public

ADD-TIMER (DELAY FUN &OPTIONAL (ID (GENSYM)))

Start the function fun at delay seconds.

APPEND-NEWLINE-SPACE (STRING)

Append spaces before Newline on each line

AT (DELAY FUN &OPTIONAL (ID (GENSYM)))

Start the function fun at delay seconds.

CALL-HOOK (HOOK &REST ARGS)

Call a hook (a function, a symbol or a list of functions) Return the result of the last hook

CLEAN-STRING (STRING)

Remove Newline and upcase string

CONFIGVAR-GROUP (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

CONFIGVAR-VALUE (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

DO-EXECUTE (PROGRAM ARGS &OPTIONAL (WT NIL) (IO STREAM))

execute program with args a list containing the arguments passed to the program if wt is non-nil, the function will wait for the execution of the program to return. returns a two way stream connected to stdin/stdout of the program

ENSURE-LIST (OBJECT)

Ensure an object is a list

ENSURE-N-ELEMS (LIST N)

Ensure that list has exactly n elements

ENSURE-PRINTABLE (STRING &OPTIONAL (NEW ?))

Ensure a string is printable in ascii

ERASE-TIMER (ID)

Erase the timer identified by its id

ESCAPE-STRING (STRING &OPTIONAL (ESCAPER '(/ : ) ( ; ,)) (CHAR _))

Replace in string all characters found in the escaper list

EXPAND-NEWLINE (LIST)

Expand all newline in strings in list

FIND-ASSOC-WORD (WORD LINE &OPTIONAL (DELIM "))

Find a word pair

FIND-COMMON-STRING (STRING LIST &OPTIONAL ORIG)

Return the string in common in all string in list

FIND-FREE-NUMBER (L)

Return a number that is not in the list l.

FIND-IN-HASH (VAL HASHTABLE &OPTIONAL (TEST #'EQUAL))

Return the key associated to val in the hashtable

FIRST-POSITION (WORD STRING)

Return true only if word is at position 0 in string

GETENV (VAR)

Return the value of the environment variable.

SETFGETENV (VAL VAR)

Set an environment variable.

NTH-INSERT (N ELEM LIST)

Insert elem in (nth n list)

PARSE-INTEGER-IN-LIST (LST)

Convert all integer string in lst to integer

PROCESS-TIMERS

Call each timers in *timer-list* if needed

RECTANGLE-HEIGHT (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

RECTANGLE-WIDTH (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

RECTANGLE-X (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

RECTANGLE-Y (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

REPEAT-CHARS (N CHAR)

Return a string containing N CHARs.

SEARCH-IN-HASH (VAL HASHTABLE)

Return the key who match the val in the hashtable

SHUFFLE-LIST (LIST &KEY (TIME 1))

Shuffle a list by swapping elements time times

SPLIT-STRING (STRING &OPTIONAL (SEPARATOR ))

Return a list from a string splited at each separators

STRING-MATCH (MATCH LIST)

Return the string in list witch match the match string

URUN-PROG (PROG &REST OPTS &KEY ARGS (WAIT T) &ALLOW-OTHER-KEYS)

Common interface to shell. Does not return anything useful.

Undocumented

ANTI-ROTATE-LIST (LIST)

APPEND-FORMATED-LIST (BASE-STR LST &KEY (TEST-NOT-FUN #'(LAMBDA (X) X NIL)) (PRINT-FUN #'(LAMBDA (X) X)) (DEFAULT-STR ))

BATTERY-ALERT-STRING (BAT)

BATTERY-USAGE

BEGIN-WITH-2-SPACES (STRING)

CLDEBUG (&REST REST)

CLEAR-TIMERS

COLLECT-ALL-SYMBOLS (&OPTIONAL PACKAGE)

COMMAND-IN-PATH (&OPTIONAL (TMPFILE /tmp/clfswm-cmd.tmp))

CONFIG-ALL-GROUPS

CONFIG-DEFAULT-VALUE (VAR)

CONFIG-GROUP->STRING (GROUP)

SETFCONFIGVAR-GROUP (NEW-VALUE INSTANCE)

SETFCONFIGVAR-VALUE (NEW-VALUE INSTANCE)

CONVERT-TO-NUMBER (STR)

COPY-HASH-TABLE (HASHTABLE)

CPU-USAGE

CREATE-SYMBOL (&REST ARGS)

CREATE-SYMBOL-IN-PACKAGE (PACKAGE &REST ARGS)

DATE-STRING

DBGC (OBJ &OPTIONAL NEWLINE)

DISTANCE (X1 Y1 X2 Y2)

DO-SHELL (PROGRAM &OPTIONAL ARGS (WAIT NIL) (IO STREAM))

DO-SHELL-OUTPUT (FORMATTER &REST ARGS)

EMPTY-STRING-P (STRING)

ENSURE-FUNCTION (OBJECT)

EXCHANGE-ONE-IN-LIST (LST1 LST2)

EXPORT-ALL-FUNCTIONS (PACKAGE &OPTIONAL (VERBOSE NIL))

EXPORT-ALL-FUNCTIONS-AND-VARIABLES (PACKAGE &OPTIONAL (VERBOSE NIL))

EXPORT-ALL-VARIABLES (PACKAGE &OPTIONAL (VERBOSE NIL))

EXTENTED-ALPHANUMERICP (CHAR)

FDO-SHELL (FORMATTER &REST ARGS)

GET-COMMAND-LINE-WORDS

IN-RECTANGLE (X Y RECTANGLE)

LIMIT-LENGTH (STRING &OPTIONAL (LENGTH 10))

LIST-TO-STRING (LST)

MAKE-RECTANGLE (&KEY ((X DUM0) NIL) ((Y DUM1) NIL) ((WIDTH DUM2) NIL) ((HEIGHT DUM3) NIL))

MEMORY-USAGE

N-ROTATE-LIST (LIST STEPS)

NEAR-POSITION (CHARS STR &KEY (START 0))

NEXT-IN-LIST (ITEM LST)

NFUNCALL (FUNCTION)

NUMBER->CHAR (NUMBER)

NUMBER->LETTER (N &OPTIONAL (BASE 26))

NUMBER->STRING (NUMBER)

ONE-IN-LIST (LST)

PFUNCALL (FUNCTION &REST ARGS)

PREV-IN-LIST (ITEM LST)

SETFRECTANGLE-HEIGHT (NEW-VALUE INSTANCE)

SETFRECTANGLE-WIDTH (NEW-VALUE INSTANCE)

SETFRECTANGLE-X (NEW-VALUE INSTANCE)

SETFRECTANGLE-Y (NEW-VALUE INSTANCE)

ROTATE-LIST (LIST)

SIMPLE-TYPE-OF (OBJECT)

START-SYSTEM-POLL (DELAY)

STOP-SYSTEM-POLL

STRING-EQUAL-P (X Y)

STRING-TO-LIST (STR &KEY (SPLIT-CHAR ))

STRING-TO-LIST-MULTICHAR (STR &KEY (SPLIT-CHARS '( )) (PRESERVE NIL))

SUBSTRING-EQUAL (SUBSTRING STRING)

SYSTEM-USAGE-POLL (&OPTIONAL (DELAY 10))

UQUIT

USH (STRING)

USHELL (&REST STRINGS)

USHELL-LOOP (&OPTIONAL (SHELL-FUN #'USHELL))

VIEW-HASH-TABLE (TITLE HASHTABLE)

WRITE-BACKTRACE (FILENAME &OPTIONAL OTHER-INFO CLEAR)

Private

CONFIGVAR-DOC (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

REMOVE-PLIST (PLIST &REST KEYS)

Remove the keys from the plist. Useful for re-using the &REST arg after removing some options.

Undocumented

SETFCONFIGVAR-DOC (NEW-VALUE INSTANCE)

CONFIGVAR-P (OBJECT)

COPY-CONFIGVAR (INSTANCE)

COPY-RECTANGLE (INSTANCE)

CREATE-SYSTEM-POLL (DELAY)

EXTRACT-BATTERY-USAGE (LINE)

EXTRACT-CPU-USAGE (LINE)

EXTRACT-MEM-TOTAL (LINE)

EXTRACT-MEM-USED (LINE)

MAKE-CONFIGVAR (&KEY ((VALUE DUM56) NIL) ((GROUP DUM57) NIL) ((DOC DUM58) NIL))

MKSTR (&REST ARGS)

REALTIME->S (RTIME)

RECTANGLE-P (OBJECT)

S->REALTIME (SECOND)

SET-SHELL-DISPATCH (&OPTIONAL (SHELL-FUN 'USHELL))

SYSTEM-POLL-PID

TIMER-TEST-LOOP

MACRO

Public

ADD-HOOK (HOOK &REST VALUE)

Add a hook only if not duplicated

ADD-NEW-HOOK (HOOK &REST VALUE)

Add a hook. Duplicate it if needed

SETF/= (VAR VAL)

Set var to val only when var not equal to val

WITH-ALL-INTERNAL-SYMBOLS ((VAR PACKAGE) &BODY BODY)

Bind symbol to all internal symbols in package

WITH-TIMER ((DELAY &OPTIONAL (ID (GENSYM))) &BODY BODY)

Same thing as add-timer but with syntaxic sugar

Undocumented

AIF (TEST THEN &OPTIONAL ELSE)

AWHEN (TEST &BODY BODY)

DBG (&REST FORMS)

DBGNL (&REST FORMS)

DEFCONFIG (NAME VALUE GROUP DOC)

REMOVE-HOOK (HOOK &REST VALUE)

Private

Undocumented

WITH-SEARCH-LINE ((WORD LINE) &BODY BODY)

VARIABLE

Public

Undocumented

*CONFIG-VAR-TABLE*

Private

Undocumented

*%DBG-COUNT%*

*%DBG-NAME%*

*BAT-CMD*

*CPU-CMD*

*CPU-CMD-FAST*

*MEM-CMD*

*SHELL-CMD*

*SHELL-CMD-OPT*

*TIMER-LIST*

CLASS

Private

Undocumented

CONFIGVAR

RECTANGLE