Gjsify LogoGjsify Logo

Index

Functions

  • errorNewLiteral(domain: number, code: number, message: string): GLib.Error
  • Creates a new #GError; unlike gvir_error_new(), message is not a printf()-style format string. Use this function if message contains text you don't have control over, that could include printf() escape sequences.

    Parameters

    • domain: number

      error domain

    • code: number

      error code

    • message: string

      error message

    Returns GLib.Error

  • eventRegister(): void
  • Registers a libvirt event loop implementation that is backed by the default GMain context. If invoked more than once this method will be a no-op. Applications should, however, take care not to register any another non-GLib event loop with libvirt.

    After invoking this method, it is mandatory to run the default GMain event loop. Typically this can be satisfied by invoking gtk_main or g_application_run in the application's main thread. Failure to run the event loop will mean no libvirt events get dispatched, and the libvirt keepalive timer will kill off libvirt connections frequently.

    Returns void

  • init(argv: string[]): string[] | null
  • Call this function before using any other Libvirt GLib functions in your applications. It will initialize everything needed to operate the toolkit and parses some standard command line options.

    Although you are expected to pass the argc, argv parameters from main() to this function, it is possible to pass NULL if argv is not available or commandline handling is not required.

    argc and argv are adjusted accordingly so your own code will never see those standard arguments.

    This method will also turn on debug logging of the library if the LIBVIRT_GLIB_DEBUG environment variable is set.

    This function will terminate your program if it was unable to initialize for some reason. If you want the program to fall back to an alternate mode of operation call gvir_init_check instead.

    Parameters

    • argv: string[]

      Address of the argv parameter of main(), or %NULL. Any options understood by GTK+ are stripped before return.

    Returns string[] | null

  • initCheck(argv: string[]): [boolean, string[] | null]
  • This function does the same work as gvir_init() with only a single change: It does not terminate the program if the Libvirt GLib library can't be initialized. Instead it returns %FALSE on failure.

    This way the application can fall back to some other mode of operation.

    Parameters

    • argv: string[]

      Address of the argv parameter of main(), or %NULL. Any options understood by GTK+ are stripped before return.

    Returns [boolean, string[] | null]

  • setErrorLiteral(error: GLib.Error, domain: number, code: number, message: string): void
  • If error is NULL this does nothing. Otherwise it creates a new #GError and stores it in error; unlike gvir_set_error(), message is not a printf()-style format string. Use this function if message contains text you don't have control over, that could include printf() escape sequences.

    Parameters

    • error: GLib.Error

      pointer to error location

    • domain: number

      error domain

    • code: number

      error code

    • message: string

      error message

    Returns void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method