Login
Artifact [399791a0f9]
Login

Artifact 399791a0f92e7eb11d92a3efe547cc71eb20e8f3:


/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 
/* vim: set ts=2 et sw=2 tw=80: */
/*
** Copyright (c) 2013 D. Richard Hipp
**
** This program is free software; you can redistribute it and/or
** modify it under the terms of the Simplified BSD License (also
** known as the "2-Clause License" or "FreeBSD License".)
**
** This program is distributed in the hope that it will be useful,
** but without any warranty; without even the implied warranty of
** merchantability or fitness for a particular purpose.
**
** Author contact information:
**   drh@hwaci.com
**   http://www.hwaci.com/drh/
**
*******************************************************************************
*/

#include "fossil-scm/fossil-cli.h"
#include "fossil-scm/fossil-internal.h"

void fcli_local_help(){
  printf("Usage:\n\t%s [options]\n\n", fcli.appName);

  puts("Shows the sizeof() values for various fsl API types.\n");
}


int main(int argc, char * const * argv ){
  typedef fsl_double_t julian_date_pseudotype /* only for output purposes */;


#define T(X) printf("\tstrlen(fsl_schema_"#X") = %u\n", (unsigned)fsl_strlen(fsl_schema_##X()))
  puts("SQL schema sizes:");
  T(config);
  T(repo1);
  T(repo2);
  T(checkout);
  T(ticket_reports);
#undef T

  puts("\nsizeof() values and format strings for various numeric types:");
#define MI(X) printf(#X" = %d\n", X)
  MI(HAVE_LONG_LONG);
#undef MI
#define FT(X,FMT) printf("%-6d "#X" fmt=%%%s\n", (int)sizeof(X),FMT)
#define T(X) printf("%-6d "#X"\n", (int)sizeof(X))
  FT(fsl_int32_t,FSL_INT32_T_PFMT);
  FT(fsl_uint32_t,FSL_UINT32_T_PFMT);
  FT(fsl_int64_t,FSL_INT64_T_PFMT);
  FT(fsl_uint64_t,FSL_UINT64_T_PFMT);
  FT(fsl_int_t,FSL_INT_T_PFMT);
  FT(fsl_id_t,FSL_ID_T_PFMT);
  FT(fsl_size_t,FSL_SIZE_T_PFMT);
  FT(fsl_double_t,FSL_DOUBLE_T_PFMT);
  FT(julian_date_pseudotype,FSL_JULIAN_T_PFMT);
  T(long);
  puts("(note that the API tries to guaranty _minimum_ sizes, not _fixed_ (C99 does that))");
#undef FT
  
  puts("\nsizeof() values for various structs:");
  T(fsl_acache);
  T(fsl_acache_line);
  T(fsl_allocator);
  T(fsl_buffer);
  T(fsl_cx);
  T(fsl_cx_config);
  T(fsl_db);
  T(fsl_deck);
  T(fsl_error);
  T(fsl_finalizer);
  T(fsl_fstat);
  T(fsl_id_bag);
  T(fsl_cx_init_opt);
  T(fsl_list);
  T(fsl_md5_cx);
  T(fsl_card_F);
  T(fsl_card_J);
  T(fsl_card_Q);
  T(fsl_card_T);
  T(fsl_outputer);
  T(fsl_pq);
  T(fsl_pq_e);
  T(fsl_sha1_cx);
  T(fsl_state);
  T(fsl_stmt);
#undef T
  return 0;
}