Functions¶
Details¶
- 
Infinity.acl_account_array_free(accounts)¶
- Parameters: - accounts ([ - Infinity.AclAccount]) – An array of- Infinity.AclAccountobjects.- Releases all resources allocated by an array of - Infinity.AclAccounts.
- 
Infinity.acl_account_from_xml(xml)¶
- Parameters: - xml ( - libxml2.NodePtr) – An XML node.- Raises: - GLib.Error- Returns: - A new - Infinity.AclAccounton success, or- Noneon failure. Free with- Infinity.AclAccount.free() when no longer needed.- Return type: - Infinity.AclAccount- Attempts to deserialize an - Infinity.AclAccountthat was written to an XML node by the function- Infinity.AclAccount.to_xml(). If an error occurs, such as mandatory fields being missing, the function returns- Noneand error is set.
- 
Infinity.acl_account_id_to_string(account)¶
- Parameters: - account ( - int) – A #InfAclAccountId.- Returns: - A string representation of the given account ID, or - Noneif the account does not exist. The return value must not be freed.- Return type: - str- Translates the given account ID to a unique string identifier. 
- 
Infinity.acl_sheet_perms_from_xml(xml)¶
- Parameters: - xml ( - libxml2.NodePtr) – The XML node to read from.- Raises: - GLib.Error- Returns: - Trueif the operation was successful, or- Falseon error.- mask: - Output parameter to write the permission mask to. - perms: - Output parameter to write the permissions to. - Return type: - ( - bool, mask:- Infinity.AclMask, perms:- Infinity.AclMask)- This function extracts the permission mask and the permission flags from the XML node xml. The counterpart to this function is - Infinity.AclSheet.perms_to_xml(). If an error occurs the function returns- Falseand error is set.
- 
Infinity.acl_sheet_perms_to_xml(mask, perms, xml)¶
- Parameters: - mask (Infinity.AclMask) – Permission mask to write.
- perms (Infinity.AclMask) – Individiual permissions to write.
- xml (libxml2.NodePtr) – error: Location to store error information, if any.
 - This function writes the given permission mask and permission flags to the XML node xml. They can be converted back using the - Infinity.AclSheet.perms_from_xml() function.
