Exemplo n.º 1
0
UStringRep* UObjectIO::create()
{
   U_TRACE(0, "UObjectIO::create()")

   UObjectIO::output();

   UStringRep* rep = U_NEW(UStringRep(buffer_output, buffer_output_len));

   U_INTERNAL_PRINT("rep = %.*S", U_STRING_TO_TRACE(*rep))

   U_RETURN_POINTER(rep, UStringRep);
}
Exemplo n.º 2
0
void UObjectIO::output()
{
   U_INTERNAL_TRACE("UObjectIO::output()")

   U_INTERNAL_ASSERT_POINTER(os)

   buffer_output_len = os->pcount();

   U_INTERNAL_PRINT("os->pcount() = %d", buffer_output_len)

   U_INTERNAL_ASSERT_MINOR(buffer_output_len, buffer_output_sz)

   buffer_output[buffer_output_len] = '\0';

   U_INTERNAL_PRINT("buffer_output = %.*s", U_min(buffer_output_len,128), buffer_output)

#ifdef DEBUG_DEBUG
   off_t pos = os->rdbuf()->pubseekpos(0, U_openmode);
#else
        (void) os->rdbuf()->pubseekpos(0, U_openmode);
#endif

   U_INTERNAL_PRINT("pos = %ld, os->pcount() = %d", pos, os->pcount())
}
Exemplo n.º 3
0
int main(int argc, char** argv)
{
   u_init_ulib(argv);

   U_INTERNAL_TRACE("main(%d,%p)", argc, argv)

   U_INTERNAL_PRINT("argv[0] = %s\nargv[1] = %s", argv[0], argv[1])

   if      (argc == 2)                                                    u_do_cipher(argv[1], U_ENCRYPT);
   else if (argc == 3 && memcmp(argv[1], U_CONSTANT_TO_PARAM("-d")) == 0) u_do_cipher(argv[2], U_DECRYPT);
   else
      {
      fprintf(stderr, "%s", usage);

      exit(1);
      }

   return 0;
}