openConnection static method

void openConnection()

Implementation

static void openConnection() {
  _handleResult(
    _bindings.dc_context_new(context),
    'context creation',
  );

  _handleResult(
    _bindings.dc_context_set_loglevel(
      context.value,
      dc_loglevel_t.DC_LOGLEVEL_WARNING,
    ),
    'log level setting',
  );

  _handleResult(
    _bindings.dc_context_set_logfunc(
      context.value,
      ffi.Pointer.fromFunction(_log),
      ffi.nullptr,
    ),
    'log function setting',
  );
}