- mask (
- 
Infinity.acl_sheet_set_from_xml(xml)¶
- Parameters: - xml ( - libxml2.NodePtr) – The XML node from which to read the sheet set.- Raises: - GLib.Error- Returns: - A - Infinity.AclSheetSet, or- None. Free with- Infinity.AclSheetSet.free() when no longer needed.- Return type: - Infinity.AclSheetSet- Reads a sheet set from xml that has been written with - Infinity.AclSheetSet.to_xml(). If an error occurs the function returns- Noneand error is set. If there is no ACL stored in xml, the function returns- Nonewithout setting error.
- 
Infinity.adopted_state_vector_error_quark()¶
- Returns: - A #GQuark for that domain. - Return type: - int- The domain for - Infinity.AdoptedStateVectorErrorerrors.
- 
Infinity.adopted_state_vector_from_string(str)¶
- Parameters: - str ( - str) – A string representation of a- Infinity.AdoptedStateVector.- Raises: - GLib.Error- Returns: - A new - Infinity.AdoptedStateVector, or- None.- Return type: - Infinity.AdoptedStateVector- Recreates the - Infinity.AdoptedStateVectorfrom its string representation. If an error occurs, the function returns- Noneand error is set.
- 
Infinity.adopted_state_vector_from_string_diff(str, orig)¶
- Parameters: - str (str) – A string representation of a diff between state vectors.
- orig (Infinity.AdoptedStateVector) – The state vector used to create str inInfinity.AdoptedStateVector.to_string_diff().
 - Raises: - Returns: - The created state vector, or - Noneon error. Free with- Infinity.AdoptedStateVector.free() when no longer needed.- Return type: - Recreates a vector from its string representation diff and the original vector. If an error returns, the function returns - Noneand error is set.
- str (
- 
Infinity.authentication_detail_error_quark()¶
- Returns: - A GQuark. - Return type: - int- Error domain for further information on authentication errors. Errors in this domain will be from the - Infinity.AuthenticationDetailErrorenumeration. See- GLib.Errorfor information on error domains.
- 
Infinity.authentication_detail_strerror(code)¶
- Parameters: - code ( - Infinity.AuthenticationDetailError) – An error code from the- Infinity.AuthenticationDetailErrorenumeration.- Returns: - A static string that must not be freed. - Return type: - str- Returns a human-readable string for the given error code. 
- 
Infinity.cert_util_check_certificate_key(cert, key)¶
- Parameters: - cert (InfGnutls.X509Crt) – The certificate to be checked.
- key (InfGnutls.X509PrivKey) – The private key to be checked.
 - Returns: - Return type: - This function returns - Trueif key is the private key belonging to cert, or- Falseotherwise.
- cert (
- 
Infinity.cert_util_compare_fingerprint(cert1, cert2)¶
- Parameters: - cert1 (InfGnutls.X509Crt) – The first certificate to compare.
- cert2 (InfGnutls.X509Crt) – The second certificate to compare.
 - Raises: - Returns: - Whether the two certificates have identical fingerprints. Returns - Falseon error.- Return type: - Checks whether the SHA-256 fingerprints of the two given certificates are identical or not. If a fingerprint cannot be obtained, the function returns - Falseand error is set.
- cert1 (
- 
Infinity.cert_util_get_activation_time(cert)¶
- Parameters: - cert ( - InfGnutls.X509Crt) – An initialized- InfGnutls.X509Crt.- Returns: - The activation time of the certificate, or - None. Free with- GLib.free() after use.- Return type: - str- Returns the activation time of the certificate as a string in human-readable format. If the activation time cannot be read - Noneis returned.
- 
Infinity.cert_util_get_dn(cert)¶
- Parameters: - cert ( - InfGnutls.X509Crt) – An initialized- InfGnutls.X509Crt.- Returns: - The DN of the certificate. Free with - GLib.free() after use.- Return type: - str- Retrieves the full distinguished name (DN) from the certificate, allocating memory for the return value. 
- 
Infinity.cert_util_get_dn_by_oid(cert, oid, index)¶
- Parameters: - cert (InfGnutls.X509Crt) – An initializedInfGnutls.X509Crt.
- oid (str) – The name of the requested entry.
- index (int) – Index of the entry to retrieve.
 - Returns: - The certificate entry, or - Noneif it is not present. Free with- GLib.free() after use.- Return type: - Retrieves the given item from the certificate. This function is a thin wrapper around gnutls_x509_crt_get_dn_by_oid(), allocating memory for the return value. The function returns - Noneif there is no such entry in the certificate.
- cert (
- 
Infinity.cert_util_get_expiration_time(cert)¶
- Parameters: - cert ( - InfGnutls.X509Crt) – An initialized- InfGnutls.X509Crt.- Returns: - The expiration time of the certificate, or - None. Free with- GLib.free() after use.- Return type: - str- Returns the expiration time of the certificate as a string in human-readable format. If the expiration time cannot be read - Noneis returned.
- 
Infinity.cert_util_get_fingerprint(cert, algo)¶
- Parameters: - cert (InfGnutls.X509Crt) – An initializedInfGnutls.X509Crt.
- algo (int) – The hashing algorithm to use.
 - Returns: - The fingerprint of the certificate, or - None. Free with- GLib.free() after use.- Return type: - Returns the fingerprint of the certificate hashed with the specified algorithm, in hexadecimal format. If the fingerprint cannot be read - Noneis returned.
- cert (
- 
Infinity.cert_util_get_hostname(cert)¶
- Parameters: - cert ( - InfGnutls.X509Crt) – An initialized- InfGnutls.X509Crt.- Returns: - The best guess for the certificate’s hostname, or - Nonewhen it cannot be retrieved. Free with- GLib.free() after use.- Return type: - stror- None- Attempts to read the hostname of a certificate. This is done by looking at the DNS name and IP address SANs. If both are not available, the common name of the certificate is returned. 
- 
Infinity.cert_util_get_issuer_dn_by_oid(cert, oid, index)¶
- Parameters: - cert (InfGnutls.X509Crt) – An initializedInfGnutls.X509Crt.
- oid (str) – The name of the requested entry.
- index (int) – Index of the entry to retrieve.
 - Returns: - The certificate entry, or - Noneif it is not present. Free with- GLib.free() after use.- Return type: - Retrieves the given item from the issuer of the certificate. This function is a thin wrapper around gnutls_x509_crt_get_issuer_dn_by_oid(), allocating memory for the return value. The functions returns - Noneif there is no such entry in the certificate.
- cert (
- 
Infinity.cert_util_get_serial_number(cert)¶
- Parameters: - cert ( - InfGnutls.X509Crt) – An initialized- InfGnutls.X509Crt.- Returns: - The serial number of the certificate, or - None. Free with- GLib.free() after use.- Return type: - str- Read the serial number of a certificate and return it in hexadecimal format. If the serial number cannot be read - Noneis returned.
- 
Infinity.cert_util_read_certificate(filename, current)¶
- Parameters: - filename (str) – A path to a X.509 certificate file.
- current ([InfGnutls.X509Crt] orNone) – An array ofInfGnutls.X509Crtobjects, orNone.
 - Raises: - Returns: - An array of the read certificates, or - Noneon error.- Return type: - Loads X.509 certificates in PEM format from the file at filename. There can be any number of certificates in the file. If current is not - None, the new certificates are appended to the array. Otherwise, a new array with the read certificates is returned.- If an error occurs, the function returns - Noneand error is set. If current is non-- Noneand the function succeeds, the return value is the same as current.
- filename (
- 
Infinity.cert_util_write_certificate(certs, filename)¶
- Parameters: - certs ([InfGnutls.X509Crt]) – An array ofInfGnutls.X509Crtobjects.
- filename (str) – The path at which to store the certificates.
 - Raises: - Returns: - Return type: - This function writes the certificates in the array certs to disk, in PEM format. If an error occurs the function returns - Falseand error is set.
- certs ([
- 
Infinity.cert_util_write_certificate_mem(certs, n_certs)¶
- Parameters: - certs (InfGnutls.X509Crt) – An array ofInfGnutls.X509Crtobjects.
- n_certs (int) – Number of certificates in the error.
 - Raises: - Returns: - A string with PEM-encoded certificate data, or - Noneon error. Free with- GLib.free().- Return type: - This function writes the certificates in the array certs into memory, in PEM format. If an error occurs the function returns - Noneand error is set.
- certs (
- 
Infinity.cert_util_write_certificate_with_key(key, certs, filename)¶
- Parameters: - key (InfGnutls.X509PrivKey) – An initializedInfGnutls.X509PrivKeystructure.
- certs ([InfGnutls.X509Crt]) – An array ofInfGnutls.X509Crtobjects.
- filename (str) – The path at which to store the certificates.
 - Raises: - Returns: - Return type: - This function writes both the private key key as well as the certificates in the array certs to disk, in PEM format. If an error occurs the function returns - Falseand error is set.
- key (
- 
Infinity.cert_util_write_dh_params(params, filename)¶
- Parameters: - params (InfGnutls.DHParams) – An initializedInfGnutls.DHParamsstructure.
- filename (str) – The path at which so store params.
 - Raises: - Returns: - Return type: - Writes the given Diffie-Hellman parameters to the given path on the filesystem. If an error occurs, error is set and - Falseis returned.
- params (
- 
Infinity.cert_util_write_private_key(key, filename)¶
- Parameters: - key (InfGnutls.X509PrivKey) – An initializedInfGnutls.X509PrivKeystructure.
- filename (str) – The path at which so store the key.
 - Raises: - Returns: - Return type: - Writes key to the location specified by filename on the filesystem. If an error occurs, the function returns - Falseand error is set.
- key (
- 
Infinity.deinit()¶
- This functions deinitializes the libinfinity library. Make sure that all objects the library provides have been freed before calling this function. If - Infinity.init() has been called multiple times, then- Infinity.deinit() needs to be called the same number of times to actually deinitialize the library.
- 
Infinity.directory_error_quark()¶
- Returns: - A GQuark. - Return type: - int- Error domain for directory errors. Errors in this domain will be from the - Infinity.DirectoryErrorenumeration. See- GLib.Errorfor information on error domains.
- 
Infinity.directory_strerror(code)¶
- Parameters: - code ( - Infinity.DirectoryError) – An error code from the- Infinity.DirectoryErrorenumeration.- Returns: - A static string that must not be freed. - Return type: - str- Returns a human-readable string for the given error code. 
- 
Infinity.file_util_create_directory(path, mode)¶
- Parameters: - Raises: - Returns: - Return type: - Attempts to create a directory at path, creating intermediate directories as necessary. The mode parameter is only used on Unix in which case it specifies the permissions to use for all newly created directories in the same way as g_mkdir() would. 
- 
Infinity.file_util_create_single_directory(path, mode)¶
- Parameters: - Raises: - Returns: - Return type: - Attempts to create a directory at path. The mode parameter is only used on Unix in which case it specifies the permissions to use for all newly created directories in the same way as g_mkdir() would. 
- 
Infinity.file_util_delete(path)¶
- Parameters: - path ( - str) – Path to the object to delete.- Raises: - GLib.Error- Returns: - Trueon success or- Falseon error.- Return type: - bool- Removes the file or directory at path. If it is a directory the directory is deleted recursively. If the function fails - Falseis returned and error is set.
- 
Infinity.file_util_delete_directory(path)¶
- Parameters: - path ( - str) – Path to the directory to delete.- Raises: - GLib.Error- Returns: - Trueon success or- Falseon error.- Return type: - bool- Removes the directory at path recursively. Fails if path points to a regular file and not a directory. If the function fails - Falseis returned and error is set.
- 
Infinity.file_util_delete_file(path)¶
- Parameters: - path ( - str) – Path to the file to delete.- Raises: - GLib.Error- Returns: - Trueon success or- Falseon error.- Return type: - bool- Removes the file at path if it is empty. Fails if path points to a directory and not a regular file. If the function fails - Falseis returned and error is set.
- 
Infinity.file_util_delete_single_directory(path)¶
- Parameters: - path ( - str) – Path to the directory to delete.- Raises: - GLib.Error- Returns: - Trueon success or- Falseon error.- Return type: - bool- Removes the directory at path if it is empty, or fails otherwise. Fails if path points to a regular file and not a directory. If the function fails - Falseis returned and error is set.
- 
Infinity.file_util_list_directory(path, func, *user_data)¶
- Parameters: - path (str) – The directory to explore.
- func (Infinity.FileListFunc) – Callback function to be called for each child of the directory at path.
- user_data (objectorNone) – Additional data to pass to func.
 - Raises: - Returns: - Return type: - Calls func for each file within the given directory. It also passes the type of the found file to the callback function. The callback function can return - Falseto stop the iteration. If it does this, then this function still returns- True. This can for example be used to find a file in a directory. If, in addition, the callback function sets error, then this function returns- Falseand propagates the error.
- path (
- 
Infinity.file_util_write_private_data(filename, data, length)¶
- Parameters: - Raises: - Returns: - Return type: - Writes data to the file pointed to by filename. On Unix-like systems, filename is created with 0600 permission. If the function fails, - Falseis returned and error is set.
- 
Infinity.gnutls_certificate_verification_error_quark()¶
- Returns: - A GQuark. - Return type: - int- Error domain for GnuTLS certificate verification errors. Errors in this domain will be GnuTLS certificate verification results as returned by gnutls_certificate_verify_peers2(). See - GLib.Errorfor information on error domains.
- 
Infinity.gnutls_certificate_verification_set_error(error, verify)¶
- Parameters: - error (GLib.Error) – Location to store the error, orNone.
- verify (int) – A GnuTLS certificate verification code.
 - Sets a - GLib.Errorfrom a certificate verification result. If error is- None, does nothing.
- error (
- 
Infinity.gnutls_error_quark()¶
- Returns: - A GQuark. - Return type: - int- Error domain for GnuTLS errors. Errors in this domain will be GnuTLS error codes. See - GLib.Errorfor information on error domains.
- 
Infinity.gnutls_set_error(error, error_code)¶
- Parameters: - error (GLib.Error) – Location to store the error, orNone.
- error_code (int) – A GnuTLS error code.
 - Sets a - GLib.Errorfrom a GnuTLS error code. If error is- None, does nothing.
- error (
- 
Infinity.gsasl_error_quark()¶
- Returns: - A GQuark. - Return type: - int- Error domain for GNU SASL errors. Errors in this domain will be GNU SASL error codes. See - GLib.Errorfor information on error domains.
- 
Infinity.gsasl_set_error(error, error_code)¶
- Parameters: - error (GLib.Error) – Location to store the error, orNone.
- error_code (int) – A GNU SASL error code.
 - Sets a - GLib.Errorfrom a GNU SASL error code. If error is- None, does nothing.
- error (
- 
Infinity.init()¶
- Raises: - GLib.Error- Returns: - Whether the initialization was successful or not. - Return type: - bool- This function initializes the libinfinity library and should be called before any other functions of the library. The function does nothing if it has already been called before. 
- 
Infinity.native_socket_error_quark()¶
- Returns: - A #GQuark representing the INF_NATIVE_SOCKET_ERROR domain. - Return type: - int- Returns a #GQuark representing the INF_NATIVE_SOCKET_ERROR domain. 
- 
Infinity.native_socket_make_error(code)¶
- Parameters: - code ( - int) – An error code obtained with #INF_NATIVE_SOCKET_LAST_ERROR- Raises: - GLib.Error- Converts the platform-dependent error code code into a - GLib.Error. The- GLib.Errorwill contain the same numerical value and a platform-dependent human-readable error message.
- 
Infinity.protocol_get_default_port()¶
- Returns: - The default port. - Return type: - int- Returns the default port on which the infinote daemon listens for new connections. 
- 
Infinity.protocol_get_version()¶
- Returns: - The supported infinote version. - Return type: - str- Returns the version of the Infinote protocol implemented by this version of libinfinity. 
- 
Infinity.protocol_parse_version(version, major, minor)¶
- Parameters: - Raises: - Returns: - Return type: - Splits the given version string into it’s major and minor version number. If the string is badly formatted then the function returns - False, error is set and major and minor are left untouched.- It is guaranteed that, if version is - Infinity.protocol_get_version(), the function does not fail.
- 
Infinity.request_error_quark()¶
- Returns: - A GQuark. - Return type: - int- Error domain for request errors. Errors in this domain will be from the - Infinity.RequestErrorenumeration. See- GLib.Errorfor information on error domains.
- 
Infinity.request_result_make_add_node(browser, iter, new_node)¶
- Parameters: - browser (Infinity.Browser) – AInfinity.Browser.
- iter (Infinity.BrowserIter) – An iterator pointing to the node to which a node has been added.
- new_node (Infinity.BrowserIter) – An iterator pointing to the new node.
 - Returns: - A new - Infinity.RequestResult. Free with- Infinity.RequestResult.free().- Return type: - Creates a new - Infinity.RequestResultfor an “add-node” request, see- Infinity.Browser.add_note() or- Infinity.Browser.add_subdirectory(). The- Infinity.RequestResultobject is only valid as long as the caller maintains a reference to browser.
- browser (
- 
Infinity.request_result_make_create_acl_account(browser, account, certificate)¶
- Parameters: - browser (Infinity.Browser) – AInfinity.Browser.
- account (Infinity.AclAccount) – The createdInfinity.AclAccount.
- certificate (Infinity.CertificateChain) – The certificate which can be used to log into account.
 - Returns: - A new - Infinity.RequestResult. Free with- Infinity.RequestResult.free().- Return type: - Creates a new - Infinity.RequestResultfor a “create-acl-account” request, see- Infinity.Browser.create_acl_account(). The- Infinity.RequestResultobject is only valid as long as the caller maintains a reference to browser.
- browser (
- 
Infinity.request_result_make_explore_node(browser, iter)¶
- Parameters: - browser (Infinity.Browser) – AInfinity.Browser.
- iter (Infinity.BrowserIter) – An iterator pointing to the node to which was explored.
 - Returns: - A new - Infinity.RequestResult. Free with- Infinity.RequestResult.free().- Return type: - Creates a new - Infinity.RequestResultfor an “explore-node” request, see- Infinity.Browser.explore(). The- Infinity.RequestResultobject is only valid as long as the caller maintains a reference to browser.
- browser (
- 
Infinity.request_result_make_join_user(proxy, user)¶
- Parameters: - proxy (Infinity.SessionProxy) – AInfinity.SessionProxy.
- user (Infinity.User) – The joined user.
 - Returns: - A new - Infinity.RequestResult. Free with- Infinity.RequestResult.free().- Return type: - Creates a new - Infinity.RequestResultfor a “join-user” request, see- Infinity.SessionProxy.join_user(). The- Infinity.RequestResultobject is only valid as long as the caller maintains a reference to proxy.
- proxy (
- 
Infinity.request_result_make_lookup_acl_accounts(browser, accounts)¶
- Parameters: - browser (Infinity.Browser) – AInfinity.Browser.
- accounts ([Infinity.AclAccount]) – The list of accounts.
 - Returns: - A new - Infinity.RequestResult. Free with- Infinity.RequestResult.free().- Return type: - Creates a new - Infinity.RequestResultfor a “lookup-acl-accounts” request, see- Infinity.Browser.lookup_acl_accounts(). The- Infinity.RequestResultobject is only valid as long as the caller maintains a reference to browser.
- browser (
- 
Infinity.request_result_make_query_acl(browser, iter, sheet_set)¶
- Parameters: - browser (Infinity.Browser) – AInfinity.Browser.
- iter (Infinity.BrowserIter) – An iterator pointing to the node whose ACL was queried.
- sheet_set (Infinity.AclSheetSet) – The sheet set for the queried node.
 - Returns: - A new - Infinity.RequestResult. Free with- Infinity.RequestResult.free().- Return type: - Creates a new - Infinity.RequestResultfor a “query-acl” request, see- Infinity.Browser.query_acl(). The- Infinity.RequestResultobject is only valid as long as the caller maintains a reference to browser and proxy.
- browser (
- 
Infinity.request_result_make_query_acl_account_list(browser, accounts, does_notifications)¶
- Parameters: - browser (Infinity.Browser) – AInfinity.Browser.
- accounts ([Infinity.AclAccount]) – The list of accounts.
- does_notifications (bool) – Whether the server notifies the clients about added or removed accounts.
 - Returns: - A new - Infinity.RequestResult. Free with- Infinity.RequestResult.free().- Return type: - Creates a new - Infinity.RequestResultfor a “query-acl-account-list” request, see- Infinity.Browser.query_acl_account_list(). The- Infinity.RequestResultobject is only valid as long as the caller maintains a reference to browser.
- browser (
- 
Infinity.request_result_make_remove_acl_account(browser, account)¶
- Parameters: - browser (Infinity.Browser) – AInfinity.Browser.
- account (Infinity.AclAccount) – The removedInfinity.AclAccount.
 - Returns: - A new - Infinity.RequestResult. Free with- Infinity.RequestResult.free().- Return type: - Creates a new - Infinity.RequestResultfor a “remove-acl-account” request, see- Infinity.Browser.remove_acl_account(). The- Infinity.RequestResultobject is only valid as long as the caller maintains a reference to browser.
- browser (
- 
Infinity.request_result_make_remove_node(browser, iter)¶
- Parameters: - browser (Infinity.Browser) – AInfinity.Browser.
- iter (Infinity.BrowserIter) – An iterator pointing to the node to which was removed.
 - Returns: - A new - Infinity.RequestResult. Free with- Infinity.RequestResult.free().- Return type: - Creates a new - Infinity.RequestResultfor an “remove-node” request, see- Infinity.Browser.remove_node(). The- Infinity.RequestResultobject is only valid as long as the caller maintains a reference to browser.
- browser (
- 
Infinity.request_result_make_save_session(browser, iter)¶
- Parameters: - browser (Infinity.Browser) – AInfinity.Browser.
- iter (Infinity.BrowserIter) – An iterator pointing to the node to which was saved.
 - Returns: - A new - Infinity.RequestResult. Free with- Infinity.RequestResult.free().- Return type: - Creates a new - Infinity.RequestResultfor a “save-session” request, see infc_browser_iter_save_session(). The- Infinity.RequestResultobject is only valid as long as the caller maintains a reference to browser.
- browser (
- 
Infinity.request_result_make_set_acl(browser, iter)¶
- Parameters: - browser (Infinity.Browser) – AInfinity.Browser.
- iter (Infinity.BrowserIter) – An iterator pointing to the node whose ACL was set.
 - Returns: - A new - Infinity.RequestResult. Free with- Infinity.RequestResult.free().- Return type: - Creates a new - Infinity.RequestResultfor a “set-acl” request, see- Infinity.Browser.set_acl(). The- Infinity.RequestResultobject is only valid as long as the caller maintains a reference to browser and proxy.
- browser (
- 
Infinity.request_result_make_subscribe_chat(browser, proxy)¶
- Parameters: - browser (Infinity.Browser) – AInfinity.Browser.
- proxy (Infinity.SessionProxy) – TheInfinity.SessionProxyfor the subscribed session.
 - Returns: - A new - Infinity.RequestResult. Free with- Infinity.RequestResult.free().- Return type: - Creates a new - Infinity.RequestResultfor a “subscribe-chat” request, see infc_browser_subscribe_chat(). The- Infinity.RequestResultobject is only valid as long as the caller maintains a reference to browser and proxy.
- browser (
- 
Infinity.request_result_make_subscribe_session(browser, iter, proxy)¶
- Parameters: - browser (Infinity.Browser) – AInfinity.Browser.
- iter (Infinity.BrowserIter) – An iterator pointing to the node to which a subscription was made.
- proxy (Infinity.SessionProxy) – TheInfinity.SessionProxyfor the subscription.
 - Returns: - A new - Infinity.RequestResult. Free with- Infinity.RequestResult.free().- Return type: - Creates a new - Infinity.RequestResultfor a “subscribe-session” request, see- Infinity.Browser.subscribe(). The- Infinity.RequestResultobject is only valid as long as the caller maintains a reference to browser and proxy.
- browser (
- 
Infinity.request_strerror(code)¶
- Parameters: - code ( - Infinity.RequestError) – An error code from the- Infinity.RequestErrorenumeration.- Returns: - A static string that must not be freed. - Return type: - str- Returns a human-readable string for the given error code. 
- 
Infinity.user_status_from_string(string)¶
- Parameters: - string ( - str) – A string representation of a- Infinity.UserStatus.- Raises: - GLib.Error- Returns: - When an error occurred during the conversion, - Falseis returned, and- Trueotherwise.- status: - A pointer to a - Infinity.UserStatusvalue, or- None.- Return type: - ( - bool, status:- Infinity.UserStatus)- This function does the opposite of - Infinity.UserStatus.to_string(). It turns the given string back to a- Infinity.UserStatus, storing the result in status if status is non-- None. If string is invalid, then status is left untouched, error is set and- Falseis returned. Otherwise, the function returns- True.
- 
Infinity.user_status_to_string(status)¶
- Parameters: - status ( - Infinity.UserStatus) – A value from the- Infinity.UserStatusenumeration.- Returns: - A static string representation of status. - Return type: - str- Returns a non-localized string identifying the given status. This is not meant to be shown to a user, but rather to serialize a user status, for example to store it in XML. 
- 
Infinity.xml_util_add_child_text(xml, text)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- text ([str]) – The child text to add.
 - Adds the given text as child text to xml in the same way xmlNodeAddContentLen() would do. The difference is that text is allowed to contain characters that are not valid in - XML text, such as formfeed characters \f. In case one occurs in text, the function adds an <uchar /> element node instead to xml as specified in the infinote protocol. 
- xml (
- 
Infinity.xml_util_get_attribute_double(xml, attribute)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to query.
 - Raises: - Returns: - Whether result was set. - result: - Location to store the read value. - Return type: - Behaves exactly like - Infinity.xml_util_get_attribute_int(). The only difference is that the function reads a double-precision floating point number.
- xml (
- 
Infinity.xml_util_get_attribute_double_required(xml, attribute)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to query.
 - Raises: - Returns: - Whether result was set. - result: - Location to store the read value. - Return type: - Behaves exactly like - Infinity.xml_util_get_attribute_int_required(). The only difference is that the function reads a double-precision floating point number.
- xml (
- 
Infinity.xml_util_get_attribute_int(xml, attribute)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to query.
 - Raises: - Returns: - Whether result was set. - result: - Location to store the read value. - Return type: - Reads the attribute named attribute from the XML element xml. The attribute value is expected to be a signed integral number. If it is the function converts the text to an integer and stores the result into result. In this case, - Trueis returned and error is left untouched.- If the value is not a signed integral number, then the function returns - False, error is set and result is left untouched.- If the attribute does not exist the function returns - Falsebut error is not set.
- xml (
- 
Infinity.xml_util_get_attribute_int_required(xml, attribute)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to query.
 - Raises: - Returns: - Whether result was set. - result: - Location to store the read value. - Return type: - Reads the attribute named attribute from the XML element xml. The attribute value is expected to be a signed integral number. If it is the function converts the text to an integere and stores the result into result. In this case, - Trueis returned and error is left untouched.- If the value is not a signed integral number or the attribute does not exist, then the function returns - False, error is set and result is left untouched.
- xml (
- 
Infinity.xml_util_get_attribute_long(xml, attribute)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to query.
 - Raises: - Returns: - Whether result was set. - result: - Location to store the read value. - Return type: - Behaves exactly like - Infinity.xml_util_get_attribute_int(). The only difference is that the function reads a signed long integral number.
- xml (
- 
Infinity.xml_util_get_attribute_long_required(xml, attribute)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to query.
 - Raises: - Returns: - Whether result was set. - result: - Location to store the read value. - Return type: - Behaves exactly like - Infinity.xml_util_get_attribute_int_required(). The only difference is that the function reads a signed long integral number.
- xml (
- 
Infinity.xml_util_get_attribute_uint(xml, attribute)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to query.
 - Raises: - Returns: - Whether result was set. - result: - Location to store the read value. - Return type: - Behaves exactly like - Infinity.xml_util_get_attribute_int(). The only difference is that the function reads an unsigned integral number.
- xml (
- 
Infinity.xml_util_get_attribute_uint_required(xml, attribute)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to query.
 - Raises: - Returns: - Whether result was set. - result: - Location to store the read value. - Return type: - Behaves exactly like - Infinity.xml_util_get_attribute_int_required(). The only difference is that the function reads an unsigned integral number.
- xml (
- 
Infinity.xml_util_get_attribute_ulong(xml, attribute)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to query.
 - Raises: - Returns: - Whether result was set. - result: - Location to store the read value. - Return type: - Behaves exactly like - Infinity.xml_util_get_attribute_int(). The only difference is that the function reads an unsigned long integral number.
- xml (
- 
Infinity.xml_util_get_attribute_ulong_required(xml, attribute)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to query.
 - Raises: - Returns: - Whether result was set. - result: - Location to store the read value. - Return type: - Behaves exactly like - Infinity.xml_util_get_attribute_int_required(). The only difference is that the function reads an unsigned long integral number.
- xml (
- 
Infinity.xml_util_get_child_text(xml)¶
- Parameters: - xml ( - libxml2.NodePtr) – A- libxml2.NodePtr- Raises: - GLib.Error- Returns: - The node’s child text, or - Noneon error. Free with- GLib.free() when no longer needed.- chars: - Location to store number of characters of child text, or - None.- Return type: - ([ - str], chars:- int)- Reads a node’s child text. If there are <uchar /> child elements, as added by - Infinity.xml_util_add_child_text() this function will convert them back to character codes. There should not be any other child elements in xml.
- 
Infinity.xml_util_new_error_from_node(xml)¶
- Parameters: - xml ( - libxml2.NodePtr) – A- libxml2.NodePtras returned by inf_xml_util_new_node_from_error().- Returns: - A pointer to a new - GLib.Error, or- Noneon failure. It is the caller’s responsibility to dispose the- GLib.Errorobject using- GLib.Error.free().- Return type: - GLib.Error- Creates a new - GLib.Errorwith the domain and erro code given in xml’s attributes. The message is parsed from the child text as with- Infinity.xml_util_get_child_text(). The element name and namespace are ignored. If xml does not have the attributes as expected,- Noneis returned.
- 
Infinity.xml_util_set_attribute(xml, attribute, value)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to set.
- value (str) – The value to set.
 - Sets the attribute named attribute to the given value of the XML element xml. This is a thin wrapper around xmlSetProp(), mainly provided for consistency and for not having to cast the arguments to - libxml2.Char.
- xml (
- 
Infinity.xml_util_set_attribute_double(xml, attribute, value)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to set.
- value (float) – The value to set.
 - Sets the attribute named attribute to the given double-precision floating point number converted to text. 
- xml (
- 
Infinity.xml_util_set_attribute_int(xml, attribute, value)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to set.
- value (int) – The value to set.
 - Sets the attribute named attribute to the given signed integral value converted to text. 
- xml (
- 
Infinity.xml_util_set_attribute_long(xml, attribute, value)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to set.
- value (int) – The value to set.
 - Sets the attribute named attribute to the given signed long integral value converted to text. 
- xml (
- 
Infinity.xml_util_set_attribute_uint(xml, attribute, value)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to set.
- value (int) – The value to set.
 - Sets the attribute named attribute to the given unsigned integral value converted to text. 
- xml (
- 
Infinity.xml_util_set_attribute_ulong(xml, attribute, value)¶
- Parameters: - xml (libxml2.NodePtr) – Alibxml2.NodePtr.
- attribute (str) – The name of the attribute to set.
- value (int) – The value to set.
 - Sets the attribute named attribute to the given unsigned long integral value converted to text. 
- xml (