1/* 2 * Copyright (C) 2006 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#ifndef _CUTILS_TZTIME_H 18#define _CUTILS_TZTIME_H 19 20#include <time.h> 21 22#ifdef __cplusplus 23extern "C" { 24#endif 25 26time_t mktime_tz(struct tm * const tmp, char const * tz); 27void localtime_tz(const time_t * const timep, struct tm * tmp, const char* tz); 28 29#ifdef HAVE_ANDROID_OS 30 31/* the following is defined in the Bionic C library on Android, but the 32 * declarations are only available through a platform-private header 33 */ 34#include <bionic_time.h> 35 36#else /* !HAVE_ANDROID_OS */ 37 38struct strftime_locale { 39 const char *mon[12]; /* short names */ 40 const char *month[12]; /* long names */ 41 const char *standalone_month[12]; /* long standalone names */ 42 const char *wday[7]; /* short names */ 43 const char *weekday[7]; /* long names */ 44 const char *X_fmt; 45 const char *x_fmt; 46 const char *c_fmt; 47 const char *am; 48 const char *pm; 49 const char *date_fmt; 50}; 51 52size_t strftime_tz(char *s, size_t max, const char *format, const struct tm *tm, const struct strftime_locale *locale); 53 54#endif /* !HAVE_ANDROID_OS */ 55 56#ifdef __cplusplus 57} 58#endif 59 60#endif /* __CUTILS_TZTIME_H */ 61 62