gi-ostree-1.0.15: OSTree bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.OSTree.Structs.KernelArgs

Description

No description available in the introspection data.

Synopsis

Exported types

newtype KernelArgs Source #

Memory-managed wrapper type.

Methods

Click to display all available methods, including inherited ones

Expand

Methods

append, appendArgv, appendArgvFiltered, appendProcCmdline, delete, deleteKeyEntry, free, newReplace, parseAppend, replace, replaceArgv, replaceTake, toString, toStrv.

Getters

getLastValue.

Setters

None.

append

kernelArgsAppend Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KernelArgs

kargs: a OstreeKernelArgs instance

-> Text

arg: key or key/value pair to be added

-> m () 

Appends arg which is in the form of key=value pair to the hash table kargs->table (appends to the value list if key is already in the hash table) and appends key to kargs->order if it is not in the hash table already.

Since: 2019.3

appendArgv

kernelArgsAppendArgv Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KernelArgs

kargs: a OstreeKernelArgs instance

-> Text

argv: an array of key=value argument pairs

-> m () 

Appends each value in argv to the corresponding value array and appends key to kargs->order if it is not in the hash table already.

Since: 2019.3

appendArgvFiltered

kernelArgsAppendArgvFiltered Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KernelArgs

kargs: a OstreeKernelArgs instance

-> Text

argv: an array of key=value argument pairs

-> Text

prefixes: an array of prefix strings

-> m () 

Appends each argument that does not have one of the prefixes as prefix to the kargs

Since: 2019.3

appendProcCmdline

kernelArgsAppendProcCmdline Source #

Arguments

:: (HasCallStack, MonadIO m, IsCancellable a) 
=> KernelArgs

kargs: a OstreeKernelArgs instance

-> Maybe a

cancellable: optional GCancellable object, NULL to ignore

-> m ()

(Can throw GError)

Appends the command line arguments in the file "/proc/cmdline" that does not have "BOOT_IMAGE=" and "initrd=" as prefixes to the kargs

Since: 2019.3

cleanup

kernelArgsCleanup Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Ptr ()

loc: Address of an OstreeKernelArgs pointer

-> m () 

Frees the OstreeKernelArgs structure pointed by *loc

Since: 2019.3

delete

kernelArgsDelete Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KernelArgs

kargs: a OstreeKernelArgs instance

-> Text

arg: key or key/value pair for deletion

-> m ()

(Can throw GError)

There are few scenarios being handled for deletion:

1: for input arg with a single key(i.e without = for split), the key/value pair will be deleted if there is only one value that is associated with the key

2: for input arg wth key/value pair, the specific key value pair will be deleted from the pointer array if those exist.

3: If the found key has only one value associated with it, the key entry in the table will also be removed, and the key will be removed from order table

Returns: True on success, False on failure

Since: 2019.3

deleteKeyEntry

kernelArgsDeleteKeyEntry Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KernelArgs

kargs: an OstreeKernelArgs instance

-> Text

key: the key to remove

-> m ()

(Can throw GError)

This function removes the key entry from the hashtable as well from the order pointer array inside kargs

Note: since both table and order inside kernel args are with free function, no extra free functions are being called as they are done automatically by GLib

Since: 2019.3

free

kernelArgsFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KernelArgs

kargs: An OstreeKernelArgs that represents kernel arguments

-> m () 

Frees the kargs structure

Since: 2019.3

getLastValue

kernelArgsGetLastValue Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KernelArgs

kargs: a OstreeKernelArgs instance

-> Text

key: a key to look for in kargs hash table

-> m Text

Returns: NULL if key is not found in the kargs hash table, otherwise returns last element of value array corresponding to key

Finds and returns the last element of value array corresponding to the key in kargs hash table. Note that the application will be terminated if the key is found but the value array is empty

Since: 2019.3

newReplace

kernelArgsNewReplace Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KernelArgs

kargs: OstreeKernelArgs instance

-> Text

arg: a string argument

-> m ()

(Can throw GError)

This function implements the basic logic behind key/value pair replacement. Do note that the arg need to be properly formatted

When replacing key with exact one value, the arg can be in the form: key, key=new_val, or key=old_val=new_val The first one swaps the old_val with the key to an empty value The second and third replace the old_val into the new_val

When replacing key with multiple values, the arg can only be in the form of: key=old_val=new_val. Unless there is a special case where there is an empty value associated with the key, then key=new_val will work because old_val is empty. The empty val will be swapped with the new_val in that case

Since: 2019.3

parseAppend

kernelArgsParseAppend Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KernelArgs

kargs: a OstreeKernelArgs instance

-> Text

options: a string representing command line arguments

-> m () 

Parses options by separating it by whitespaces and appends each argument to kargs

Since: 2019.3

replace

kernelArgsReplace Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KernelArgs

kargs: a OstreeKernelArgs instance

-> Text

arg: key or key/value pair for replacement

-> m () 

Finds and replaces the old key if arg is already in the hash table, otherwise adds arg as new key and split_keyeq (arg) as value. Note that when replacing old key value pair, the old values are freed.

Since: 2019.3

replaceArgv

kernelArgsReplaceArgv Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KernelArgs

kargs: a OstreeKernelArgs instance

-> Text

argv: an array of key or key/value pairs

-> m () 

Finds and replaces each non-null arguments of argv in the hash table, otherwise adds individual arg as new key and split_keyeq (arg) as value. Note that when replacing old key value pair, the old values are freed.

Since: 2019.3

replaceTake

kernelArgsReplaceTake Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KernelArgs

kargs: a OstreeKernelArgs instance

-> Text

arg: key or key/value pair for replacement

-> m () 

Finds and replaces the old key if arg is already in the hash table, otherwise adds arg as new key and split_keyeq (arg) as value. Note that when replacing old key, the old values are freed.

Since: 2019.3

toString

kernelArgsToString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KernelArgs

kargs: a OstreeKernelArgs instance

-> m Text

Returns: a string of "key=value" pairs or "key" if value is NULL, separated by single whitespaces

Extracts all key value pairs in kargs and appends to a temporary GString in forms of "key=value" or "key" if value is NULL separated by a single whitespace, and returns the temporary string with the GString wrapper freed

Note: the application will be terminated if one of the values array in kargs is NULL

Since: 2019.3

toStrv

kernelArgsToStrv Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KernelArgs

kargs: a OstreeKernelArgs instance

-> m [Text]

Returns: an array of "key=value" pairs or "key" if value is NULL

Extracts all key value pairs in kargs and appends to a temporary array in forms of "key=value" or "key" if value is NULL, and returns the temporary array with the GPtrArray wrapper freed

Since: 2019.3