Commit ea7d3f309ea5b4b5861a18a0d4c22c0914b74591
1 parent
6201b469
Exists in
master
and in
3 other branches
Moving FT messages translation table to the protocol library.
Showing
2 changed files
with
24 additions
and
5 deletions
Show diff stats
lib3270.cbp
@@ -145,6 +145,9 @@ | @@ -145,6 +145,9 @@ | ||
145 | <Unit filename="src/lib3270/ft_dft.c"> | 145 | <Unit filename="src/lib3270/ft_dft.c"> |
146 | <Option compilerVar="CC" /> | 146 | <Option compilerVar="CC" /> |
147 | </Unit> | 147 | </Unit> |
148 | + <Unit filename="src/lib3270/ftmessages.c"> | ||
149 | + <Option compilerVar="CC" /> | ||
150 | + </Unit> | ||
148 | <Unit filename="src/lib3270/host.c"> | 151 | <Unit filename="src/lib3270/host.c"> |
149 | <Option compilerVar="CC" /> | 152 | <Option compilerVar="CC" /> |
150 | </Unit> | 153 | </Unit> |
src/include/lib3270/filetransfer.h
@@ -157,12 +157,18 @@ | @@ -157,12 +157,18 @@ | ||
157 | 157 | ||
158 | }; | 158 | }; |
159 | 159 | ||
160 | - | 160 | + typedef struct _lib3270_ft_message |
161 | + { | ||
162 | + const char * id; ///< @brief Message ID. | ||
163 | + unsigned char failed; ///< @brief Non zero if this message indicates a failure. | ||
164 | + const char * message; ///< @brief Message text. | ||
165 | + const char * description; ///< @brief Message description. | ||
166 | + } LIB3270_FT_MESSAGE; | ||
161 | 167 | ||
162 | /** | 168 | /** |
163 | - * Create a new file transfer session. | 169 | + * @brief Create a new file transfer session. |
164 | * | 170 | * |
165 | - * @param session | 171 | + * @param hSession |
166 | * @param flags | 172 | * @param flags |
167 | * @param local | 173 | * @param local |
168 | * @param remote | 174 | * @param remote |
@@ -173,8 +179,8 @@ | @@ -173,8 +179,8 @@ | ||
173 | * @param dft | 179 | * @param dft |
174 | * @param msg Pointer to receive message text. | 180 | * @param msg Pointer to receive message text. |
175 | * | 181 | * |
176 | - * @return Filetransfer callback table | ||
177 | - * | 182 | + * @return Filetransfer session handle. |
183 | + * | ||
178 | */ | 184 | */ |
179 | LIB3270_EXPORT H3270FT * lib3270_ft_new(H3270 *hSession, LIB3270_FT_OPTION flags, const char *local, const char *remote, int lrecl, int blksize, int primspace, int secspace, int dft, const char **msg); | 185 | LIB3270_EXPORT H3270FT * lib3270_ft_new(H3270 *hSession, LIB3270_FT_OPTION flags, const char *local, const char *remote, int lrecl, int blksize, int primspace, int secspace, int dft, const char **msg); |
180 | 186 | ||
@@ -190,5 +196,15 @@ | @@ -190,5 +196,15 @@ | ||
190 | 196 | ||
191 | LIB3270_EXPORT struct lib3270_ft_callbacks * lib3270_get_ft_callbacks(H3270 *session, unsigned short sz); | 197 | LIB3270_EXPORT struct lib3270_ft_callbacks * lib3270_get_ft_callbacks(H3270 *session, unsigned short sz); |
192 | 198 | ||
199 | + /** | ||
200 | + * @brief Translate IND$FILE response. | ||
201 | + * | ||
202 | + * @param msg Message received. | ||
203 | + * | ||
204 | + * @return Structure with message description and type. | ||
205 | + * | ||
206 | + */ | ||
207 | + LIB3270_EXPORT const LIB3270_FT_MESSAGE * lib3270_translate_ft_message(const char *msg); | ||
208 | + | ||
193 | 209 | ||
194 | #endif // LIB3270_FILETRANSFER_INCLUDED | 210 | #endif // LIB3270_FILETRANSFER_INCLUDED |