Limits 11.4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
/* 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.
 */
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79
/***************************************************/
/* 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. */

80 81 82 83 84 85 86
#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                             */
87 88 89 90 91

/* 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).          */

92
#define Limits_Help                     256  /* Maximum length of help text for any gadget    S */
93

94 95 96 97 98 99 100 101
#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 */
102

103 104
#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 */
105

106 107 108
#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 */
109

110
#define Limits_FindWrit                 128  /* Find dialogue main writable field             S */
111

112 113 114 115
#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 */
116

117 118
#define Limits_Hotlist_ItemName         32   /* Item name (e.g. "URL 'Acorn'") in main menu   S */

119 120 121
#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 */

122 123 124
/* OS defined limits (these may not necessarily be actual OS limits,   */
/* but OS related limits which the browser has to enforce internally). */

125 126 127 128 129
#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).                                  */
130 131 132

/* Source file or function local limits for any build... */

133 134
#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 */
135

136
#define Limits_UserAgent                256  /* User agent string                             S */
137

138
#define Limits_FetchProgress            32   /* Fetch progress, if appending to status        U */
139

140 141
#define Limits_NamedAnchor              256  /* The string after a '#' in a URL               S */
#define Limits_Target                   256  /* Window target name                            S */
142

143 144 145
#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 */
146

147
#define Limits_SelectItems              1024 /* Number of items in a <SELECT> list            D */
148

149 150
#define Limits_Realm                    192  /* The realm for authorisation                   S */
#define Limits_HostName                 192  /* The host name for authorisation               S */
151

152 153
#define Limits_HistoryMenuItemSize      60   /* Max. width of history menus, in characters    D */

154 155
/* ...and a few more for multiuser builds (SINGLE_USER not defined). */

156 157 158 159 160 161
#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 */
162 163 164 165

/* Miscellaneous limits - limitation definitions that don't */
/* easily fit into another category.                        */

166 167
#define Limits_Misc_AnimFrames          1024 /* The number of animation sprites allowed       D */
#define Limits_Misc_Bullets             128  /* The number of bullet sprites allowed          D */