-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
upb: lock down the internal headers for upb:wire_reader
PiperOrigin-RevId: 594500838
- Loading branch information
1 parent
499c748
commit 9ca65f4
Showing
11 changed files
with
74 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// Protocol Buffers - Google's data interchange format | ||
// Copyright 2023 Google LLC. All rights reserved. | ||
// | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file or at | ||
// https://developers.google.com/open-source/licenses/bsd | ||
|
||
#include "upb/wire/internal/decoder.h" | ||
|
||
#include "upb/message/internal/message.h" | ||
#include "upb/wire/decode.h" | ||
#include "upb/wire/eps_copy_input_stream.h" | ||
|
||
// Must be last. | ||
#include "upb/port/def.inc" | ||
|
||
const char* _upb_Decoder_BufferFlipCallback(upb_EpsCopyInputStream* e, | ||
const char* old_end, | ||
const char* new_start) { | ||
upb_Decoder* d = (upb_Decoder*)e; | ||
if (!old_end) _upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_Malformed); | ||
|
||
if (d->unknown) { | ||
if (!UPB_PRIVATE(_upb_Message_AddUnknown)( | ||
d->unknown_msg, d->unknown, old_end - d->unknown, &d->arena)) { | ||
_upb_FastDecoder_ErrorJmp(d, kUpb_DecodeStatus_OutOfMemory); | ||
} | ||
d->unknown = new_start; | ||
} | ||
return new_start; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters