/* Copyright 1997 Acorn Computers Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /***************************************************/ /* File : Limits.h */ /* */ /* */ /* Purpose: Definitions relating to fundamental */ /* limitations of the application. */ /* */ /* Author : A.D.Hodgkinson */ /* */ /* History: 13-Nov-96: Created. */ /* 16-Aug-97: Ensured that the lengths */ /* *did* include terminators */ /* (previously, they weren't */ /* supposed to). */ /***************************************************/ /***************************************************************************************/ /* */ /* Hard coded application limits */ /* ============================= */ /* */ /* Many of these are hard coded limits required since C won't let you do things like: */ /* */ /* { */ /* char buffer[strlen(struct->path) + extralen]; */ /* */ /* ... */ /* } */ /* */ /* Others are OS limits, or derived from OS limits; they may be related to the scope */ /* of values in related HTML; and so-on. */ /* */ /* In the lists below, a description of what the limit represents is given. Where */ /* these are used can be worked out by loading all source / header files and doing a */ /* global List Of Found. The description is followed by a single digit code: */ /* */ /* D The size is arbitrary, though changing the value may have unpredictable effects */ /* and so every case must be considered in light of the code relevant to the limit */ /* in question. For example, no errors will be raised if the number of items */ /* allowed in a <SELECT> list is reduced to 64 - menus would simply be truncated. */ /* */ /* The next three are generally relevant to string buffers: */ /* */ /* S The buffer is 'safe', i.e. it can be reduced in size and should not be overrun */ /* if something too big to fit in it is generated. Errors may be raised in this */ /* case though (e.g. Buffer Too Short complaints from the Toolbox). Correct */ /* behaviour is not guaranteed at sizes of 2 bytes or less. */ /* */ /* U The buffer is 'unsafe', i.e. code assumes that whatever is to fit in the buffer */ /* will always do so. The sizes defined here must thus be chosen with careful */ /* consideration of the code involved. Some of these may have guards on them for */ /* TRACE builds, though. */ /* */ /* P Some buffers may be unsafe to an extent in one place but safe elsewhere, in */ /* which case they generally have to be treated as unsafe. It may be possible to */ /* modify code at some future time and make all usages safe though, so the */ /* distinction is made. */ /* */ /* Where buffers are related to string lengths, any relevant terminators are included */ /* in the length. */ /* */ /***************************************************************************************/ /* First, Messages file related limits. */ #define Limits_Token 32 /* Length of any given Messages file token S */ #define Limits_Message 256 /* Length of any given Messages file message S */ #define Limits_TaskName 64 /* Length of the _TaskName message (U) - used P */ /* also for enumerating task names from the */ /* Task Manager and for the flex library (S) */ #define Limits_StatusFormat 50 /* Length of the Page, Fetch, Process, Format, S */ /* and LinkTo messages */ /* Resource (Res) file determined limits (Res files must be kept in */ /* sync with these - that is, any Res file buffer which has an entry */ /* here should be exactly the size that the entry defines). */ #define Limits_Help 256 /* Maximum length of help text for any gadget S */ #define Limits_Title 999 /* Browser window title bar S */ #define Limits_URLBarWrit 999 /* URL bar or Open URL dialogue writable S */ #define Limits_StatusBarStatus 999 /* Main status display field S */ #define Limits_StatusBarProgress 20 /* Status byte counter display field S */ #define Limits_URLBarDiallerStatus 16 /* Online time and dialler status messages S */ #define Limits_URLBarDiallerStatusLabel 16 /* Label on the dialler status display S */ #define Limits_StatusBarStatusLabel 16 /* Label on the main status display S */ #define Limits_ToolActionIdent 256 /* ToolAction ident strings in the Toolbar S */ #define Limits_NRangeIcons 10 /* For get_icon_list on a Number Range gadget U */ #define Limits_PEndManyLabel 64 /* PEndManyLabel button text in Print dialogue S */ #define Limits_AuthPrompt 256 /* Authorisation dialogue main display panel S */ #define Limits_AuthUserWrit 256 /* Authorisation dialogue user name writable S */ #define Limits_AuthPassWrit 256 /* Authorisation dialogue password writable S */ #define Limits_FindWrit 128 /* Find dialogue main writable field S */ #define Limits_Lower_Sheets 1 /* Limits on the Number Range gadgets for D */ #define Limits_Upper_Sheets 100 /* filling in 'n' sheets or printing 'n' copies D */ #define Limits_Lower_Copies 1 /* of a page, in the Print dialogue. D */ #define Limits_Upper_Copies 1000 /* D */ #define Limits_Hotlist_ItemName 32 /* Item name (e.g. "URL 'Acorn'") in main menu S */ #define Limits_SaveFile_Option 24 /* Optional option button label text in SaveFile S */ #define Limits_SaveFile_Radios 24 /* Optional radio button label texts in SaveFile S */ /* OS defined limits (these may not necessarily be actual OS limits, */ /* but OS related limits which the browser has to enforce internally). */ #define Limits_OS_SpriteName 13 /* Sprite name (plus terminator) U */ #define Limits_OS_FontHandles 256 /* Maximum number of active font handles D */ #define Limits_OS_Pathname 8192 /* Maximum length of any given pathname, e.g. P */ /* the Choices file (U) or save dialogue */ /* pathnames (S). */ /* Source file or function local limits for any build... */ #define Limits_URL 6144 /* Length of a URL (or URI) string S */ #define Limits_Leafname 64 /* Length of a leaf name for app to app saves S */ #define Limits_UserAgent 256 /* User agent string S */ #define Limits_FetchProgress 32 /* Fetch progress, if appending to status U */ #define Limits_NamedAnchor 256 /* The string after a '#' in a URL S */ #define Limits_Target 256 /* Window target name S */ #define Limits_FontName 128 /* The length of a RISC OS font name S */ #define Limits_FaceName 64 /* The length of a browser typeface name S */ #define Limits_FontSizes 7 /* The 7 font sizes for <FONT SIZE=...> D */ #define Limits_SelectItems 1024 /* Number of items in a <SELECT> list D */ #define Limits_Realm 192 /* The realm for authorisation S */ #define Limits_HostName 192 /* The host name for authorisation S */ #define Limits_HistoryMenuItemSize 60 /* Max. width of history menus, in characters D */ /* ...and a few more for multiuser builds (SINGLE_USER not defined). */ #define Limits_Multi_UserName 20 /* User name for login S */ #define Limits_Multi_Password 11 /* Password for login S */ #define Limits_Multi_HomePage 256 /* Home page URL for user S */ #define Limits_Multi_Name 32 /* User's actual name S */ #define Limits_Multi_History 256 /* Pathname to save/load history file S */ #define Limits_Multi_Hotlist 256 /* Pathname to save/load hotlist file S */ /* Miscellaneous limits - limitation definitions that don't */ /* easily fit into another category. */ #define Limits_Misc_AnimFrames 1024 /* The number of animation sprites allowed D */ #define Limits_Misc_Bullets 128 /* The number of bullet sprites allowed D */