Source: /app/hbasic/hbasic/src/functions.h


Annotated List
Files
Globals
Hierarchy
Index
/* **************************************************************************
 File: functions.h
 Desc: Function definitions for *.c files.
 ----------------------------------------------------------------------------
	copyright            : (C) 2001 HBasic project (Marcus Engels)
 ***************************************************************************/

/* **************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

/* ----------------------------------------------------------------------- */
/* Classlist: List of classes that will be defined in this source file.    */
/* ----------------------------------------------------------------------- */
/* none since this file holds only definitions.                            */

/* ----------------------------------------------------------------------- */
/* Changelog: Description of important changes within this file.           */
/*            Please report with date, maintainer and change description.  */
/* ----------------------------------------------------------------------- */

#include "memory.h"
#include "structs.h"

class CProject;
class QColor;
class dlgQueryResult;
class HBDatabase;
class HBQueryDesc;
class HBSqlStatement;

/* --------------------------------------------------------------------- */
/*  parse0.cpp                                                           */

extern int parse_statements( void );
short create_var_init( short settype, short range_type );
void create_form_load( void );
int parse_statements( void );
void dump_code( char *startptr, char *filename );
void dump_tree( char *filename );
short init_run( void );
void initPreparseVariables( void );
short findIdentifierDescription( FACT_DESC *fact_desc_ptr );
void co_gui_write_bytes( char *startptr, char *endptr);
void assign_event_address( void );
void skipDimUntilEol( void );
void co_open_codefile();
void co_close_codefile();
void co_init_codefile( void );
void co_write_compcode( int opcode );
int  co_assemble_code( void );
int  co_link_code( void );
void co_start_code( void );
void co_write_final_data( void );
void co_write_gui_int( long offset, int header_offset );
void co_create_gui_code( MemoryBlock *memgui );
long getTypesize( short type_def );

/* --------------------------------------------------------------------- */
/* Create/edit function defined in action_manager.cpp  */

/* Create (edit_mode = 0) or edit (edit_mode = 1) a database report. */
void dlgEditReport( short edit_mode );
void dlgEditQuery( short edit_mode );
void dlgEditTable( short edit_mode );
void dlgEditSQLStmt( short edit_mode, HBSqlStatement *sql_stmt );
void dlgEditCalcSheet( short edit_mode );
dlgQueryResult *openQueryResultDlg( HBQueryDesc *query_desc_ptr, QString *query_text, int *column_count );

/* interpreter */
void start_execution( short exec_mode );

/* --------------------------------------------------------------------- */
/*  parse1.cpp                                                           */

void pa_init_parser( void );
extern "C" 
{
int gettoken( short read_eol );
short parse_expression( EXPR_DESC *last_op, short request_type, short request_flag );
short parse_initial_expression( short *ret, short request_type, short request_flag );
}
int gettoken_no_stdidf( short read_eol );
extern "C"
{
void write_codeshort( short value );
void write_codebyte( unsigned int sign );
void write_codelong( long value );
void save_parser_position( short save_type );
void show_error( int errnum );
}
void show_runtime_error( void );
short createVariableAddress( FACT_DESC *expr_desc_ptr );
short getComponentType( char *type_desc_string );
short parse_do( void );
short parse_loop( void );
short parse_exit( void );
short parse_while( void );
short parseClassInit( FACT_DESC *fact_desc_ptr );
void parse_then( void );
void pa_code_const_int( HB_INT_TYPE *number );
void pa_code_const_long( HB_LONG_TYPE *number );
void pa_code_const_dbl( HB_DOUBLE_TYPE *number );
void pa_code_const_string( char * );
short parse_new_statement( void );

/* --------------------------------------------------------------------- */
/*  parse2.cpp                                                           */

short parse_func_call( short *return_type );
short parse_sub_call( short *return_type );
char *find_system_function( void );
short find_user_sub( SUB_DESC *subdesc_ptr, FACT_DESC *expr_desc_ptr, 
   short access_type );
TYPE_DESC *find_type_desc_for_id( short type_id );
short find_system_sub( FACT_DESC *expr_desc_ptr );
short find_var_pos( FACT_DESC *expr_desc_ptr );
QPtrList  *createParTypelist( void );
short createParCallCode( VAR_DESC *first_parameter );
SUB_DESC *findParTypelist( QPtrList  *all_parameter_list, 
	SUB_DESC *subdesc_ptr, short *return_type );
