From 74af23777806dd696c5ed3ba365b7b3db3fa693e Mon Sep 17 00:00:00 2001 From: Cedric RICARD Date: Thu, 1 May 2008 10:17:20 +0000 Subject: [PATCH] Migrating to Anubis 1.9 which biggest change is the migration from Int32 to Int or Word32. --- calexium_lib/CXM_errors.anubis | 6 +++--- calexium_lib/CXM_message_constants.anubis | 72 ++++++++++++++++++++++++++++++++++++------------------------------------ calexium_lib/database/db_utils.anubis | 8 ++++---- calexium_lib/net_services/CXM_generic_client.anubis | 24 ++++++++++++------------ calexium_lib/net_services/CXM_generic_protocol.anubis | 26 +++++++++++++------------- calexium_lib/net_services/CXM_net_services.anubis | 14 +++++++------- calexium_lib/net_services_protocols/ftp_client.anubis | 10 +++++----- calexium_lib/net_services_protocols/logger_service.anubis | 20 ++++++++++---------- calexium_lib/net_services_protocols/pkg_updater_protocol.anubis | 4 ++-- calexium_lib/web/CXM_cookies.anubis | 61 ++++++++++++++++++++++++++++++------------------------------- calexium_lib/web/CXM_generic_form.anubis | 20 ++++++++++---------- calexium_lib/web/CXM_generic_table.anubis | 70 +++++++++++++++++++++++++++++++++++----------------------------------- calexium_lib/web/CXM_html.anubis | 319 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------------------------ calexium_lib/web/CXM_http_get_common.anubis | 16 ++++++++-------- calexium_lib/web/CXM_making_a_web_site.anubis | 271 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------- calexium_lib/web/CXM_mime.anubis | 4 ++-- calexium_lib/web/CXM_multihost_http_server.anubis | 341 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- calexium_lib/web/CXM_web_arg_encode.anubis | 79 ++++++++++++++++++++++++++++++++++++++++++++----------------------------------- calexium_lib/web/counter.anubis | 24 ++++++++++++------------ 19 files changed, 704 insertions(+), 685 deletions(-) diff --git a/calexium_lib/CXM_errors.anubis b/calexium_lib/CXM_errors.anubis index 3999639..f9ea1ee 100644 --- a/calexium_lib/CXM_errors.anubis +++ b/calexium_lib/CXM_errors.anubis @@ -9,7 +9,7 @@ public type GeneralError: ok, - unknown(Int32 val), + unknown(Word32 val), bad_type, bad_value, bad_parameters, @@ -20,8 +20,8 @@ public type GeneralError: io_error, // general error on reading or writing from/to IO (file, socket, etc...) cant_start_process. // A execute to an external process has failed -public define Int32 - to_Int32 +public define Word32 + to_Word32 ( GeneralError e ) = diff --git a/calexium_lib/CXM_message_constants.anubis b/calexium_lib/CXM_message_constants.anubis index 331a0b5..0a07623 100644 --- a/calexium_lib/CXM_message_constants.anubis +++ b/calexium_lib/CXM_message_constants.anubis @@ -10,66 +10,66 @@ // **************** PACKAGE BUILDER *************** -public define Int32 _CXM_PKG_MSG_BASIS = 0x33770400. // -public define Int32 _CXM_PKG_CONTAINER = 0x33770401. -public define Int32 _CXM_PKG_HEADER_PART = 0x33770402. // Header Message for Script -public define Int32 _CXM_PKG_SCRIPT_PART = 0x33770403. // Main Message for Script -public define Int32 _CXM_PKG_S_ADD_FILE = 0x33770404. // script action to add file in the destination -public define Int32 _CXM_PKG_INDEX_PART = 0x33770440. // ID of package Index part -public define Int32 _CXM_PKG_IDX_ENTRY = 0x33770441. // Index entry information +public define Word32 _CXM_PKG_MSG_BASIS = 0x33770400. // +public define Word32 _CXM_PKG_CONTAINER = 0x33770401. +public define Word32 _CXM_PKG_HEADER_PART = 0x33770402. // Header Message for Script +public define Word32 _CXM_PKG_SCRIPT_PART = 0x33770403. // Main Message for Script +public define Word32 _CXM_PKG_S_ADD_FILE = 0x33770404. // script action to add file in the destination +public define Word32 _CXM_PKG_INDEX_PART = 0x33770440. // ID of package Index part +public define Word32 _CXM_PKG_IDX_ENTRY = 0x33770441. // Index entry information // **************** UPDATE SERVICE *************** -public define Int32 _CXM_UPDATE_SERVICE_MSG_BASIS = 0x33770800. // -public define Int32 _CXM_UPD_SERVICE_ID = 0x33770801. -public define Int32 _CXM_UPD_HAS_UPDATE = 0x33770802. // +public define Word32 _CXM_UPDATE_SERVICE_MSG_BASIS = 0x33770800. // +public define Word32 _CXM_UPD_SERVICE_ID = 0x33770801. +public define Word32 _CXM_UPD_HAS_UPDATE = 0x33770802. // // **************** SERVICE NEGOCIATION *************** -public define Int32 _CXM_SERVICE_NEGOCIATION_BASIS = 0x33770C00. // -public define Int32 _CXM_REQUEST_FOR_SERVICE = 0x33770C01. // +public define Word32 _CXM_SERVICE_NEGOCIATION_BASIS = 0x33770C00. // +public define Word32 _CXM_REQUEST_FOR_SERVICE = 0x33770C01. // // **************** GENERIC PROTOCOL *************** -public define Int32 _CXM_GENERIC_PROTOCOL_BASIS = 0x33771000. // -public define Int32 _CXM_ACK = 0x33771001. // -public define Int32 _CXM_ACK_RESULT_MSG = 0x33771002. // +public define Word32 _CXM_GENERIC_PROTOCOL_BASIS = 0x33771000. // +public define Word32 _CXM_ACK = 0x33771001. // +public define Word32 _CXM_ACK_RESULT_MSG = 0x33771002. // // **************** FTP SERVICE *************** -public define Int32 _CXM_FTP_SERVICE_MSG_BASIS = 0x33771400. // -public define Int32 _CXM_FTP_SERVICE_ID = 0x33771401. -public define Int32 _CXM_FTP_GET_FILE = 0x33771402. -public define Int32 _CXM_FTP_START_TRANSFERT = 0x33771403. -public define Int32 _CXM_FTP_DATA = 0x33771404. +public define Word32 _CXM_FTP_SERVICE_MSG_BASIS = 0x33771400. // +public define Word32 _CXM_FTP_SERVICE_ID = 0x33771401. +public define Word32 _CXM_FTP_GET_FILE = 0x33771402. +public define Word32 _CXM_FTP_START_TRANSFERT = 0x33771403. +public define Word32 _CXM_FTP_DATA = 0x33771404. // ************** LOGGER SERVICE ************** -public define Int32 _CXM_LOGGER_SERVICE_MSG_BASIS = 0x33771800. // -public define Int32 _CXM_LOGGER_SERVICE_ID = 0x33771801. -public define Int32 _CXM_LOGGER_LOG = 0x33771802. +public define Word32 _CXM_LOGGER_SERVICE_MSG_BASIS = 0x33771800. // +public define Word32 _CXM_LOGGER_SERVICE_ID = 0x33771801. +public define Word32 _CXM_LOGGER_LOG = 0x33771802. // ************** DOMAIN SERVICE ************** // MF <-> DomainManager -public define Int32 _CXM_DOMAIN_SERVICE_MSG_BASIS = 0x33771C00. // -public define Int32 _CXM_DOMAIN_SERVICE_ID = 0x33771C01. -public define Int32 _CXM_DOMAIN_PUBLISH_MF_CONFIG = 0x33771C02. -public define Int32 _CXM_DOMAIN_GET_NAME = 0x33771C03. -public define Int32 _CXM_DOMAIN_GET_MY_IP = 0x33771C04. -public define Int32 _CXM_DOMAIN_PUBLISH_MY_IP = 0x33771C05. -public define Int32 _CXM_DOMAIN_PUBLISH_DYN_TEST = 0x33771C06. -public define Int32 _CXM_DOMAIN_GET_STATUS = 0x33771C07. -public define Int32 _CXM_DOMAIN_GET_DOMAIN_INFO = 0x33771C08. +public define Word32 _CXM_DOMAIN_SERVICE_MSG_BASIS = 0x33771C00. // +public define Word32 _CXM_DOMAIN_SERVICE_ID = 0x33771C01. +public define Word32 _CXM_DOMAIN_PUBLISH_MF_CONFIG = 0x33771C02. +public define Word32 _CXM_DOMAIN_GET_NAME = 0x33771C03. +public define Word32 _CXM_DOMAIN_GET_MY_IP = 0x33771C04. +public define Word32 _CXM_DOMAIN_PUBLISH_MY_IP = 0x33771C05. +public define Word32 _CXM_DOMAIN_PUBLISH_DYN_TEST = 0x33771C06. +public define Word32 _CXM_DOMAIN_GET_STATUS = 0x33771C07. +public define Word32 _CXM_DOMAIN_GET_DOMAIN_INFO = 0x33771C08. // DomainManager <-> Gandi -public define Int32 _CXM_GANDI_SERVICE_ID = 0x33771D00. -public define Int32 _CXM_GANDI_CHECK_AVAILABILITY = 0x33771D01. // 'NAME' (String): Base names (without extension) of the wanted domains +public define Word32 _CXM_GANDI_SERVICE_ID = 0x33771D00. +public define Word32 _CXM_GANDI_CHECK_AVAILABILITY = 0x33771D01. // 'NAME' (String): Base names (without extension) of the wanted domains // --> CXM_ACK with 'DOMAINS' (String): Array of avaiblable domains -public define Int32 _CXM_GANDI_CREATE_CONTACT = 0x33771D02. // 'CLASS' (String): +public define Word32 _CXM_GANDI_CREATE_CONTACT = 0x33771D02. // 'CLASS' (String): // 'FIRSTNAME', 'LASTNAME', 'ADDRESS', 'ZIPCODE', 'CITY', 'COUNTRY', 'PHONE', 'EMAIL' (String) // --> CXM_ACK with 'CONTACT_HANDLE' (String): Created handle for this contact -public define Int32 _CXM_GANDI_CREATE_DOMAIN = 0x33771D03. // 'DOMAIN' (String): Domain full name +public define Word32 _CXM_GANDI_CREATE_DOMAIN = 0x33771D03. // 'DOMAIN' (String): Domain full name // 'OWNER' (String): Owner handle // --> CXM_ACK with 'DOMAIN_HANDLE' (String): Created handle for this domain diff --git a/calexium_lib/database/db_utils.anubis b/calexium_lib/database/db_utils.anubis index 8857145..ce34df4 100644 --- a/calexium_lib/database/db_utils.anubis +++ b/calexium_lib/database/db_utils.anubis @@ -19,7 +19,7 @@ define Result(SQLite3Error, SQLite3HeadersOrRow -> SQLite3Row) ( SQLite3DataBase db, String sql_command, - Int32 timeout + Int timeout ) = if sql_query(db, sql_command) is @@ -101,17 +101,17 @@ public define List(String) db_get_string_list(table_cursor, [s . so_far]) }. -public define List(Int32) +public define List(Int) db_get_integer_list ( SQLite3HeadersOrRow -> SQLite3Row table_cursor, - List(Int32) so_far + List(Int) so_far ) = if table_cursor(next_row) is { error(sql_error) then logError("DB", db_error(sql_error, "db_get_integer_list")); reverse(so_far), no_more_row then reverse(so_far), //can't find the symbol in the table, because the row is empty row(explorer) then - with s = (Int32)db_integer(explorer)(0), + with s = (Int)db_integer(explorer)(0), db_get_integer_list(table_cursor, [s . so_far]) }. diff --git a/calexium_lib/net_services/CXM_generic_client.anubis b/calexium_lib/net_services/CXM_generic_client.anubis index 9daab56..3149117 100644 --- a/calexium_lib/net_services/CXM_generic_client.anubis +++ b/calexium_lib/net_services/CXM_generic_client.anubis @@ -22,10 +22,10 @@ read calexium_lib/net_services/CXM_generic_protocol.anubis // --Generic types--------------------------------------------------------------------- public type NetServiceAnswer: - netservice_error (Int32 cmd, - Int32 result_code, + netservice_error (Word32 cmd, + Word32 result_code, String result_string), - netservice_ok (Int32 cmd, + netservice_ok (Word32 cmd, Maybe(Message) result_msg). // --Generic functions--------------------------------------------------------------------- @@ -36,7 +36,7 @@ public define Maybe(NetServiceAnswer) ( MessageQueue queue, Message msg_to_send, - Int32 timeout, + Int timeout, (String) -> One logger )= queue.add_Message_to_send(msg_to_send); @@ -66,7 +66,7 @@ public define Maybe($T) generic_handler ( MessageQueue queue, - Int32 timeout, + Int timeout, Message msg_to_send, (Message) -> Maybe($T) handler, (String) -> One logger @@ -96,7 +96,7 @@ public define Maybe($T) public define (MessageQueue, String) -> Maybe($T) make_generic_handler ( - Int32 timeout, + Int timeout, Message msg_to_send, (Message) -> Maybe($T) handler, (String) -> One logger @@ -108,8 +108,8 @@ define Maybe($T) generic_request_for_service ( MessageQueue queue, - Int32 service_id, - Int32 service_version, + Word32 service_id, + Word32 service_version, (MessageQueue, String) -> Maybe($T) handler, (String) -> One logger )= @@ -147,10 +147,10 @@ public define Maybe($T) generic_connect_to_net_service ( String queue_name, - Int32 server, - Int32 port, - Int32 service_id, - Int32 service_version, + Word32 server, + Word32 port, + Word32 service_id, + Word32 service_version, (MessageQueue, String) -> Maybe($T) handler, (String) -> One logger ) diff --git a/calexium_lib/net_services/CXM_generic_protocol.anubis b/calexium_lib/net_services/CXM_generic_protocol.anubis index 1fbbebe..82f3a8d 100644 --- a/calexium_lib/net_services/CXM_generic_protocol.anubis +++ b/calexium_lib/net_services/CXM_generic_protocol.anubis @@ -14,10 +14,10 @@ read tools/basis.anubis read system/message_queue.anubis read calexium_lib/CXM_message_constants.anubis -public define Int32 _CXM_OK = 0. -public define Int32 _CXM_ERROR = 1. -public define Int32 _CXM_UNKNOW_CMD = 2. -public define Int32 _CXM_UNKNOW_SERVICE = 3. +public define Word32 _CXM_OK = 0. +public define Word32 _CXM_ERROR = 1. +public define Word32 _CXM_UNKNOW_CMD = 2. +public define Word32 _CXM_UNKNOW_SERVICE = 3. public type ProtocolResult: failure, @@ -31,8 +31,8 @@ public define One send_ACK_error ( MessageQueue queue, - Int32 cmd_id, - Int32 error_code, + Word32 cmd_id, + Word32 error_code, String error_string, )= with err_msg = message(_CXM_ACK), @@ -46,7 +46,7 @@ public define One send_ACK_error ( MessageQueue queue, - Int32 cmd_id + Word32 cmd_id )= send_ACK_error(queue, cmd_id, _CXM_ERROR, ""). @@ -54,7 +54,7 @@ public define One send_ACK_ok ( MessageQueue queue, - Int32 cmd_id + Word32 cmd_id )= with ok_msg = message(_CXM_ACK), forget(add_int32(ok_msg, "CMD", cmd_id)); @@ -66,7 +66,7 @@ public define One send_ACK_ok ( MessageQueue queue, - Int32 cmd_id, + Word32 cmd_id, Message result )= with ok_msg = message(_CXM_ACK), @@ -80,7 +80,7 @@ public define One send_result ( MessageQueue queue, - Int32 cmd_id, + Word32 cmd_id, Maybe(Message) mb_msg )= if mb_msg is @@ -93,7 +93,7 @@ public define One send_result ( MessageQueue queue, - Int32 cmd_id, + Word32 cmd_id, Bool result )= if result then @@ -105,8 +105,8 @@ public define ProtocolResult wait_for_reply ( MessageQueue mQ, - Int32 wait_cmd, - Int32 t_out + Word32 wait_cmd, + Int t_out ) = if mQ.get_next_received_Message(t_out) is { diff --git a/calexium_lib/net_services/CXM_net_services.anubis b/calexium_lib/net_services/CXM_net_services.anubis index 67accae..144faf4 100644 --- a/calexium_lib/net_services/CXM_net_services.anubis +++ b/calexium_lib/net_services/CXM_net_services.anubis @@ -18,8 +18,8 @@ read calexium_lib/CXM_message_constants.anubis public type NetService: net_service( - Int32 version, - Int32 id, + Word32 version, + Word32 id, String name, (MessageQueue, String, String) -> One handler // Parameters are MessageQueue, peer IP and timestamp string ). @@ -43,14 +43,14 @@ define Maybe(NetService) find_service ( List(NetService) services_list, - Int32 service_id, - Int32 service_version + Word32 service_id, + Word32 service_version )= if services_list is { [] then failure, [h.t] then - if h.id = service_id & h.version >= service_version then + if h.id = service_id & h.version >=+ service_version then success(h) else find_service(t, service_id, service_version) @@ -93,7 +93,7 @@ define Maybe(NetService) define String get_time_stamp = - with time = (UTime) now, + with time = (UTime) unow, "<"+virtual_machine_id+"@"+time.seconds+">". /** This message_received function just handle the negociation process the available net_services. @@ -173,7 +173,7 @@ public define Maybe(Server) start_net_services ( List(NetService) net_services, - Int32 network_port, + Word32 network_port, Var(Bool) shutdown_required )= if start_server(0, diff --git a/calexium_lib/net_services_protocols/ftp_client.anubis b/calexium_lib/net_services_protocols/ftp_client.anubis index 9580e78..dc3dc6d 100644 --- a/calexium_lib/net_services_protocols/ftp_client.anubis +++ b/calexium_lib/net_services_protocols/ftp_client.anubis @@ -21,8 +21,8 @@ define Maybe(One) ( MessageQueue mQ, WStream fd, - Int32 so_far, - Int32 left_read + Int so_far, + Int left_read )= //println("receive_data "); if mQ.get_next_received_Message(30) is @@ -58,7 +58,7 @@ define Maybe(One) ( MessageQueue mQ, String local_file, - Int32 size + Int size )= make_directories(local_file); if file(local_file, new) is @@ -96,7 +96,7 @@ define Maybe(One) { failure then println("file size not found"); failure, success(size) then println("file size "+size); - start_get_file_transtert(mQ, local_file, size) + start_get_file_transtert(mQ, local_file, to_Int(size)) } } }. @@ -131,7 +131,7 @@ public define Maybe(One) ftp_get_file ( String server, - Int32 ip_port, + Word32 ip_port, String remote_file, String local_file )= diff --git a/calexium_lib/net_services_protocols/logger_service.anubis b/calexium_lib/net_services_protocols/logger_service.anubis index 3fcce20..d0f0cee 100644 --- a/calexium_lib/net_services_protocols/logger_service.anubis +++ b/calexium_lib/net_services_protocols/logger_service.anubis @@ -23,12 +23,12 @@ read calexium_lib/net_services/CXM_generic_protocol.anubis // Special non-existing file. This is a work arround for a impossibility to define global configuration in anubis. // So this file allows you to specify on which UDP port the logger server is listening. // You have to provide this file in your base source directory (or any other folder which is scanned by the compilater, -// and you define a function named 'logger_port' which simply return the port number as an Int32. +// and you define a function named 'logger_port' which simply return the port number as an Word32. // Example: -// public define Int32 logger_port = 33610. +// public define Word32 logger_port = 33610. read logger_config.anubis -public define Int32 logger_srv_version = 1. +public define Word32 logger_srv_version = 1. /** * has_update scan the given message for finding corresponding available update @@ -75,7 +75,7 @@ define Bool { failure then logError(log, "process_log can't find Level");false, success(thread_id) then - with level = get_LogLevel_from_value(int_level), + with level = get_LogLevel_from_value(to_Int(int_level)), if level is logTrace then if find_string(msg, "LogMask") is { @@ -174,14 +174,14 @@ public define String data_preview ( ByteArray data, - Int32 max + Int max ) = with l = length(data), firsts_bytes = extract(data, 0, max), "Length=" + l + "; String='"+to_string(firsts_bytes)+"' Buffer=[" + to_ascii(firsts_bytes) + (if l > max then "...]" else "]"). -define (UDP_Socket, ByteArray, Truncation, Int32, Int32) -> One +define (UDP_Socket, ByteArray, Truncation, Word32, Word32) -> One make_udp_handler ( List(Logger) logs, @@ -191,8 +191,8 @@ define (UDP_Socket, ByteArray, Truncation, Int32, Int32) -> One UDP_Socket socket, ByteArray data, Truncation truncation, - Int32 ip_address, - Int32 ip_port + Word32 ip_address, + Word32 ip_port ) |-> with ip = ip_addr_to_string(ip_address), logTrace(debug_logger, logMask("Logger"), "LoggerServer: data received (" + length(data) + " bytes) from IP " + ip + "... "); @@ -292,14 +292,14 @@ define Message ( String logger_name, String log_string, - Int32 level + Int level )= with string = if length(log_string) > 1024 then (if sub_string(log_string, 0, 1024) is success(s) then s else "?") + "..." else log_string, with log_msg = message(_CXM_LOGGER_LOG), forget(add_string(log_msg, "LogName", logger_name)); forget(add_string(log_msg, "LogString", string)); - forget(add_int32(log_msg, "Level", level)); + forget(add_int32(log_msg, "Level", truncate_to_Word32(level))); forget(add_int32(log_msg, "Thread", virtual_machine_id)); log_msg . diff --git a/calexium_lib/net_services_protocols/pkg_updater_protocol.anubis b/calexium_lib/net_services_protocols/pkg_updater_protocol.anubis index 1b74311..a1cbc45 100644 --- a/calexium_lib/net_services_protocols/pkg_updater_protocol.anubis +++ b/calexium_lib/net_services_protocols/pkg_updater_protocol.anubis @@ -8,5 +8,5 @@ */ -public define Int32 no_update = 0. -public define Int32 update_available = 1. +public define Word32 no_update = 0. +public define Word32 update_available = 1. diff --git a/calexium_lib/web/CXM_cookies.anubis b/calexium_lib/web/CXM_cookies.anubis index ad104ee..5393c78 100644 --- a/calexium_lib/web/CXM_cookies.anubis +++ b/calexium_lib/web/CXM_cookies.anubis @@ -12,9 +12,10 @@ read tools/basis.anubis -read web/CXM_common.anubis -read web/CXM_html.anubis -read web/CXM_http_get_common.anubis +read system/string.anubis +read CXM_common.anubis +read CXM_html.anubis +read CXM_http_get_common.anubis *Overview* @@ -30,10 +31,10 @@ public type Cookie: // attributes: Maybe(String) comment, // cookies may have human readable comments Maybe(String) domain, // domain name as sent by the server - Int32 validity, // cookie still valid if this is > now + Int validity, // cookie still valid if this is > now Maybe(String) path, // server path for which the cookie is valid Bool secure, // if true, do not send this cookie over an insecure link - Int32 version). // Cookie version (normally 1: rfc 2109) + Int version). // Cookie version (normally 1: rfc 2109) Cookies are sent by servers through 'Set-Cookie' HTTP headers. The function @@ -123,24 +124,23 @@ define Bool ( Word8 c ) = - with n = word8_to_int32(c), - if n < 33 then false else - if n < 34 then true else - if n < 35 then false else - if n < 40 then true else - if n < 42 then false else - if n < 44 then true else - if n < 45 then false else - if n < 47 then true else - if n < 48 then false else - if n < 58 then true else - if n < 65 then false else - if n < 91 then true else - if n < 94 then false else - if n < 123 then true else - if n < 124 then false else - if n = 124 then true else - n = 126. + if c +< 33 then false else + if c +< 34 then true else + if c +< 35 then false else + if c +< 40 then true else + if c +< 42 then false else + if c +< 44 then true else + if c +< 45 then false else + if c +< 47 then true else + if c +< 48 then false else + if c +< 58 then true else + if c +< 65 then false else + if c +< 91 then true else + if c +< 94 then false else + if c +< 123 then true else + if c +< 124 then false else + if c = 124 then true else + c = 126. From the grammar, it is clear that atomic entities (called 'tokens' by YACC) are: @@ -194,7 +194,7 @@ define Atom variable String input = "". From which cookies will be read. -variable Int32 index = 0. Current position within 'input'. +variable Int index = 0. Current position within 'input'. define Maybe(Word8) next_char @@ -245,8 +245,7 @@ define Bool ( Word8 c ) = - with n = word8_to_int32(c), - n =< ' '. + c +=< ' '. Reading an atom from the input: @@ -349,7 +348,7 @@ define Maybe(String) else get_domain(t) }. -define Int32 +define Int get_validity ( List(AttrVal) l @@ -358,7 +357,7 @@ define Int32 { [ ] then 0, [h . t] then if h is max_age(a) - then if string_to_integer(a) is + then if decimal_scan(a) is { failure then 0, success(n) then n+now @@ -392,7 +391,7 @@ define Bool else get_secure(t) }. -define Int32 +define Int get_version ( List(AttrVal) l @@ -401,7 +400,7 @@ define Int32 { [ ] then 0, [h . t] then if h is version(v) - then if string_to_integer(v) is + then if decimal_scan(v) is { failure then 0, success(n) then n @@ -562,7 +561,7 @@ define HTTP_header ) = if c is cookie(sn,n,v,mbc,mbd,vld,mbp,sec,ver) then http_header("Cookie", - "$Version=" + integer_to_string(ver) + + "$Version=" + to_decimal(ver) + ";" + n + "=\"" + v + "\"" + if mbp is { diff --git a/calexium_lib/web/CXM_generic_form.anubis b/calexium_lib/web/CXM_generic_form.anubis index aa9d38a..3a68ce5 100644 --- a/calexium_lib/web/CXM_generic_form.anubis +++ b/calexium_lib/web/CXM_generic_form.anubis @@ -28,11 +28,11 @@ public type Width: small, narrow, wide, - custom(Int32). + custom(Int). public type FormFieldWidth: auto, - custom(Int32). + custom(Int). @@ -42,7 +42,7 @@ public type FormField: //--- title field --------------------------------------------------------------------- title (String text), - title (Int32 text_size, + title (Int text_size, String text), title_f (List(Text_Option) -> HTML_In_Form), @@ -135,8 +135,8 @@ public type FormField: text_area (WebArgName web_arg_name, String tag, InitialValue initial_text, - Int32 width, - Int32 height), + Int width, + Int height), //--- fields table -------------------------------------------------------------------- fields_table (String tag, @@ -192,7 +192,7 @@ public define HTML_Off_Form ( String form_name, RGB background_color, - Int32 width, + Int width, List(FormField) fields ). @@ -414,7 +414,7 @@ define HTML_Row(HTML_In_Form) [ cell([right,top], text([size(10)],tag)), cell([width(7)], text([],"")), - cell([left,top], table([],map((FormField ff) |-> format_form_field(ff),fields))) + cell([left,top], table([],map((FormField ff2) |-> format_form_field(ff2),fields))) ], fields_line(tag,fields) then (List(HTML_Cell(HTML_In_Form))) @@ -422,13 +422,13 @@ define HTML_Row(HTML_In_Form) cell([right,top], text([size(10)],tag)), cell([width(7)], text([],"")), cell([left,top], table([nude],[row([], //border(0,0,3,rgb(0,0,0)) - map((FormField ff) |-> cell([top],table([nude],[format_form_field(ff)])),fields))])) + map((FormField ff2) |-> cell([top],table([nude],[format_form_field(ff2)])),fields))])) ], fields_line(fields) then (List(HTML_Cell(HTML_In_Form))) [ cell([left,top,columns(3)], table([nude],[row([], - map((FormField ff) |-> cell([top],table([nude],[format_form_field(ff)])),fields))])) + map((FormField ff2) |-> cell([top],table([nude],[format_form_field(ff2)])),fields))])) ], preview(html_text) then (List(HTML_Cell(HTML_In_Form))) @@ -460,7 +460,7 @@ public define HTML_Off_Form ( String form_name, RGB bg_color, - Int32 w, + Int w, List(FormField) fields ) = table([border(0,0,5,bg_color),percentage_width(100), diff --git a/calexium_lib/web/CXM_generic_table.anubis b/calexium_lib/web/CXM_generic_table.anubis index 7c891c4..698d31c 100644 --- a/calexium_lib/web/CXM_generic_table.anubis +++ b/calexium_lib/web/CXM_generic_table.anubis @@ -48,7 +48,7 @@ read CXM_making_a_web_site.anubis +-----+----------+--------+-----------+-----------+ ............... For the total-line, assuming that datax1 to dataxn and datax32 to datan32 are numbers - (Int32, Float or Maybe(Float)). + (Int, Float or Maybe(Float)). The columns name are just a List(Item_Row). @@ -56,18 +56,18 @@ read CXM_making_a_web_site.anubis The column 'num' is in the case you want to enumerate your data. The existence of this column depends on the line function. - Lines are given by the function : (RGB color,Int32 num,$Data d) -> Item_Row + Lines are given by the function : (RGB color,Int num,$Data d) -> Item_Row where : - (RGB)color is the color of the background of the row (the 'a color' or 'b color'); - - (Int32)num the number of the data (to enumerate). + - (Int)num the number of the data (to enumerate). So, this function must be written something like : - (RGB color, Int32 num,$Data d) |-> + (RGB color, Int num,$Data d) |-> row([background_color(color)], // and of course possibly other row-options [ - cell([], (Int32 -> $HTML)(num) ) + cell([], (Int -> $HTML)(num) ) . ($Data -> List(Cell))d // how data is printed in cells ]). @@ -125,7 +125,7 @@ public type Total_Line($Data,$Upplet,$Row): scheme as a column), you must specify the number of columns. You will obtain : Here is a List($Data) : l = [a,b,c,d,e,f,g,h,i,j,k,l,m]; - and f : (RGB,Int32,$Data) -> Item_Row + and f : (RGB,Int,$Data) -> Item_Row You want to print this list on 3 columns. The result will be : @@ -151,8 +151,8 @@ public type Total_Line($Data,$Upplet,$Row): public type HowManyColumns: _1, - several (Int32 col_nb, - Int32 spacer). + several (Int col_nb, + Int spacer). @@ -169,7 +169,7 @@ public define HTML_Off_Form List(Table_Option) lto, List(HTML_Row(HTML_Off_Form)) columns_name, HowManyColumns number_of_columns, - (RGB,Int32,$Data) -> HTML_Row(HTML_Off_Form) line_format, + (RGB,Int,$Data) -> HTML_Row(HTML_Off_Form) line_format, RGB a_color, RGB b_color, Total_Line($Data,$Upplet,HTML_Row(HTML_Off_Form)) total_line @@ -182,7 +182,7 @@ public define HTML_In_Form List(Table_Option) lto, List(HTML_Row(HTML_In_Form)) columns_name, HowManyColumns number_of_columns, - (RGB,Int32,$Data) -> HTML_Row(HTML_In_Form) line_format, + (RGB,Int,$Data) -> HTML_Row(HTML_In_Form) line_format, RGB a_color, RGB b_color, Total_Line($Data,$Upplet,HTML_Row(HTML_In_Form)) total_line @@ -263,7 +263,7 @@ public define HTML_Off_Form List(Table_Option) lto, List(HTML_Row(HTML_Off_Form)) columns_name, HowManyColumns number_of_columns, - (RGB,Int32,$Data) -> HTML_Row(HTML_Off_Form) line_format, + (RGB,Int,$Data) -> HTML_Row(HTML_Off_Form) line_format, RGB a_color, RGB b_color ). @@ -275,7 +275,7 @@ public define HTML_In_Form List(Table_Option) lto, List(HTML_Row(HTML_In_Form)) columns_name, HowManyColumns number_of_columns, - (RGB,Int32,$Data) -> HTML_Row(HTML_In_Form) line_format, + (RGB,Int,$Data) -> HTML_Row(HTML_In_Form) line_format, RGB a_color, RGB b_color ). @@ -319,7 +319,7 @@ type Print_Table($Data): print_table ( $Data data, - Int32 num + Int num ). @@ -331,9 +331,9 @@ define (List(Print_Table($Data)),List($Data)) ( List($Data) l, List(Print_Table($Data)) result, - Int32 n, - Int32 ct, // counter - Int32 num + Int n, + Int ct, // counter + Int num ) = if l is { @@ -349,8 +349,8 @@ define List(List(Print_Table($Data))) short_lists ( List($Data) l, - Int32 nb, // number of element of short list - Int32 ct // counter for numbering data (initialized at 0) + Int nb, // number of element of short list + Int ct // counter for numbering data (initialized at 0) ) = if get_n_elements(l,[],nb,1,ct) is (result,unused) then if unused is @@ -367,7 +367,7 @@ define (List(HTML_Row($HTML)),$Upplet) generic_rows ( List(Print_Table($Data)) lpt, - (RGB,Int32,$Data) -> HTML_Row($HTML) line_format, + (RGB,Int,$Data) -> HTML_Row($HTML) line_format, RGB a_color, RGB b_color, ($Upplet,$Data) -> $Upplet do_sum, @@ -393,13 +393,13 @@ define List(HTML_Cell(HTML_In_Form)) List(List(Print_Table($Data))) print_data, List(Table_Option) lto, List(HTML_Row(HTML_In_Form)) names, - (RGB,Int32,$Data) -> HTML_Row(HTML_In_Form) line_format, + (RGB,Int,$Data) -> HTML_Row(HTML_In_Form) line_format, RGB a_color, RGB b_color, ($Upplet,$Data) -> $Upplet do_sum, $Upplet -> HTML_Row(HTML_In_Form) total_line, $Upplet value, - Int32 spacer + Int spacer ) = if print_data is { @@ -427,7 +427,7 @@ public define HTML_In_Form List(Table_Option) lto, List(HTML_Row(HTML_In_Form)) names, HowManyColumns hm_col, - (RGB,Int32,$Data) -> HTML_Row(HTML_In_Form) line_format, + (RGB,Int,$Data) -> HTML_Row(HTML_In_Form) line_format, RGB a_color, RGB b_color, Total_Line($Data,$Upplet,HTML_Row(HTML_In_Form)) total_line @@ -486,13 +486,13 @@ define List(HTML_Cell(HTML_Off_Form)) List(List(Print_Table($Data))) print_data, List(Table_Option) lto, List(HTML_Row(HTML_Off_Form)) names, - (RGB,Int32,$Data) -> HTML_Row(HTML_Off_Form) line_format, + (RGB,Int,$Data) -> HTML_Row(HTML_Off_Form) line_format, RGB a_color, RGB b_color, ($Upplet,$Data) -> $Upplet do_sum, $Upplet -> HTML_Row(HTML_Off_Form) total_line, $Upplet value, - Int32 spacer + Int spacer ) = if print_data is { @@ -520,7 +520,7 @@ public define HTML_Off_Form List(Table_Option) lto, List(HTML_Row(HTML_Off_Form)) names, HowManyColumns hm_col, - (RGB,Int32,$Data) -> HTML_Row(HTML_Off_Form) line_format, + (RGB,Int,$Data) -> HTML_Row(HTML_Off_Form) line_format, RGB a_color, RGB b_color, Total_Line($Data,$Upplet,HTML_Row(HTML_Off_Form)) total_line @@ -588,7 +588,7 @@ public define HTML_Off_Form (List(Table_Option)) lto, (List(HTML_Row(HTML_Off_Form))) columns_name, (HowManyColumns) _1, - ((RGB,Int32,$Data) -> HTML_Row(HTML_Off_Form)) (RGB r,Int32 n,$Data d) |-> line_format(r,d), + ((RGB,Int,$Data) -> HTML_Row(HTML_Off_Form)) (RGB r,Int n,$Data d) |-> line_format(r,d), (RGB) a_color, (RGB) b_color, (Total_Line($Data,$Data,HTML_Row(HTML_Off_Form))) no_total @@ -610,7 +610,7 @@ public define HTML_In_Form (List(Table_Option)) lto, (List(HTML_Row(HTML_In_Form))) columns_name, (HowManyColumns) _1, - ((RGB,Int32,$Data) -> HTML_Row(HTML_In_Form)) (RGB r,Int32 n,$Data d) |-> line_format(r,d), + ((RGB,Int,$Data) -> HTML_Row(HTML_In_Form)) (RGB r,Int n,$Data d) |-> line_format(r,d), (RGB) a_color, (RGB) b_color, (Total_Line($Data,$Data,HTML_Row(HTML_In_Form))) no_total @@ -637,7 +637,7 @@ public define HTML_Off_Form (List(Table_Option)) lto, (List(HTML_Row(HTML_Off_Form))) columns_name, (HowManyColumns) _1, - ((RGB,Int32,$Data) -> HTML_Row(HTML_Off_Form)) (RGB r,Int32 n,$Data d) |-> line_format(r,d), + ((RGB,Int,$Data) -> HTML_Row(HTML_Off_Form)) (RGB r,Int n,$Data d) |-> line_format(r,d), (RGB) a_color, (RGB) b_color, (Total_Line($Data,$Upplet,(HTML_Row(HTML_Off_Form)))) total_line @@ -660,7 +660,7 @@ public define HTML_In_Form (List(Table_Option)) lto, (List(HTML_Row(HTML_In_Form))) columns_name, (HowManyColumns) _1, - ((RGB,Int32,$Data) -> HTML_Row(HTML_In_Form)) (RGB r,Int32 n,$Data d) |-> line_format(r,d), + ((RGB,Int,$Data) -> HTML_Row(HTML_In_Form)) (RGB r,Int n,$Data d) |-> line_format(r,d), (RGB) a_color, (RGB) b_color, (Total_Line($Data,$Upplet,(HTML_Row(HTML_In_Form)))) total_line @@ -678,7 +678,7 @@ public define HTML_Off_Form List(Table_Option) lto, List(HTML_Row(HTML_Off_Form)) columns_name, HowManyColumns number_of_columns, - (RGB,Int32,$Data) -> HTML_Row(HTML_Off_Form) line_format, + (RGB,Int,$Data) -> HTML_Row(HTML_Off_Form) line_format, RGB a_color, RGB b_color ) = @@ -688,7 +688,7 @@ public define HTML_Off_Form (List(Table_Option)) lto, (List(HTML_Row(HTML_Off_Form))) columns_name, (HowManyColumns) number_of_columns, - ((RGB,Int32,$Data) -> HTML_Row(HTML_Off_Form)) (RGB r,Int32 n,$Data d) |-> line_format(r,n,d), + ((RGB,Int,$Data) -> HTML_Row(HTML_Off_Form)) (RGB r,Int n,$Data d) |-> line_format(r,n,d), (RGB) a_color, (RGB) b_color, (Total_Line($Data,$Data,(HTML_Row(HTML_Off_Form)))) no_total @@ -702,7 +702,7 @@ public define HTML_In_Form List(Table_Option) lto, List(HTML_Row(HTML_In_Form)) columns_name, HowManyColumns number_of_columns, - (RGB,Int32,$Data) -> HTML_Row(HTML_In_Form) line_format, + (RGB,Int,$Data) -> HTML_Row(HTML_In_Form) line_format, RGB a_color, RGB b_color ) = @@ -712,7 +712,7 @@ public define HTML_In_Form (List(Table_Option)) lto, (List(HTML_Row(HTML_In_Form))) columns_name, (HowManyColumns) number_of_columns, - ((RGB,Int32,$Data) -> HTML_Row(HTML_In_Form)) (RGB r,Int32 n,$Data d) |-> line_format(r,n,d), + ((RGB,Int,$Data) -> HTML_Row(HTML_In_Form)) (RGB r,Int n,$Data d) |-> line_format(r,n,d), (RGB) a_color, (RGB) b_color, (Total_Line($Data,$Data,(HTML_Row(HTML_In_Form)))) no_total @@ -739,7 +739,7 @@ public define HTML_Off_Form (List(Table_Option)) lto, (List(HTML_Row(HTML_Off_Form))) columns_name, (HowManyColumns) number_of_columns, - ((RGB,Int32,$Data) -> HTML_Row(HTML_Off_Form)) (RGB r,Int32 n,$Data d) |-> line_format(r,d), + ((RGB,Int,$Data) -> HTML_Row(HTML_Off_Form)) (RGB r,Int n,$Data d) |-> line_format(r,d), (RGB) a_color, (RGB) b_color, (Total_Line($Data,$Data,(HTML_Row(HTML_Off_Form)))) no_total @@ -763,7 +763,7 @@ public define HTML_In_Form (List(Table_Option)) lto, (List(HTML_Row(HTML_In_Form))) columns_name, (HowManyColumns) number_of_columns, - ((RGB,Int32,$Data) -> HTML_Row(HTML_In_Form)) (RGB r,Int32 n,$Data d) |-> line_format(r,d), + ((RGB,Int,$Data) -> HTML_Row(HTML_In_Form)) (RGB r,Int n,$Data d) |-> line_format(r,d), (RGB) a_color, (RGB) b_color, (Total_Line($Data,$Data,(HTML_Row(HTML_In_Form)))) no_total diff --git a/calexium_lib/web/CXM_html.anubis b/calexium_lib/web/CXM_html.anubis index ee91787..441d387 100644 --- a/calexium_lib/web/CXM_html.anubis +++ b/calexium_lib/web/CXM_html.anubis @@ -5,7 +5,7 @@ *Copyright* Copyright (c) Alain Prouté 2001. read tools/basis.anubis - +read system/string.anubis @@ -24,7 +24,7 @@ read tools/basis.anubis String value, String temp_file_path). -read web/CXM_common.anubis +read CXM_common.anubis In other words, a 'web argument' is just a pair made of the name of the argument, and the value of the argument, and both are character strings. 'upload' will be explained @@ -33,9 +33,9 @@ read web/CXM_common.anubis The next variable is a multipurpose counter (used to generate unique names). -variable Int32 web_count = 0. +variable Int web_count = 0. -define Int32 +define Int new_web_count = web_count <- *web_count+1; @@ -68,7 +68,7 @@ public type Web_color_name: Web colors. public type Web_color: - rgb(Int32,Int32,Int32), /* give the color by its components */ + rgb(Word8,Word8,Word8), /* give the color by its components */ _(Web_color_name). /* or by its name */ @@ -78,7 +78,7 @@ public type Web_color: public type WebMeta: keywords(List(String)), - refresh(String url, Int32 delay), // in seconds + refresh(String url, Int delay), // in seconds meta(String name, String content), http_equiv(String name, String content). @@ -106,10 +106,10 @@ public type LayerDisposition: vertical. public type FollowPathCommand: // this type is used by the Web_body_option 'follow_path'. - pos(Int32 x, // x coordinate of position - Int32 y, // y coordinate of position - Int32 image_number, // the image to display at that position - Int32 delay). // wait that milliseconds before leaving this position + pos(Int x, // x coordinate of position + Int y, // y coordinate of position + Int image_number, // the image to display at that position + Int delay). // wait that milliseconds before leaving this position public type Web_body_option: background_color(Web_color), /* color for the background */ @@ -121,35 +121,35 @@ public type Web_body_option: // produces a background whose color changes very slowly (this is not tiring) among rather // light pastel colors. // - psychedelic_background(Int32 average, /* average light (0 to 255) */ - Int32 amplitude, /* amplitude of variation of light */ - Int32 delay), /* in milliseconds */ + psychedelic_background(Int average, /* average light (0 to 255) */ + Int amplitude, /* amplitude of variation of light */ + Int delay), /* in milliseconds */ background_image(String file_name), /* name of image file for the background */ // // 'scrolling_layer' produces a layer above the page which is scrolling continuously either // vertically or horizontally. The 'content' is indefinitly repeated. // scrolling_layer(LayerDisposition, - Int32 steps, /* number of pixels of each move */ - Int32 margin, /* measured from left or top in pixels */ - Int32 delay, /* milliseconds for one move */ + Int steps, /* number of pixels of each move */ + Int margin, /* measured from left or top in pixels */ + Int delay, /* milliseconds for one move */ Web_item content, /* content of layer (will be repeated) */ - Int32 period), /* number of pixels between two instances of 'content' */ + Int period), /* number of pixels between two instances of 'content' */ // // 'bounce' shows its content above the page and let it move and bounce on the edges of a rectangle. // The rectangle is determined by the last 4 arguments. // bounce(Web_item content, - Int32 left, - Int32 right, - Int32 top, - Int32 bottom), + Int left, + Int right, + Int top, + Int bottom), // // put something over the page in any position you want: // over(Web_item content, - Int32 left, - Int32 top), + Int left, + Int top), // // follow_path: let a changing image follow a path on the screen. This gadget shows // an image following a polygonal path on the screen. The image may change at regular @@ -171,18 +171,18 @@ public type Web_body_option: // rank 0). 'd' is the delay in milliseconds to wait before leaving that position. // follow_path(List(String) filenames, /* the changing images which follows the path */ - Int32 change_every, /* number of steps betwen two changes */ + Int change_every, /* number of steps betwen two changes */ List(FollowPathCommand) path, /* the polygonal path and commands */ Bool loop, /* if true do it repeatedly, otherwise only once */ - Int32 steps, /* approximative distance (in pixels) between two + Int steps, /* approximative distance (in pixels) between two successive positions */ - Int32 delay), /* milliseconds between two successive positions */ + Int delay), /* milliseconds between two successive positions */ load_image(String name), /* load an image (for next page), which is not displayed */ - left_margin(Int32), /* left margin for document */ - top_margin(Int32), /* top margin for document */ - margin_width(Int32), - margin_height(Int32), + left_margin(Int), /* left margin for document */ + top_margin(Int), /* top margin for document */ + margin_width(Int), + margin_height(Int), reload_frame(String name, /* name of target frame */ String url), /* url to load in this frame */ onload(String function_name). /* nom de la fonction javascript (sans les '()') */ @@ -230,7 +230,7 @@ public type Page_body: public type VFrame: - frame(Int32 height, + frame(Int height, Printable_tree url, String name). @@ -242,8 +242,8 @@ public type Web_page: Page_body body), /* body of page */ standard_frameset(String title, List(WebMeta) meta_tags, - Int32 height, /* height of 'top menu' (pixels) */ - Int32 width, /* width of 'left menu' (pixels) */ + Int height, /* height of 'top menu' (pixels) */ + Int width, /* width of 'left menu' (pixels) */ Printable_tree main). /* url for main */ +---------+--------------------------+ @@ -293,8 +293,8 @@ public define Web_page standard_frameset ( String title, - Int32 height, - Int32 width, + Int height, + Int width, Printable_tree main ) = @@ -331,8 +331,8 @@ public type Web_item: text_nowrap_pt(Printable_tree), par(String), preformated_text(String text), - integer(Int32), - float(Float,Int32),... + integer(Int), + float(Float,Int),... You may want to center a web item in a page. Just enclose it into @@ -345,8 +345,8 @@ public type Web_item: You may want to write characters of a given item with a big font: public type Web_item: - bigger(Int32,Web_item), - smaller(Int32,Web_item), + bigger(Int,Web_item), + smaller(Int,Web_item), bold(Web_item), italic(Web_item), big(Web_item), @@ -366,14 +366,14 @@ public type WebStyle: float_to_left, // the web item will float to the left and text will wrap around float_to_right, font_family(String font_name), // "verdana" "helvetica" "times" etc... - font_size(Int32 size), + font_size(Int size), italic, oblique, small_capitals, bold, bolder, lighter, - line_height(Int32 height), + line_height(Int height), text_center, text_left, text_right, @@ -381,7 +381,7 @@ public type WebStyle: text_underline, text_blink, text_line_through, - width(Int32 n). + width(Int n). @@ -390,12 +390,12 @@ public type Web_item: public type Web_item: - spacer(Int32 width, Int32 height), + spacer(Int width, Int height), image(String file_name), /* image */ image_d(String file_name, String description), image_pt(Printable_tree file_name), on_image(String file_name, Web_item content), - turning_images(NonEmptyList(String) filenames, Int32 millisecs),... + turning_images(NonEmptyList(String) filenames, Int millisecs),... @@ -418,8 +418,8 @@ public type Web_item: String target, String image_on, String image_off, - Int32 width, - Int32 height, + Int width, + Int height, String description), ... @@ -428,7 +428,7 @@ public type Web_item: zones overlap, the first one (in the order they are defined) is selected. Zones are of 3 sorts: rectangles, circles and polygons. Point's coordinates are - specified as pairs of integers (of anonymous agglomeration type (Int32,Int32)). The + specified as pairs of integers (of anonymous agglomeration type (Int,Int)). The first coordinate counts pixels from the left of the image. The second coordinate counts pixels from the top of the image. With polygons, you can construct zones which are almost as complicated as you want. You may also construct a zone as the overlapping of @@ -437,19 +437,19 @@ public type Web_item: public type Mouse_Sensitive_Zone: rectangle ( - (Int32,Int32) left_top, - (Int32,Int32) right_bottom, + (Int,Int) left_top, + (Int,Int) right_bottom, String url ), circle ( - (Int32,Int32) center, - Int32 radius, + (Int,Int) center, + Int radius, String url ), polygon ( - List((Int32,Int32)) vertices, + List((Int,Int)) vertices, String url ). @@ -518,14 +518,14 @@ form public type Web_item: text_input(String name, /* text field to be documented by user */ - Int32 size, + Int size, String initial_value),... public define Web_item text_input ( String name, - Int32 size, + Int size, String initial_value ) = @@ -535,12 +535,12 @@ public type Web_item: public type Web_item: password_input(String name, - Int32 size), + Int size), text_area(String name, - Int32 columns, - Int32 rows, + Int columns, + Int rows, String initial_text), - upload(String name, Int32 size),... + upload(String name, Int size),... @@ -560,7 +560,7 @@ public type Web_item: String hl_image_file), text_submit(String name, String value, String text), web_submit(String web_args, Web_item content), - button(String name, String text, String on_click_fonction, Int32 width, Int32 height),... + button(String name, String text, String on_click_fonction, Int width, Int height),... public type Web_item: /* mark the form with an information */ @@ -625,11 +625,11 @@ public type Table_option: more or less wide. You may also specify a color for the border. */ border, nude, /* equivalent to 'border(0,0,0)' (below) */ - border(Int32, /* width of exterior (pixels) */ - Int32, /* width of top */ - Int32), /* width of interior */ + border(Int, /* width of exterior (pixels) */ + Int, /* width of top */ + Int), /* width of interior */ border_color(Web_color), - absolute_width(Int32). + absolute_width(Int). @@ -649,7 +649,7 @@ public type Row_option: top, v_center, bottom, - absolute_height(Int32), + absolute_height(Int), base_line, /* set the background color of all cells in the row */ background_color(Web_color). @@ -670,13 +670,13 @@ public type Cell_option: /* you can set the width of the cell either absolutely (in pixels) or as a percentage of the width of the table. */ background_image(String file_name), - absolute_width(Int32), - relative_width(Int32), - absolute_height(Int32), - relative_height(Int32), + absolute_width(Int), + relative_width(Int), + absolute_height(Int), + relative_height(Int), /* a cell may span over several columns or rows in the table */ - columns(Int32), - rows(Int32), + columns(Int), + rows(Int), nowrap. @@ -713,14 +713,14 @@ public type Web_item: public type Web_item: select(String name, - Int32 size, + Int size, List(String) choices), select(String name, - Int32 size, + Int size, List(String) choices, String selected), immediate_select(String name, // selection will immediately submit the form - Int32 size, + Int size, List(String) choices),... @@ -738,23 +738,23 @@ public type Web_item: String web_args, String window_name, Web_item content, - Int32 width, - Int32 height), + Int width, + Int height), link_to_window_with_ticket_and_scroll (String name, String web_args, String window_name, Web_item content, - Int32 width, - Int32 height), + Int width, + Int height), link_to_window_with_ticket_and_scroll (String name, String label_name, String web_args, String window_name, Web_item content, - Int32 width, - Int32 height), + Int width, + Int height), link_to_frame (Printable_tree name, String frame_name, Web_item). @@ -798,7 +798,7 @@ public define String ) = if wc is { - rgb(r,g,b) then "\"#" + hexadecimal(r,2) + hexadecimal(g,2) + hexadecimal(b,2) + "\"", + rgb(r,g,b) then "\"#" + to_hexa(r) + to_hexa(g) + to_hexa(b) + "\"", _(c) then format(c) }. @@ -809,7 +809,7 @@ public define String ) = if wc is { - rgb(r,g,b) then "#" + hexadecimal(r,2) + hexadecimal(g,2) + hexadecimal(b,2) + "", + rgb(r,g,b) then "#" + to_hexa(r) + to_hexa(g) + to_hexa(b) + "", _(c) then format(c) }. @@ -826,7 +826,7 @@ public define String ) = if wc is { - rgb(r,g,b) then "" + hexadecimal(r,2) + hexadecimal(g,2) + hexadecimal(b,2) + "", + rgb(r,g,b) then "" + to_hexa(r) + to_hexa(g) + to_hexa(b) + "", _(c) then format(c) }. @@ -837,13 +837,17 @@ define Printable_tree ) = [(String)format_without_sharp(c)]. +define Printable_tree + [Word32 x . Printable_tree t] + = + [to_Int(x) . t]. define Printable_tree psychedelic_bg ( - Int32 average, - Int32 amplitude, - Int32 delay + Int average, + Int amplitude, + Int delay ) = with ampl = if amplitude >= 120 then 120 else if amplitude =< 1 then 1 else amplitude, @@ -865,23 +869,23 @@ define List(Web_body_option) replace_background_init ( List(Web_body_option) l, - Int32 average, - Int32 amplitude, - Int32 delay + Int average, + Int amplitude, + Int delay ) = if l is { [ ] then [ ], [h . t] then if h is background_color(_) - then [background_color(rgb(average+amplitude, - average, - average-amplitude)) + then [background_color(rgb(truncate_to_Word8(average+amplitude), + truncate_to_Word8(average), + truncate_to_Word8(average-amplitude))) . replace_background_init(t,average,amplitude,delay)] else [h . replace_background_init(t,average,amplitude,delay)] }. -define Maybe((Int32,Int32,Int32)) +define Maybe((Int,Int,Int)) get_psy ( List(Web_body_option) l @@ -920,10 +924,10 @@ define Printable_tree move_layer_command ( String property, - Int32 n, - Int32 num, - Int32 i, - Int32 period + Int n, + Int num, + Int i, + Int period ) = if i >= num then [ ] else [" if (document.layers)", @@ -936,12 +940,12 @@ define Printable_tree format_layers ( LayerDisposition disp, - Int32 margin, + Int margin, Web_item content, - Int32 n, - Int32 num, - Int32 i, - Int32 period + Int n, + Int num, + Int i, + Int period ) = if i >= num then [ ] else ["", @@ -985,8 +989,8 @@ define Printable_tree over ( Web_item i, - Int32 left, - Int32 top + Int left, + Int top ) = with n = new_web_count, [ "", @@ -999,10 +1003,10 @@ define Printable_tree bnce ( Web_item i, - Int32 left, - Int32 right, - Int32 top, - Int32 bottom + Int left, + Int right, + Int top, + Int bottom ) = with n = new_web_count, [ "