tf_tstring.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. ==============================================================================*/
  12. #ifndef TENSORFLOW_C_TF_TSTRING_H_
  13. #define TENSORFLOW_C_TF_TSTRING_H_
  14. #include "tensorflow/c/tf_tensor.h"
  15. #include "tensorflow/core/platform/ctstring.h"
  16. #ifdef SWIG
  17. #define TF_CAPI_EXPORT
  18. #else
  19. #if defined(_WIN32)
  20. #ifdef TF_COMPILE_LIBRARY
  21. #define TF_CAPI_EXPORT __declspec(dllexport)
  22. #else
  23. #define TF_CAPI_EXPORT __declspec(dllimport)
  24. #endif // TF_COMPILE_LIBRARY
  25. #else
  26. #define TF_CAPI_EXPORT __attribute__((visibility("default")))
  27. #endif // _WIN32
  28. #endif // SWIG
  29. #ifdef __cplusplus
  30. extern "C" {
  31. #endif
  32. TF_CAPI_EXPORT extern void TF_StringInit(TF_TString *t);
  33. TF_CAPI_EXPORT extern void TF_StringCopy(TF_TString *dst, const char *src,
  34. size_t size);
  35. TF_CAPI_EXPORT extern void TF_StringAssignView(TF_TString *dst, const char *src,
  36. size_t size);
  37. TF_CAPI_EXPORT extern const char *TF_StringGetDataPointer(
  38. const TF_TString *tstr);
  39. TF_CAPI_EXPORT extern TF_TString_Type TF_StringGetType(const TF_TString *str);
  40. TF_CAPI_EXPORT extern size_t TF_StringGetSize(const TF_TString *tstr);
  41. TF_CAPI_EXPORT extern size_t TF_StringGetCapacity(const TF_TString *str);
  42. TF_CAPI_EXPORT extern void TF_StringDealloc(TF_TString *tstr);
  43. #ifdef __cplusplus
  44. } /* end extern "C" */
  45. #endif
  46. #endif // THIRD_PARTY_TENSORFLOW_C_TF_TSTRING_H_
粤ICP备19079148号