void freeParTypelist( QPtrList  *all_parameter_list );
TYPE_DESC *findTypeDesc( void );
TYPE_DESC *findTypeId( short );
TYPE_DESC *createNewTypeEntry( void );
void parse_read_guivar( VAR_DESC *var_desc_ptr );
short parse_module_comp( VAR_DESC *var_desc_ptr );
void parse_guiset( void );
void createFunctionCall( SUB_DESC *matching_parlist );
void rt_init_globvar( void );
void rt_exit_globvar( void );
char *find_typedef( int type_id );
int parse_set( void );
void create_sub_address_ptr( void );
short find_type_number( void );
short *findCompProperty( GUI_HEADER *comp_ptr, char **prop_name );
short parse_const_def( void );
short parse_enum_def( void );
short parse_type_def( void );

/* --------------------------------------------------------------------- */
/*  parse3.cpp                                                           */

short pa_preparse_source( void );
long pa_get_localvar_offset( void );
int preread_sub_declaration( char *basic_line_ptr );
void assign_open_calls( void );
int parse_sub( int modifier );
void parse_event( void );
short parse_raise_event( void );
int parse_property( void );
int parse_for_statement( void );
int pa_parse_vardef( short vartype, short modifier, long *offset_ptr );
void clear_event_address( GUI_HEADER *guiptr );
void search_gui_event( GUI_HEADER *guiptr, char *proc_defs );
short searchCompEvent( GUI_HEADER *guiptr, SUB_DESC *proc_defs,
     long *proc_offset );
int parse_dim_statement( int last_token );
void showNetVarType( VAR_DESC *var_ptr );
short moveVariableValue( FACT_DESC *var_desc_ptr, short rw_type );
short createReadVariableCode( FACT_DESC *expr_desc_ptr );
void code_read_arrayvar( FACT_DESC *expr_desc_ptr );
void code_write_arrayvar( FACT_DESC *expr_desc_ptr );
int parse_for( void );
int parse_next( void );
int preread_for_statement( char *current_line );
void pa_set_subvar_offset( long new_offset );
long pa_get_subvar_offset( void );
int parse_endsub( void );
short parse_inherit( void );


/* ----------------------------------------------------------------- */
/*  parse4.cpp                                                       */

short parse_try( void );
short parse_endtry( void );
short parse_catch( void );
void parse_finally( void );
short parse_return( void );
int parse_class( void );
int parse_property_get( void );
int parse_property_set( void );
int parse_end_class( void );
int parse_end_property( void );
int parse_end_prop_get( void );
int parse_end_prop_set( void );
int parse_property( void );

/* --------------------------------------------------------------------- */
/*  parse_const.cpp                                                      */

void pa_code_const_null( void );
void pa_code_const_int( void );
void pa_code_const_long( void );
void pa_code_const_double( void );
void pa_code_const_string( void );

/* --------------------------------------------------------------------- */
/*  parse_comp.cpp                                                      */

void code_write_compvar( FACT_DESC *expr_desc_ptr );
void code_read_compvar( FACT_DESC *fact_desc_ptr );

/* --------------------------------------------------------------------- */
/*  exec_const.cpp                                                      */

void rt_const_null( void );
void rt_const_int( void );
void rt_const_long( void );
void rt_const_double( void );
void rt_const_string( void );

/* --------------------------------------------------------------------- */
/*  parse_var.cpp                                                       */

void create_read_slocal( FACT_DESC *expr_desc_ptr );
void code_write_slocal_var( FACT_DESC *expr_desc_ptr );
void create_read_var( FACT_DESC *expr_desc_ptr );
void create_var_write( VAR_DESC *expr_desc_ptr );
short create_var_read( FACT_DESC *expr_desc_ptr );
short parse_struct_access( FACT_DESC *expr_desc_ptr );
char *getTypeFromToken( int token, int *length );
void code_class_access( FACT_DESC *expr_desc_ptr );
void code_read_typevar( FACT_DESC *expr_desc_ptr );
short compareIdfName( char *start_name );
short isCompMethod( SOCOMP_HEADER *comp_desc, FACT_DESC *expr_desc_ptr,
	COMP_ACCESS_DESC *comp_desc_ptr );
char *parseTypeDescription( int parser_token, int *entry_length );
char *parseArrayDescription( void );
long getTypeLength( short type );
short find_form_var_name( FORM_DESC *form_desc_ptr, short acc_extern,
   FACT_DESC *expr_desc_ptr, short access_type );
short getTypeFromToken( int token );
short createIdentifierAccess( FACT_DESC *expr_desc_ptr );
short parse_dim_statement( void );
short findMatchingParlist( SUB_DESC *subdesc_ptr, FACT_DESC *expr_desc_ptr);

extern "C"
{
short compare_name( char *name1, char *name2);
};

/* --------------------------------------------------------------------- */
/*  parse_file.cpp                                                       */

void create_file_init( void );
PA_FILE_DESC *find_file_desc( short is_name, int file_number );
short parse_open( void );
short parse_close( void );
short parse_put( void );
short parse_get( void );
short parse_kill( void );
short parse_name( void );
short parse_seek( void );
short parse_print( void );
short parse_input( void );

