YCP Reference

Table of Contents

I. WFM Builtins
SCROpen - Create a new scr instance.
SCRClose - Close a scr instance.
SCRGetName - Get the name of a scr instance.
SCRSetDefault - Set's the default scr instance.
SCRGetDefault - Get's the default scr instance.
Args - Returns the arguments with which the module was called.
GetLanguage - Returns the current language code (without modifiers !)
GetEncoding - Returns the current encoding code
GetEnvironmentEncoding - Returns the encoding code of the environment where yast is started
SetLanguage - Selects the language for translate()
Read - Special interface to the system agent. Not for general use.
Write - Special interface to the system agent. Not for general use.
Execute - Special interface to the system agent. Not for general use.
call - Executes a YCP client or a Y2 client component.
II. YCP Byteblock Builtins
tobyteblock - Converts a value to a byteblock.
size - Returns a size of a byteblock in bytes.
III. YCP Float Builtins
tostring - Converts a floating point number to a string
tofloat - Converts a value to a floating point number.
IV. YCP Integer Builtins
tointeger - Converts a value to an integer.
V. YCP List Builtins
find - Search for a certain element in a list
prepend - Prepend a list with a new element
contains - Check if a list contains an element
setcontains - Check if a sorted list contains an element
union - Union of lists
merge - Merge two lists into one
filter - Filter 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 - Flatten List
toset - Sort list and remove duplicates
sort - Sort A List according to the YCP builtin predicate >
sort - Sort list using an expression
splitstring - Split a string
change - Change a list
add - Create a new list with a new element
size - Return size of list
remove - Remove element from a list
select - Selet a list element
foreach - Process the content of a list
tolist - Converts a value to a list.
VI. 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
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 Path Builtins
size - Returns the number of path elements
add - Add a path element to existing path
topath - Converts a value to a path.
IX. YCP String Builtins
size - Returns the number of characters of the string s
issubstring - searches for a specific string within another string
tohexstring - Converts a integer to a hexadecimal string.
substring - Return part of a string
substring - Extract a substring
find - Return position of a substring
tolower - Make a string lowercase
toupper - Make a string uppercase
toascii - FIXME
deletechars - Delete charachters from a string (FIXME)
filterchars - Filter charachters out of a String
mergestring - Join list elements with a string
findfirstnotof - Search string for first non matching chars
findfirstof - Find position of first matching charachters 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 - Return time string
crypt - Encrypt a string
cryptmd5 - Encrypt a string using md5
cryptbigcrypt - Encrypt a string using bigcrypt
cryptblowfish - Encrypt a string with blowfish
dgettext - Translates the text using the given text domain
dngettext - Translates the text using a locale-aware plural form handling
X. YCP Term Builtins
size - Returns the number of arguments of the term t.
add - Add value to term
symbolof - Returns the symbol of the term t.
select - Select item from term
toterm - Converts a value to a term.
remove - Remove item from term
argsof - Returns the arguments of a term.