1 /*
2  * uuidutil.h
3  *
4  * DSP-BIOS Bridge driver support functions for TI OMAP processors.
5  *
6  * This file contains the specification of UUID helper functions.
7  *
8  * Copyright (C) 2005-2006 Texas Instruments, Inc.
9  *
10  * This package is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License version 2 as
12  * published by the Free Software Foundation.
13  *
14  * THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
15  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
16  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17  */
18 
19 #ifndef UUIDUTIL_
20 #define UUIDUTIL_
21 
22 #define MAXUUIDLEN  37
23 
24 /*
25  *  ======== uuid_uuid_to_string ========
26  *  Purpose:
27  *      Converts a dsp_uuid to an ANSI string.
28  *  Parameters:
29  *      uuid_obj:      Pointer to a dsp_uuid object.
30  *      sz_uuid:    Pointer to a buffer to receive a NULL-terminated UUID
31  *                  string.
32  *      size:	    Maximum size of the sz_uuid string.
33  *  Returns:
34  *  Requires:
35  *      uuid_obj & sz_uuid are non-NULL values.
36  *  Ensures:
37  *      Lenghth of sz_uuid is less than MAXUUIDLEN.
38  *  Details:
39  *      UUID string limit currently set at MAXUUIDLEN.
40  */
41 void uuid_uuid_to_string(struct dsp_uuid *uuid_obj, char *sz_uuid,
42 			 s32 size);
43 
44 /*
45  *  ======== uuid_uuid_from_string ========
46  *  Purpose:
47  *      Converts an ANSI string to a dsp_uuid.
48  *  Parameters:
49  *      sz_uuid:    Pointer to a string that represents a dsp_uuid object.
50  *      uuid_obj:      Pointer to a dsp_uuid object.
51  *  Returns:
52  *  Requires:
53  *      uuid_obj & sz_uuid are non-NULL values.
54  *  Ensures:
55  *  Details:
56  *      We assume the string representation of a UUID has the following format:
57  *      "12345678_1234_1234_1234_123456789abc".
58  */
59 extern void uuid_uuid_from_string(char *sz_uuid,
60 				  struct dsp_uuid *uuid_obj);
61 
62 #endif /* UUIDUTIL_ */
63