YCP
YCP
YCP Builtins
SUSE Linux AG
YaST2
Team
SUSE Linux AG
Copyright © 2004 SUSE Linux AG
Table of Contents
I. YCP Integer Builtins
tointeger
- Converts a value to an integer.
II. YCP String Builtins
size
- Returns the number of characters of the string s
issubstring
- searches for a specific string within another string
tohexstring
- Converts an integer to a hexadecimal string.
substring
- Returns part of a string
substring
- Extracts a substring
search
- Returns position of a substring
find
- Returns position of a substring
tolower
- Makes a string lowercase
toupper
- Makes a string uppercase
toascii
- Returns characters below 0x7F included in STRING
deletechars
- Removes all characters from a string
filterchars
- Filters characters out of a String
mergestring
- Joins list elements with a string
findfirstnotof
- Searches string for the first non matching chars
findfirstof
- Finds position of the first matching characters in string
findlastof
- Searches string for the last match
findlastnotof
- Searches the last element of string that doesn't match
regexpmatch
- Searches a string for a POSIX Extended Regular Expression match.
regexppos
- Returns a pair with position and length of the first match.
regexpsub
- Regex Substitution
regexptokenize
- Regex tokenize
tostring
- Converts a value to a string.
timestring
- Returns time string
crypt
- Encrypts a string
cryptmd5
- Encrypts a string using md5
cryptbigcrypt
- Encrypts a string using bigcrypt
cryptblowfish
- Encrypts a string with blowfish
dgettext
- Translates the text using the given text domain
dngettext
- Translates the text using a locale-aware plural form handling
III. Map Builtins
haskey
- Check if map has a certain key
filter
- Filter a Map
mapmap
- Maps an operation onto all key/value pairs of a map
maplist
- Maps an operation onto all elements key/value and create a list
union
- Union of 2 maps
add
- Add a key/value pair to a map
change
- Change element pair in a map
size
- Size of a map
foreach
- Process the content of a map
tomap
- Converts a value to a map.
remove
- Remove key/value pair from a map
lookup
- Select a map element (deprecated, use MAP[KEY]:DEFAULT)
IV. YCP List Builtins
find
- Searches for the first occurence of a certain element in a list
prepend
- Prepends a list with a new element
contains
- Checks if a list contains an element
setcontains
- Checks if a sorted list contains an element
union
- Unions of lists
merge
- Merges two lists into one
filter
- Filters a List
maplist
- Maps an operation onto all elements of a list and thus creates a new list.
listmap
- Maps an operation onto all elements of a list and thus creates a map.
flatten
- Flattens List
toset
- Sorts list and removes duplicates
sort
- Sorts a List according to the YCP builtin predicate
sort
- Sort list using an expression
lsort
- Sort A List respecting locale
splitstring
- Split a string by delimiter
change
- Changes a list
add
- Create a new list with a new element
size
- Returns size of list
remove
- Removes element from a list
select
- Selects a list element (deprecated, use LIST[INDEX]:DEFAULT)
foreach
- Processes the content of a list
tolist
- Converts a value to a list (deprecated, use (list)VAR).
V. YCP Path Builtins
size
- Returns the number of path elements
add
- Add a path element to existing path
topath
- Converts a value to a path.
VI. YCP Term Builtins
size
- Returns the number of arguments of the term TERM.
add
- Add value to term
symbolof
- Returns the symbol of the term TERM.
select
- Select item from term
toterm
- Converts a value to a term.
remove
- Remove item from term
argsof
- Returns the arguments of a term.
VII. Miscellaneous YCP Builtins
time
- Return the number of seconds since 1.1.1970.
sleep
- Sleeps a number of milliseconds.
random
- Random number generator.
srandom
- Initialize random number generator
srandom
- Initialize random number generator.
eval
- Evaluate a YCP value.
sformat
- Format a String
y2debug
- Log a message to the y2log.
y2milestone
- Log a milestone to the y2log.
y2warning
- Log a warning to the y2log.
y2error
- Log an error to the y2log.
y2security
- Log a security message to the y2log.
y2internal
- Log an internal message to the y2log.
VIII. YCP Float Builtins
tostring
- Converts a floating point number to a string
tofloat
- Converts a value to a floating point number.
IX. YCP Byteblock Builtins
tobyteblock
- Converts a value to a byteblock.
size
- Returns a size of a byteblock in bytes.