Merged difference between 7.12 and 7.15 into trunk.
[AROS.git] / external / openurl / raPrefs / utility.c
blobef8a2e6019207009cf639d272ff131cefd122d94
1 /***************************************************************************
3 openurl.library - universal URL display and browser launcher library
4 Copyright (C) 1998-2005 by Troels Walsted Hansen, et al.
5 Copyright (C) 2005-2013 by openurl.library Open Source Team
7 This library is free software; it has been placed in the public domain
8 and you can freely redistribute it and/or modify it. Please note, however,
9 that some components may be under the LGPL or GPL license.
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 openurl.library project: http://sourceforge.net/projects/openurllib/
17 $Id$
19 ***************************************************************************/
21 #include "utility.h"
23 #include <classes/requester.h>
25 #include <proto/exec.h>
26 #include <proto/requester.h>
27 #include <proto/intuition.h>
28 #include <proto/listbrowser.h>
30 #include <reaction/reaction_macros.h>
32 #include <stdarg.h> // for va_list handling
35 int VARARGS68K RA_Request(Object * pWin, const char * strTitle, const char * strGadgets, const char * strFormat, ...)
37 int nResult = -1;
38 va_list valist;
39 Object * pReq;
41 va_startlinear(valist, strFormat);
43 pReq = RequesterObject,
44 REQ_Type, REQTYPE_INFO,
45 REQ_TitleText, strTitle,
46 REQ_BodyText, strFormat,
47 REQ_VarArgs, va_getlinearva(valist,APTR),
48 REQ_GadgetText, strGadgets,
49 EndObject;
51 va_end(valist);
53 if(pReq)
55 nResult = OpenRequester(pReq, pWin);
57 IIntuition->DisposeObject(pReq);
58 pReq = NULL;
61 return nResult;
64 // libération de la liste
65 void freeList(struct List * list)
67 struct Node *node;
69 while((node = IExec->RemHead(list)) != NULL)
70 IListBrowser->FreeListBrowserNode(node);