FreeBASIC  0.91.0
drv_intl_getmonthname.c
Go to the documentation of this file.
1 /* get localized month name */
2 
3 #include "../fb.h"
4 #include "fb_private_intl.h"
5 
6 FBSTRING *fb_DrvIntlGetMonthName( int month, int short_names )
7 {
8  FBSTRING *result = NULL;
9  size_t i;
11 
12  if( !fb_hIntlGetInfo( &Info ) )
13  return NULL;
14 
15  for( i=0; i!=__fb_locale_info_count; ++i) {
16  const FB_LOCALE_INFOS *info = __fb_locale_infos + i;
17  if( info->country_code==Info.country_id ) {
18  const char *name = ( short_names ? info->apszNamesMonthShort[month-1] : info->apszNamesMonthLong[month-1] );
19  result = fb_StrAllocTempDescZ( name );
20  break;
21  }
22  }
23 
24  return result;
25 }