/*--------------------------------------------------------------------
 * FICHERO:  TimMes.c
 * OBJETIVO: Definir la funcin Tim_Mes()
 * AUTOR:    Pedro Reina
 * FECHA:    J.20.4.1995
 *------------------------------------------------------------------*/

/*--------------------------------------------------------------------
 * Ficheros de cabecera
 *------------------------------------------------------------------*/

#include "Tiempo.h"

#ifdef OLIMPO_PC
#include <dos.h>                /*  struct date  getdate()          */
#endif

#ifdef OLIMPO_QL
#include <qlib.h>               /* mt_rclck()  cn_date()            */
#include <stdlib.h>             /* atoi()                           */
#include <string.h>             /* strstr()                         */
#endif

/*--------------------------------------------------------------------
 * Definicin de funciones
 *------------------------------------------------------------------*/

/*--------------------------------------------------------------Olimpo
 * FUNCION:  Tim_Mes()
 * OBJETIVO: Decir el mes en curso
 * ENTRADAS: Ninguna
 * SALIDAS:  El mes en curso
 * EJEMPLO:  Tim_Mes ()
 *------------------------------------------------------------------*/

#ifdef OLIMPO_PC
octeto Tim_Mes()
  {
  struct date d;
  getdate(&d);
  return ( (octeto) (d.da_mon) );
  }
#endif

#ifdef OLIMPO_QL
octeto Tim_Mes()
  {
  static char * Meses = "JanFebMarAprMayJunJulAugSepOctNovDec";
  char FechaQL[25];

  cn_date (FechaQL,mt_rclck());
  FechaQL[10] = NULO;

  return ( (octeto) ( strstr (Meses,FechaQL+7) - Meses ) / 3 + 1 );
  }
#endif
