<commit_before>#include <stdlib.h>

#include "graphics.h"
#include "surface.h"
#include "time-module.h"

typedef struct TimeModule {
  Module base;
} TimeModule;

Module* newTimeModule()
{
  TimeModule* module = malloc(sizeof(TimeModule));
  module->base.width = 150;
  module->base.height = 100;
  module->base.updateFunc = updateTimeModule;
  module->base.freeFunc = freeTimeModule;
  return (Module*)module;
}

void freeTimeModule(Module* module)
{
  free(module);
}

void updateTimeModule(Module* module, Surface* surface)
{
  setDrawColor(surface, 1.0, 1.0, 1.0, 0.8);
  drawRect(surface, 0, 0, module->width, module->height);

  setDrawColor(surface, 0, 0, 0, 0.8);
  drawText(surface, 10, 10, 32, "monaco", "Good");
}<commit_msg>Replace placeholder string in time module with time.<commit_after>#include <stdlib.h>
#include <time.h>

#include "graphics.h"
#include "surface.h"
#include "time-module.h"

typedef struct TimeModule {
  Module base;
} TimeModule;

Module* newTimeModule()
{
  TimeModule* module = malloc(sizeof(TimeModule));
  module->base.width = 150;
  module->base.height = 100;
  module->base.updateFunc = updateTimeModule;
  module->base.freeFunc = freeTimeModule;
  return (Module*)module;
}

void freeTimeModule(Module* module)
{
  free(module);
}

void updateTimeModule(Module* module, Surface* surface)
{
  // Get the current time
  time_t t;
  struct tm* tm;
  t = time(NULL);
  tm = localtime(&t);

  char strTime[6];
  strftime(strTime, sizeof strTime, "%H:%M", tm);

  // Draw the rect
  setDrawColor(surface, 1.0, 1.0, 1.0, 0.8);
  drawRect(surface, 0, 0, module->width, module->height);

  // Draw the time
  setDrawColor(surface, 0, 0, 0, 0.8);
  drawText(surface, 10, 10, 32, "monaco", strTime);
}
{'fraction_non_alphanumeric': 0.15513264129181084, 'fraction_numerical': 0.031718569780853516, 'mean_word_length': 4.578778135048232, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2438265', 'n_tokens_mistral': 672, 'n_tokens_neox': 614, 'n_words': 153}