forked from facebook/yoga
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathCSSInterop.cpp
More file actions
27 lines (23 loc) · 777 Bytes
/
CSSInterop.cpp
File metadata and controls
27 lines (23 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#include "CSSInterop.h"
static CSSInteropLoggerFunc gManagedFunc;
static int unmanagedLogger(CSSLogLevel level, const char *format, va_list args) {
int result = 0;
if (gManagedFunc) {
char buffer[256];
result = vsnprintf(buffer, sizeof(buffer), format, args);
(*gManagedFunc)(level, buffer);
}
return result;
}
void CSSInteropSetLogger(CSSInteropLoggerFunc managedFunc) {
gManagedFunc = managedFunc;
CSSLayoutSetLogger(&unmanagedLogger);
}