/* Generated by the protocol buffer compiler.  DO NOT EDIT! */
/* Generated from: google/protobuf/duration.proto */

#ifndef PROTOBUF_C_google_2fprotobuf_2fduration_2eproto__INCLUDED
#define PROTOBUF_C_google_2fprotobuf_2fduration_2eproto__INCLUDED

#include <protobuf-c/protobuf-c.h>

PROTOBUF_C__BEGIN_DECLS

#if PROTOBUF_C_VERSION_NUMBER < 1000000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1002001 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif


typedef struct _Google__Protobuf__Duration Google__Protobuf__Duration;


/* --- enums --- */


/* --- messages --- */

/*
 * A Duration represents a signed, fixed-length span of time represented
 * as a count of seconds and fractions of seconds at nanosecond
 * resolution. It is independent of any calendar and concepts like "day"
 * or "month". It is related to Timestamp in that the difference between
 * two Timestamp values is a Duration and it can be added or subtracted
 * from a Timestamp. Range is approximately +-10,000 years.
 * Example 1: Compute Duration from two Timestamps in pseudo code.
 *     Timestamp start = ...;
 *     Timestamp end = ...;
 *     Duration duration = ...;
 *     duration.seconds = end.seconds - start.seconds;
 *     duration.nanos = end.nanos - start.nanos;
 *     if (duration.seconds < 0 && duration.nanos > 0) {
 *       duration.seconds += 1;
 *       duration.nanos -= 1000000000;
 *     } else if (durations.seconds > 0 && duration.nanos < 0) {
 *       duration.seconds -= 1;
 *       duration.nanos += 1000000000;
 *     }
 * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
 *     Timestamp start = ...;
 *     Duration duration = ...;
 *     Timestamp end = ...;
 *     end.seconds = start.seconds + duration.seconds;
 *     end.nanos = start.nanos + duration.nanos;
 *     if (end.nanos < 0) {
 *       end.seconds -= 1;
 *       end.nanos += 1000000000;
 *     } else if (end.nanos >= 1000000000) {
 *       end.seconds += 1;
 *       end.nanos -= 1000000000;
 *     }
 */
struct  _Google__Protobuf__Duration
{
  ProtobufCMessage base;
  /*
   * Signed seconds of the span of time. Must be from -315,576,000,000
   * to +315,576,000,000 inclusive.
   */
  protobuf_c_boolean has_seconds;
  int64_t seconds;
  /*
   * Signed fractions of a second at nanosecond resolution of the span
   * of time. Durations less than one second are represented with a 0
   * `seconds` field and a positive or negative `nanos` field. For durations
   * of one second or more, a non-zero value for the `nanos` field must be
   * of the same sign as the `seconds` field. Must be from -999,999,999
   * to +999,999,999 inclusive.
   */
  protobuf_c_boolean has_nanos;
  int32_t nanos;
};
#define GOOGLE__PROTOBUF__DURATION__INIT \
 { PROTOBUF_C_MESSAGE_INIT (&google__protobuf__duration__descriptor) \
    , 0,0, 0,0 }


/* Google__Protobuf__Duration methods */
void   google__protobuf__duration__init
                     (Google__Protobuf__Duration         *message);
size_t google__protobuf__duration__get_packed_size
                     (const Google__Protobuf__Duration   *message);
size_t google__protobuf__duration__pack
                     (const Google__Protobuf__Duration   *message,
                      uint8_t             *out);
size_t google__protobuf__duration__pack_to_buffer
                     (const Google__Protobuf__Duration   *message,
                      ProtobufCBuffer     *buffer);
Google__Protobuf__Duration *
       google__protobuf__duration__unpack
                     (ProtobufCAllocator  *allocator,
                      size_t               len,
                      const uint8_t       *data);
void   google__protobuf__duration__free_unpacked
                     (Google__Protobuf__Duration *message,
                      ProtobufCAllocator *allocator);
/* --- per-message closures --- */

typedef void (*Google__Protobuf__Duration_Closure)
                 (const Google__Protobuf__Duration *message,
                  void *closure_data);

/* --- services --- */


/* --- descriptors --- */

extern const ProtobufCMessageDescriptor google__protobuf__duration__descriptor;

PROTOBUF_C__END_DECLS


#endif  /* PROTOBUF_C_google_2fprotobuf_2fduration_2eproto__INCLUDED */
