YCP
YCP
YCP Builtins
SUSE Linux AG
YaST2
Team
SUSE Linux AG
Copyright © 2004 SUSE Linux AG
Table of Contents
I. YCP Byteblock Builtins
size
— Returns a size of a byteblock in bytes.
tobyteblock
— Converts a value to a byteblock.
II. YCP Float Builtins
float::abs
— absolute value
float::ceil
— round upwards to integer
float::floor
— round downwards to integer
float::pow
— power function
float::tolstring
— Converts a floating point number to a localized string
float::trunc
— round to integer, towards zero
tofloat
— Converts a value to a floating point number.
tostring
— Converts a floating point number to a string
III. YCP Integer Builtins
tointeger
— Converts a value to an integer.
tointeger
— Converts a string to an integer.
IV. YCP List Builtins
add
— Create a new list with a new element
change
— Changes a list. Deprecated, use LIST[size(LIST)] = value.
contains
— Checks if a list contains an element
filter
— Filters a List
find
— Searches for the first occurence of a certain element in a list
flatten
— Flattens List
foreach
— Processes the content of a list
isempty
— Returns whether the list
l
is empty.
list::reduce
— Reduces a list to a single value.
list::reduce
— Reduces a list to a single value.
list::reverse
— Creates new list with reversed order of elements.
list::swap
— Creates new list with swaped elements at offset i1 and i2.
listmap
— Maps an operation onto all elements of a list and thus creates a map.
lsort
— Sort A List respecting locale
maplist
— Maps an operation onto all elements of a list and thus creates a new list.
merge
— Merges two lists into one
prepend
— Prepends a list with a new element
remove
— Removes element from a list
select
— Selects a list element (deprecated, use LIST[INDEX]:DEFAULT)
setcontains
— Checks if a sorted list contains an element
size
— Returns size of list
sort
— Sorts a List according to the YCP builtin predicate
sort
— Sort list using an expression
splitstring
— Split a string by delimiter
sublist
— Extracts a sublist
sublist
— Extracts a sublist
tolist
— Converts a value to a list (deprecated, use (list)VAR).
toset
— Sorts list and removes duplicates
union
— Unions of lists
V. Map Builtins
add
— Add a key/value pair to a map
change
— Change element pair in a map. Deprecated, use MAP[KEY] = VALUE.
filter
— Filter a Map
foreach
— Process the content of a map
haskey
— Check if map has a certain key
isempty
— Returns whether the map
m
is empty.
lookup
— Select a map element (deprecated, use MAP[KEY]:DEFAULT)
maplist
— Maps an operation onto all elements key/value and create a list
mapmap
— Maps an operation onto all key/value pairs of a map
remove
— Remove key/value pair from a map
size
— Size of a map
tomap
— Converts a value to a map.
union
— Union of 2 maps
VI. Miscellaneous YCP Builtins
eval
— Evaluate a YCP value.
getenv
— Change or add an environment variable
is
— Checks whether a value is of a certain type
random
— Random number generator.
setenv
— Change or add an environment variable
setenv
— Change or add an environment variable
sformat
— Format a String
sleep
— Sleeps a number of milliseconds.
srandom
— Initialize random number generator
srandom
— Initialize random number generator.
time
— Return the number of seconds since 1.1.1970.
y2debug
— Log a message to the y2log.
y2error
— Log an error to the y2log.
y2internal
— Log an internal message to the y2log.
y2milestone
— Log a milestone to the y2log.
y2security
— Log a security message to the y2log.
y2useritem
— Log an user-level system message to the y2changes
y2usernote
— Log an user-level addional message to the y2changes
y2warning
— Log a warning to the y2log.
VII. YCP Path Builtins
add
— Add a path element to existing path
size
— Returns the number of path elements
topath
— Converts a value to a path.
VIII. YCP String Builtins
crypt
— Encrypts a string
cryptblowfish
— Encrypts a string with blowfish
cryptmd5
— Encrypts a string using md5
cryptsha256
— Encrypts a string with sha256
cryptsha512
— Encrypts a string with sha512
deletechars
— Removes all characters from a string
dgettext
— Translates the text using the given text domain
dngettext
— Translates the text using a locale-aware plural form handling
dpgettext
— Translates the text using the given text domain and path
filterchars
— Filters characters out of a String
find
— Returns position of a substring
findfirstnotof
— Searches string for the first non matching chars
findfirstof
— Finds position of the first matching characters in string
findlastnotof
— Searches the last element of string that doesn't match
findlastof
— Searches string for the last match
isempty
— Returns whether the string
s
is empty.
issubstring
— searches for a specific string within another string
mergestring
— Joins list elements with a string
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
search
— Returns position of a substring
size
— Returns the number of characters of the string
s
substring
— Returns part of a string
substring
— Extracts a substring
timestring
— Returns time string
toascii
— Returns characters below 0x7F included in
STRING
tohexstring
— Converts an integer to a hexadecimal string.
tohexstring
— Converts an integer to a hexadecimal string.
tolower
— Makes a string lowercase
tostring
— Converts a value to a string.
toupper
— Makes a string uppercase
IX. YCP Term Builtins
add
— Add value to term
argsof
— Returns the arguments of a term.
remove
— Remove item from term
select
— Select item from term
size
— Returns the number of arguments of the term
TERM
.
symbolof
— Returns the symbol of the term
TERM
.
toterm
— Converts a value to a term.
toterm
— Constructs a term from a symbol and a list.
X. Disambiguation
add
— disambiguation
change
— disambiguation
filter
— disambiguation
find
— disambiguation
foreach
— disambiguation
isempty
— disambiguation
list::reduce
— disambiguation
list::reverse
— disambiguation
list::swap
— disambiguation
maplist
— disambiguation
remove
— disambiguation
select
— disambiguation
setenv
— disambiguation
size
— disambiguation
sort
— disambiguation
srandom
— disambiguation
sublist
— disambiguation
substring
— disambiguation
tohexstring
— disambiguation
tointeger
— disambiguation
tostring
— disambiguation
toterm
— disambiguation
union
— disambiguation