Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
dart-lang
sdk
runtime
platform
utils_fuchsia.h
Go to the documentation of this file.
1
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2
// for details. All rights reserved. Use of this source code is governed by a
3
// BSD-style license that can be found in the LICENSE file.
4
5
#ifndef RUNTIME_PLATFORM_UTILS_FUCHSIA_H_
6
#define RUNTIME_PLATFORM_UTILS_FUCHSIA_H_
7
8
#include <endian.h>
9
#include <memory>
10
11
namespace
sys
{
12
13
// From Fuchsia SDK.
14
class
ComponentContext;
15
16
}
// namespace sys
17
18
namespace
inspect
{
19
20
// From Fuchsia SDK.
21
class
Node
;
22
23
}
// namespace inspect
24
25
namespace
dart
{
26
27
inline
uint16_t
Utils::HostToBigEndian16
(uint16_t value) {
28
return
htobe16(value);
29
}
30
31
inline
uint32_t
Utils::HostToBigEndian32
(uint32_t value) {
32
return
htobe32(value);
33
}
34
35
inline
uint64_t
Utils::HostToBigEndian64
(uint64_t value) {
36
return
htobe64(value);
37
}
38
39
inline
uint16_t
Utils::HostToLittleEndian16
(uint16_t value) {
40
return
htole16(value);
41
}
42
43
inline
uint32_t
Utils::HostToLittleEndian32
(uint32_t value) {
44
return
htole32(value);
45
}
46
47
inline
uint64_t
Utils::HostToLittleEndian64
(uint64_t value) {
48
return
htole64(value);
49
}
50
51
inline
char
*
Utils::StrError
(
int
err,
char
*
buffer
,
size_t
bufsize) {
52
if
(strerror_r(err,
buffer
, bufsize) != 0) {
53
snprintf(
buffer
, bufsize,
"%s"
,
"strerror_r failed"
);
54
}
55
return
buffer
;
56
}
57
58
// Returns the singleton component context for this process.
59
//
60
// The returned pointer is never null. The caller must not take ownership of
61
// the context.
62
//
63
// The context is a singleton as it can be meaningfully instantiated only once
64
// during the lifetime of the program. If you use this function, you MUST NOT
65
// call sys::ComponentContext::Create().
66
sys::ComponentContext*
ComponentContext
();
67
68
// Sets the inspect node set to be used in the dart vm
69
//
70
// This method will take ownership of the node
71
void
SetDartVmNode
(std::unique_ptr<inspect::Node> node);
72
73
// Returns the inspect node set in SetDartVmNode().
74
//
75
// The caller should take ownership of the returned node because
76
// the value will be set to null after this call.
77
// This call may return null if no node is provided.
78
std::unique_ptr<inspect::Node>
TakeDartVmNode
();
79
80
}
// namespace dart
81
82
#endif
// RUNTIME_PLATFORM_UTILS_FUCHSIA_H_
dart::Utils::HostToBigEndian64
static uint64_t HostToBigEndian64(uint64_t host_value)
Definition
utils_android.h:24
dart::Utils::HostToLittleEndian64
static uint64_t HostToLittleEndian64(uint64_t host_value)
Definition
utils_android.h:36
dart::Utils::HostToLittleEndian16
static uint16_t HostToLittleEndian16(uint16_t host_value)
Definition
utils_android.h:28
dart::Utils::StrError
static char * StrError(int err, char *buffer, size_t bufsize)
Definition
utils_android.h:40
dart::Utils::HostToLittleEndian32
static uint32_t HostToLittleEndian32(uint32_t host_value)
Definition
utils_android.h:32
dart::Utils::HostToBigEndian16
static uint16_t HostToBigEndian16(uint16_t host_value)
Definition
utils_android.h:16
dart::Utils::HostToBigEndian32
static uint32_t HostToBigEndian32(uint32_t host_value)
Definition
utils_android.h:20
buffer
static const uint8_t buffer[]
Definition
fl_pixel_buffer_texture_test.cc:44
Node
Definition
dart.idl:29
dart
Definition
dart_vm.cc:33
dart::SetDartVmNode
void SetDartVmNode(std::unique_ptr< inspect::Node > node)
dart::ComponentContext
sys::ComponentContext * ComponentContext()
dart::TakeDartVmNode
std::unique_ptr< inspect::Node > TakeDartVmNode()
inspect
Definition
utils_fuchsia.h:18
sys
Definition
utils_fuchsia.h:11
Generated on Fri Apr 26 2024 06:14:44 for Flutter Engine by
1.9.8