Flutter Engine
The Flutter Engine
utils_android.cc
Go to the documentation of this file.
1// Copyright (c) 2012, 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#include "platform/globals.h"
6#if defined(DART_HOST_OS_ANDROID)
7
8#include "platform/utils.h"
10
11namespace dart {
12
13char* Utils::StrNDup(const char* s, intptr_t n) {
14 return strndup(s, n);
15}
16
17char* Utils::StrDup(const char* s) {
18 return strdup(s);
19}
20
21intptr_t Utils::StrNLen(const char* s, intptr_t n) {
22 return strnlen(s, n);
23}
24
25int Utils::SNPrint(char* str, size_t size, const char* format, ...) {
26 va_list args;
28 int retval = VSNPrint(str, size, format, args);
29 va_end(args);
30 return retval;
31}
32
33int Utils::VSNPrint(char* str, size_t size, const char* format, va_list args) {
34 int retval = vsnprintf(str, size, format, args);
35 if (retval < 0) {
36 FATAL("Fatal error in Utils::VSNPrint with format '%s'", format);
37 }
38 return retval;
39}
40
41int Utils::Close(int fildes) {
42 return close(fildes);
43}
44size_t Utils::Read(int filedes, void* buf, size_t nbyte) {
45 return read(filedes, buf, nbyte);
46}
47int Utils::Unlink(const char* path) {
48 return unlink(path);
49}
50
51} // namespace dart
52
53#endif // defined(DART_HOST_OS_ANDROID)
static bool read(SkStream *stream, void *buffer, size_t amount)
static int SNPrint(char *str, size_t size, const char *format,...) PRINTF_ATTRIBUTE(3
static char * StrDup(const char *s)
static int static int VSNPrint(char *str, size_t size, const char *format, va_list args)
static size_t Read(int filedes, void *buf, size_t nbyte)
static intptr_t StrNLen(const char *s, intptr_t n)
static int Close(int fildes)
static int Unlink(const char *path)
static char * StrNDup(const char *s, intptr_t n)
struct MyStruct s
#define FATAL(error)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint32_t uint32_t * format
va_start(args, format)
va_end(args)
Definition: dart_vm.cc:33
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
char * strdup(const char *str1)