added concrete implementations of putc(), getc(), getchar() and gets()
[tangerine.git] / workbench / prefs / icontrol / misc.c
blob6bbce19554ea906d49018b273d183e72be2971d0
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 /*********************************************************************************************/
11 #include "global.h"
12 #include "version.h"
14 #include <string.h>
16 /*********************************************************************************************/
18 struct NewMenu nm[] =
20 {NM_TITLE, (STRPTR)MSG_MEN_PROJECT },
21 {NM_ITEM, (STRPTR)MSG_MEN_PROJECT_OPEN },
22 {NM_ITEM, (STRPTR)MSG_MEN_PROJECT_SAVEAS },
23 {NM_ITEM, NM_BARLABEL },
24 {NM_ITEM, (STRPTR)MSG_MEN_PROJECT_QUIT },
25 {NM_TITLE, (STRPTR)MSG_MEN_EDIT },
26 {NM_ITEM, (STRPTR)MSG_MEN_EDIT_DEFAULT },
27 {NM_ITEM, (STRPTR)MSG_MEN_EDIT_LASTSAVED },
28 {NM_ITEM, (STRPTR)MSG_MEN_EDIT_RESTORE },
29 {NM_TITLE, (STRPTR)MSG_MEN_SETTINGS },
30 {NM_ITEM, (STRPTR)MSG_MEN_SETTINGS_CREATEICONS, NULL, CHECKIT | MENUTOGGLE },
31 {NM_END}
34 /*********************************************************************************************/
36 void InitMenus(void)
38 struct NewMenu *actnm = nm;
40 for(actnm = nm; actnm->nm_Type != NM_END; actnm++)
42 if (actnm->nm_Label != NM_BARLABEL)
44 ULONG id = (ULONG)actnm->nm_Label;
45 STRPTR str = MSG(id);
47 if (actnm->nm_Type == NM_TITLE)
49 actnm->nm_Label = str;
50 } else {
51 actnm->nm_Label = str + 2;
52 if (str[0] != ' ') actnm->nm_CommKey = str;
54 actnm->nm_UserData = (APTR)id;
56 } /* if (actnm->nm_Label != NM_BARLABEL) */
58 } /* for(actnm = nm; nm->nm_Type != NM_END; nm++) */
62 /*********************************************************************************************/
64 /*********************************************************************************************/
66 STRPTR GetFile(STRPTR title, STRPTR dir, BOOL savemode)
68 static UBYTE filebuffer[300];
69 struct FileRequester *req;
70 STRPTR retval = NULL;
72 AslBase = OpenLibrary("asl.library", 39);
73 if (AslBase)
75 req = AllocAslRequestTags(ASL_FileRequest, ASLFR_TitleText , (IPTR)title,
76 ASLFR_DoPatterns , TRUE ,
77 ASLFR_InitialDrawer, (IPTR)dir ,
78 ASLFR_DoSaveMode , savemode ,
79 TAG_DONE);
80 if (req)
82 if (AslRequest(req, NULL))
84 strncpy(filebuffer, req->fr_Drawer, 299);
85 AddPart(filebuffer, req->fr_File, 299);
87 retval = filebuffer;
89 } /* if (AslRequest(req, NULL) */
91 FreeAslRequest(req);
93 } /* if (req) */
95 CloseLibrary(AslBase);
97 } /* if (AslBase) */
99 return retval;
102 /*********************************************************************************************/