1 |
|
|
/*************************************************************************** |
2 |
|
|
* Copyright (c) 2024 Microsoft Corporation |
3 |
|
|
* Copyright (c) 2026-present Eclipse ThreadX contributors |
4 |
|
|
* |
5 |
|
|
* This program and the accompanying materials are made available under the |
6 |
|
|
* terms of the MIT License which is available at |
7 |
|
|
* https://opensource.org/licenses/MIT. |
8 |
|
|
* |
9 |
|
|
* SPDX-License-Identifier: MIT |
10 |
|
|
**************************************************************************/ |
11 |
|
|
|
12 |
|
|
|
13 |
|
|
/**************************************************************************/ |
14 |
|
|
/**************************************************************************/ |
15 |
|
|
/** */ |
16 |
|
|
/** FileX Component */ |
17 |
|
|
/** */ |
18 |
|
|
/** Media */ |
19 |
|
|
/** */ |
20 |
|
|
/**************************************************************************/ |
21 |
|
|
/**************************************************************************/ |
22 |
|
|
|
23 |
|
|
#define FX_SOURCE_CODE |
24 |
|
|
|
25 |
|
|
|
26 |
|
|
/* Include necessary system files. */ |
27 |
|
|
|
28 |
|
|
#include "fx_api.h" |
29 |
|
|
#include "fx_media.h" |
30 |
|
|
|
31 |
|
|
|
32 |
|
|
FX_CALLER_CHECKING_EXTERNS |
33 |
|
|
|
34 |
|
|
|
35 |
|
|
/**************************************************************************/ |
36 |
|
|
/* */ |
37 |
|
|
/* FUNCTION RELEASE */ |
38 |
|
|
/* */ |
39 |
|
|
/* _fxe_media_open_notify_set PORTABLE C */ |
40 |
|
|
/* 6.1 */ |
41 |
|
|
/* AUTHOR */ |
42 |
|
|
/* */ |
43 |
|
|
/* William E. Lamie, Microsoft Corporation */ |
44 |
|
|
/* */ |
45 |
|
|
/* DESCRIPTION */ |
46 |
|
|
/* */ |
47 |
|
|
/* This function checks for errors in the media open notify set. */ |
48 |
|
|
/* */ |
49 |
|
|
/* INPUT */ |
50 |
|
|
/* */ |
51 |
|
|
/* media_ptr Media control block pointer */ |
52 |
|
|
/* media_open_notify Notify function called when */ |
53 |
|
|
/* media is open */ |
54 |
|
|
/* */ |
55 |
|
|
/* OUTPUT */ |
56 |
|
|
/* */ |
57 |
|
|
/* FX_PTR_ERROR media_ptr is NULL */ |
58 |
|
|
/* status Actual completion status */ |
59 |
|
|
/* */ |
60 |
|
|
/* CALLS */ |
61 |
|
|
/* */ |
62 |
|
|
/* _fx_media_open_notify Actual media open notify set */ |
63 |
|
|
/* */ |
64 |
|
|
/* CALLED BY */ |
65 |
|
|
/* */ |
66 |
|
|
/* Application Code */ |
67 |
|
|
/* */ |
68 |
|
|
/**************************************************************************/ |
69 |
|
546 |
UINT _fxe_media_open_notify_set(FX_MEDIA *media_ptr, VOID (*media_open_notify)(FX_MEDIA *media)) |
70 |
|
|
{ |
71 |
|
|
UINT status; |
72 |
|
|
|
73 |
|
|
/* Check for invalid input pointers. */ |
74 |
✓✓ |
546 |
if (media_ptr == FX_NULL) |
75 |
|
|
{ |
76 |
|
136 |
return(FX_PTR_ERROR); |
77 |
|
|
} |
78 |
|
|
|
79 |
|
|
/* Check for a valid caller. */ |
80 |
✓✓✓✓ ✓✓ |
410 |
FX_CALLER_CHECKING_CODE |
81 |
|
|
|
82 |
|
|
/* Call actual media open notify set service. */ |
83 |
|
2 |
status = _fx_media_open_notify_set(media_ptr, media_open_notify); |
84 |
|
|
|
85 |
|
|
/* Return status. */ |
86 |
|
2 |
return(status); |
87 |
|
|
} |
88 |
|
|
|