/* --------------------------------------------------------------------- */
/*  rt_function_lib.cpp                                                  */

void comp_call_sys_function( long function_number );

/* --------------------------------------------------------------------- */
/*  to_tools.cpp                                                         */

void dump_code( char *startptr, char *filename );
void *my_malloc( const char *file, int line, char *type, size_t length );
void my_free( char *type, void *ptr );

/* --------------------------------------------------------------------- */
/*  propedit_window.cpp                                                  */

long qcolor2value( QColor *new_color );

/* --------------------------------------------------------------------- */
/*  db_control.cpp                                                       */

HBDatabase *findHBDatabase( HBDbTable *comp_table_desc_ptr );

/* --------------------------------------------------------------------- */
/*  undo_operation.cpp                                                   */

void freeUndoBuffer( void );
void undo_create_char_delete( CBasicDocument *source_doc_ptr, long line_offset,
	short cursor_pos_in_line, short del_char );
void undo_create_char_insert( CBasicDocument *source_doc_ptr, long line_offset,
	short cursor_pos_in_line, short insert_char );
void createUndoText( void );
void undo_create_block_delete( SOURCE_BLOCK_HEADER *block_desc_ptr, short cut_type );
void undo_create_block_insert( SOURCE_BLOCK_HEADER *block_desc_ptr );
void undo_last_edit_action( void );
void redo_last_edit_action( void );

/* --------------------------------------------------------------------- */
/*  debug_window.cpp                                                     */


VAR_DESC *findVariableName( char *find_var_name );
QString *getValueString( VAR_DESC *var_desc_ptr );
SUB_DESC *findSubDesc( void );

/* --------------------------------------------------------------------- */
/*  dlg_password.cpp                                                     */

void showTableContent( QString *table_name );

/* --------------------------------------------------------------------- */

QString *readFileString( QFile *f, FILE_TAG_HEADER *file_info );
void createMenuEvents( MENUTOOLBAR_DESC *mtbar_ptr, RT_FORM_DESC *rth_ptr );
QPixmap *createPixmapFromDesc( long *pic_desc_ptr );
short getDatabaseTables( HBDatabase *db_desc );

/* --------------------------------------------------------------------- */
/* project_group.cpp                         */

void createNewProjectGroup( bool ask );

/* --------------------------------------------------------------------- */
/* mainwindow.cpp     */

extern void saveGlobalOptions( void );
extern void loadGlobalOptions( void );

/**
 * Create a new Form/Module of a special type in the current project. 
 */
extern void createNewForm( int form_type );

/**
 * Recreate the main global project group that handles all projects. 
 */

void createNewProjectGroup( bool ask_type );

extern "C"
{
extern void showHtmlErrorMessage( char *path );
extern void showExtHtmlErrorMessage( char *path, char *info1, char *info2, char *info3 );
}

/* --------------------------------------------------------------------- */
/* exec_cs.cpp  C# starter                                               */

void start_csharp_comp( void );
void start_cs_program( void );

extern "C"
{
	char *createCompMemory( long component_size );
};

/* ------------------------------------------------------------------ */
/* action_manager.cpp                                                 */

extern CProject *currentProject( void );

/* ------------------------------------------------------------------ */
/* main.cpp                                                           */

void init_undo_description( void );

/* ------------------------------------------------------------------ */

int preparseModuleOne( CBasicDocument *doc_ptr );
int preparseModuleTwo( CBasicDocument *doc_ptr );

/* ------------------------------------------------------------------ */
/* net_support.c                                                      */

extern "C"
{
	int net_load_library( NET_PACKAGE_HEADER *pckg_desc_ptr, char *filename );
	void *net_find_member( NET_PACKAGE_HEADER *pckg_desc_ptr, short find_class, short *return_type );
	int net_create_member_read( NETCLASS_ACCESS_DESC *member_desc_ptr );
	int net_create_member_write( NETCLASS_ACCESS_DESC *member_desc_ptr );
	int net_prepare_member_access( NETCLASS_ACCESS_DESC *xclass_ptr, short *return_type_ptr );
	void rt_call_netmethod( void );
	void rt_init_net_operations( void );
	short parseCreateNetClass( long *class_ptr );
	void rt_net_read_field( void );
	void rt_net_write_field( void );
};
void rt_finalize_net_operations( void );


void rt_qtc_call_method( void );
void rt_qtc_read_classptr( void );
void rt_qtc_write_classptr( void );
void rt_string_to_qtcclass( void );
void rt_del_class_memory( void );


Generated by: root on linux on Sun Jul 13 18:06:35 2003, using kdoc 2.0a54.