Beispiel #1
0
enum dom_code  sgml_file_dumper_attribute_push( struct dom_stack *stack, struct dom_node *node, void *data )
{
  if ( node->parent[0] == 7 )
  {
    return DOM_CODE_OK;
  }
  __fprintf_chk( &stack->current[0].data[0], 1, " %.*s", node->string.length, (char*)node->string.string );
  if ( node->data.document.children )
  {
    if ( node->data.attribute.quoted )
      __fprintf_chk( &stack->current[0].data[0], 1, "=%c%.*s%c", node->data.attribute.quoted, node->data.document.document, (char*)node->data.document.children, node->data.attribute.quoted );
    else
    {
      __fprintf_chk( &stack->current[0].data[0], 1, "=\"%.*s\"", node->data.document.document, (char*)get_dom_node_next( &node[0] ) );
      if ( get_dom_node_next( &node[0] ) )
      {
        return DOM_CODE_OK;
      }
      __fprintf_chk( &stack->current[0].data[0], 1, ">" );
      return DOM_CODE_OK;
    }
  }
  if ( get_dom_node_next( &node[0] ) == 0 )
  {
    __fprintf_chk( &stack->current[0].data[0], 1, ">" );
  }
  return DOM_CODE_OK;
}
Beispiel #2
0
enum dom_code  sgml_file_dumper_element_push( struct dom_stack *stack, struct dom_node *node, void *data )
{
  __fprintf_chk( &stack->current[0].data[0], 1, "<%.*s", node->string.length, (char*)node->string.string );
  if ( node->data.document.children == 0 || node->data.document.children->size == 0 )
  {
    __fprintf_chk( &stack->current[0].data[0], 1, ">" );
  }
  return DOM_CODE_OK;
}
Beispiel #3
0
void MyFatal( char *Format, ... )
{
  /* phantom */ va_list args;
  EmergencySave( );
  __fprintf_chk( stderr, 1, "%s (%i): fatal, ", Progname, getpid( ) );
  __vfprintf_chk( stderr, 1, Format, ebp_12 );
  fflush( stderr );
  exit( 1 );
}
Beispiel #4
0
void pcb_dbus_connection_finish_with_mainloop( DBusConnection *connection )
{
  if ( dbus_connection_set_watch_functions( &connection, 0, 0, 0, 0, 0 ) && dbus_connection_set_timeout_functions( &connection, 0, 0, 0, 0, 0 ) )
  {
    dbus_connection_set_dispatch_status_function( &connection, 0, 0, 0 );
    return;
  }
  __fprintf_chk( stderr, 1, "Not enough memory when cleaning up DBusConnection mainloop integration\n" );
  return;
}
Beispiel #5
0
void pcb_dbus_setup( void )
{
  DBusError err;
  int ret;
  DBusObjectPathVTable object_vtable;
  object_vtable.unregister_function = &unregister_dbus_handler;
  object_vtable.message_function = &handle_dbus_message;
  object_vtable.dbus_internal_pad1 = 0;
  object_vtable.dbus_internal_pad2 = 0;
  object_vtable.dbus_internal_pad3 = 0;
  object_vtable.dbus_internal_pad4 = 0;
  dbus_error_init( err.name );
  pcb_dbus_conn = dbus_bus_get_private( 0, err.name );
  if ( dbus_error_is_set( err.name ) )
  {
    __fprintf_chk( stderr, 1, "pcb_dbus: DBus connection Error (%s)\n", err.message );
    dbus_error_free( err.name );
  }
  if ( pcb_dbus_conn )
  {
    ret = dbus_bus_request_name( &pcb_dbus_conn, "org.seul.geda.pcb", 2, err.name );
    if ( dbus_error_is_set( err.name ) )
    {
      __fprintf_chk( stderr, 1, "pcb_dbus: DBus name error (%s)\n", err.message );
      dbus_error_free( err.name );
    }
    if ( ret + -1 + -1 > 1 )
    {
      __fprintf_chk( stderr, 1, "pcb_dbus: Couldn't gain ownership or queued ownership of the canonical DBus name\n" );
    }
    else
    {
      if ( dbus_connection_register_object_path( &pcb_dbus_conn, "/org/seul/geda/pcb", object_vtable.unregister_function, 0 ) )
      {
        pcb_dbus_connection_setup_with_mainloop( &pcb_dbus_conn );
        return;
      }
      __fprintf_chk( stderr, 1, "pcb_dbus: Couldn't register DBUS handler for %s\n", "/org/seul/geda/pcb" );
      return;
    }
  }
  return;
}
Beispiel #6
0
void exit_program( int exit_value )
{
  reset_attr( );
  if ( html_flag )
    __printf_chk( 1, "</pre>\n" );
  if ( readline_enabled && write_history( history_filename ) )
    __fprintf_chk( stderr, 1, "%s: Unable to save readline history into file \"%s\".\n", prog_name, history_filename );
  if ( exit_value == 0 && quiet_mode == 0 && html_flag == 0 )
    __printf_chk( 1, "Thank you for using Mathomatic!\n" );
  exit( exit_value );
}
Beispiel #7
0
void pcb_dbus_connection_setup_with_mainloop( DBusConnection *connection )
{
  if ( dbus_connection_set_watch_functions( &connection, &watch_add, &watch_remove, &watch_toggled, 0, 0 ) && dbus_connection_set_timeout_functions( &connection, &timeout_add, &timeout_remove, &timeout_toggled, 0, 0 ) )
  {
    dbus_connection_set_dispatch_status_function( &connection, &dispatch_status_changed, 0, 0 );
    gui->add_block_hook( ebp_12, block_hook_cb, connection );
    return;
  }
  __fprintf_chk( stderr, 1, "Not enough memory to set up DBusConnection for use with PCB\n" );
  return;
}
Beispiel #8
0
enum dom_code  sgml_file_dumper_entity_ref_push( struct dom_stack *stack, struct dom_node *node, void *data )
{
  __fprintf_chk( &stack->current[0].data[0], 1, "&%.*s;", node->string.length, (char*)node->string.string );
  return DOM_CODE_OK;
}
Beispiel #9
0
enum dom_code  sgml_file_dumper_cdata_section_push( struct dom_stack *stack, struct dom_node *node, void *data )
{
  __fprintf_chk( &stack->current[0].data[0], 1, "<![CDATA[%.*s]]>", node->string.length, (char*)node->string.string );
  return DOM_CODE_OK;
}
Beispiel #10
0
enum dom_code  sgml_file_dumper_proc_instruction_push( struct dom_stack *stack, struct dom_node *node, void *data )
{
  __fprintf_chk( &stack->current[0].data[0], 1, "<?%.*s %.*s?>", node->string.length, (char*)node->string.string, node->data.document.document, (char*)node->data.document.children );
  return DOM_CODE_OK;
}
Beispiel #11
0
enum dom_code  sgml_file_dumper_element_pop( struct dom_stack *stack, struct dom_node *node, void *data )
{
  __fprintf_chk( &stack->current[0].data[0], 1, "</%.*s>", node->string.length, (char*)node->string.string );
  return DOM_CODE_OK;
}
Beispiel #12
0
int main( int argc, char **argv )
{
  int eax;
  double fp7;
  int i;
  char *cp = &ebx;
  double numerator, denominator;
  double new_size;
  int coption, boption, wide_flag;
  init_gvars( );
  default_out = stdout;
  gfp = stdout;
  wide_flag = 0;
  coption = 0;
  if ( i >= 0 )
  {
    if ( i + -98 + -98 <= 22 )
    {
      ;
    }
    usage( );
    exit( 2 );
  }
  else
  {
    if ( n_tokens <= 99 )
    {
      __fprintf_chk( stderr, 1, "%s: Expression array size too small.\n", prog_name );
      exit( 2 );
    }
    if ( init_mem( ) == 0 )
    {
      __fprintf_chk( stderr, 1, "%s: Not enough memory.\n", prog_name );
      exit( 2 );
    }
    if ( readline_enabled )
    {
      if ( numerator && prog_name )
      {
        __snprintf_chk( history_filename_storage, 4096, 1, 4096, "%s/.%s_history", cp, prog_name );
        history_filename = history_filename_storage;
      }
      rl_initialize( );
      using_history( );
      stifle_history( 500 );
      rl_inhibit_completion = 1;
      if ( html_flag == 0 )
      {
        color_flag = tigetnum( "colors" ) > 7;
      }
      read_history( history_filename );
    }
    get_screen_size( );
    if ( html_flag )
      __printf_chk( 1, "&lt;pre&gt;\n" );
    if ( test_mode == 0 )
    {
      if ( quiet_mode == 0 )
      {
        if ( security_level > 1 )
          __printf_chk( 1, "Secure " );
        __printf_chk( 1, "Mathomatic version %s (www.mathomatic.org)\n", "15.1.1" );
        __printf_chk( 1, "Copyright (C) 1987-2010 George Gesslein II.\n" );
        __printf_chk( 1, "%d equation spaces available, %ld kilobytes per equation space.\n", 100, (/*HI*/int)( ( n_tokens << 5 ) * 0x10624dd3 ) >> 6 );
        if ( test_mode == 0 )
          goto B32;
      }
B32:;
      if ( load_rc( ) == 0 )
        __fprintf_chk( stderr, 1, "%s: Error loading set options from \"%s\".\n", prog_name, rc_file );
    }
    if ( wide_flag )
    {
      screen_columns = 0;
      screen_rows = 0;
    }
    if ( coption & 1 )
      color_flag = color_flag == 0;
    if ( 0 )
    {
      color_flag = 1;
      bold_colors = 1;
    }
    if ( test_mode )
      color_flag = 0;
    if ( quiet_mode == 0 && color_flag )
    {
      __printf_chk( 1, "%s%s color mode enabled", html_flag != 0 ? "ANSI" : "HTML", bold_colors == 0 ? " bold" : "" );
      if ( 0 )
        __printf_chk( 1, ".\n" );
      else
        __printf_chk( 1, "; disable with the -c option or \"set no color\".\n" );
    }
    i = _setjmp( &jmp_save[0].__jmpbuf[0] );
    if ( _setjmp( &jmp_save[0].__jmpbuf[0] ) )
    {
      clean_up( );
      if ( i == 14 )
        error( "Expression too large." );
      __printf_chk( 1, "Operation aborted.\n" );
    }
    else
    {
      if ( set_signals( ) == 0 )
        __fprintf_chk( stderr, 1, "signal(2) setting failed.\n" );
      if ( !f_to_fraction( 0.500000000000, &denominator, ebp_36 ) || denominator != 1.000000000000 || ebp_36 != 2.000000000000 || 0 || !f_to_fraction( 0.333333333333, &denominator, ebp_36 ) || denominator != 1.000000000000 || 0 || ebp_36 != 3.000000000000 || ebp_36 != 3.000000000000 )
      {
        __fprintf_chk( stderr, 1, "%s: Cannot convert any floating point values to fractions.\n", prog_name );
        __fprintf_chk( stderr, 1, "Roots will not work properly.\n" );
      }
      i = optind;
      if ( argc <= optind || argv[ i ] == 0 )
      {
        main_io_loop( );
        exit_program( 0 );
        return 0;
      }
    {
      /* phantom */ size_t __s1_len;
      /* phantom */ size_t __s2_len;
      unsigned char *__s1;
      /* phantom */ int __result;
      do
      {
        if ( '-' == argv[ i ][0] && argv[ i ][1] == 0 )
          main_io_loop( );
        else
        {
          if ( read_file( argv[ i ] ) == 0 )
          {
            __fprintf_chk( stderr, 1, "Read of file \"%s\" failed.\n", argv[ i ] );
            exit_program( 1 );
          }
        }
        i++;
      }
      while ( i + 1 < argc && argv[ i + 1 + 1 ] );
    }
    }
  }
}
Beispiel #13
0
DBusHandlerResult handle_dbus_message( DBusConnection *connection, DBusMessage *message, void *data )
{
  int eax;
  int esi;
  int msg_type;
  switch ( msg_type )
  {
  default:
    break;
  case 4:
    break;
  case 3:
    break;
  case 2:
    break;
  case 1:
  {
    char *method_name;
    char *interface_name;
    if ( dbus_message_get_member( &message ) )
    {
      if ( interface_name )
      {
        /* phantom */ size_t __s1_len;
        /* phantom */ size_t __s2_len;
        strcmp( "org.seul.geda.pcb", interface_name );
        if ( 1 )
        {
          /* phantom */ size_t __s1_len;
          /* phantom */ size_t __s2_len;
          method_name[0] = dbus_message_get_member( &message );
          strcmp( "GetFilename", dbus_message_get_member( &message ) );
          if ( !1 )
          {
            __fprintf_chk( stderr, 1, "pcb_dbus: Interface '%s' has no method '%s'\n", dbus_message_get_interface( &message ), ebp_184 );
            return 1;
          }
          else
          {
            if ( dbus_message_new_method_return( &message ) )
            {
              dbus_message_iter_init_append( dbus_message_new_method_return( &message ), ebp_112 );
              if ( PCB->Filename )
              {
                if ( lrealpath( &PCB->Filename ) == 0 )
                  goto B38;
                else
                {
                  if ( dbus_message_iter_append_basic( ebp_112, 115, ebp_32 ) )
                  {
                    free( ebp_32 );
                  }
                  else
                  {
                    __fprintf_chk( stderr, 1, "pcb_dbus: Couldn't append return filename string to message reply, Out Of Memory!\n" );
                    free( ebp_32 );
                    dbus_message_unref( &ebx );
                    return 0;
                  }
                }
              }
              else
              {
              }
B38:;
              if ( calloc( 1, 1 ) )
              {
              }
              else
              {
                __fprintf_chk( stderr, 1, ebp_192, ebp_192 );
              }
            }
            else
            {
            }
          }
        }
        else
        {
          /* phantom */ size_t __s1_len;
          /* phantom */ size_t __s2_len;
          strcmp( "org.seul.geda.pcb.actions", interface_name );
          if ( 1 )
          {
            /* phantom */ size_t __s1_len;
            /* phantom */ size_t __s2_len;
            method_name[0] = ebp_140;
            strcmp( "ExecAction", ebp_140 );
            if ( !1 )
            {
              __fprintf_chk( stderr, 1, "pcb_dbus: Interface '%s' has no method '%s'\n", dbus_message_get_interface( &message ), ebp_184 );
            }
            else
            {
              dbus_error_init( ebp_56 );
              if ( dbus_message_get_args( &message, ebp_56, 115, ebp_32, 97, (long long)115, (long long)( ebp_40 ) ) )
              {
                hid_actionv( (char*)calloc( 1, 1 ), ebp_40, ebp_36 );
                dbus_free_string_array( 0 );
                if ( dbus_message_new_method_return( &message ) )
                {
                  dbus_message_iter_init_append( dbus_message_new_method_return( &message ), ebp_112 );
                  if ( dbus_message_iter_append_basic( ebp_112, 117, ebp_28 ) )
                  {
                  }
                  else
                  {
                  }
                }
              }
              else
              {
                __fprintf_chk( stderr, 1, "Failed to read method arguments\n" );
                if ( 0 )
                {
                  dbus_free_string_array( 0 );
                }
              }
            }
          }
          else
          {
            /* phantom */ size_t __s1_len;
            /* phantom */ size_t __s2_len;
            strcmp( "org.freedesktop.DBus.Introspectable", interface_name );
            if ( !1 )
            {
              __fprintf_chk( stderr, 1, "pcb_dbus: Interface '%s' was not recognised\n", dbus_message_iter_append_basic( ebp_112, 117, ebp_28 ) );
            }
          {
            /* phantom */ size_t __s1_len;
            /* phantom */ size_t __s2_len;
            method_name[0] = dbus_message_get_member( &message );
            strcmp( "Introspect", dbus_message_get_member( &message ) );
            if ( !1 )
            {
              __fprintf_chk( stderr, 1, "pcb_dbus: Interface '%s' has no method '%s'\n", dbus_message_get_interface( &message ), ebp_184 );
            }
            else
            {
              if ( dbus_message_new_method_return( &message ) )
              {
                dbus_message_iter_init_append( dbus_message_new_method_return( &message ), ebp_112 );
                if ( dbus_message_iter_append_basic( ebp_112, 115, pcb_dbus_introspect_xml ) )
                {
                  if ( dbus_connection_send( &pcb_dbus_conn, (DBusMessage*)dbus_message_get_interface( &message ), 0 ) )
                  {
                    dbus_message_unref( &ebx );
                    return 0;
                  }
                }
                else
                {
                }
              }
            }
          }
          }
        }
        if ( dbus_connection_send( ebp_200, ebp_200, ebp_196 ) )
        {
          dbus_message_unref( &ebx );
          return 0;
        }
      }
      else
      {
      }
    }
    else
    {
    }
  }
    break;
  }
  __fprintf_chk( stderr, 1, ebp_192, ebp_192 );
}