Changeset 4318
- Timestamp:
- 02/07/10 01:22:38 (3 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 4 edited
-
caca/caca.h (modified) (5 diffs)
-
caca/file.c (modified) (10 diffs)
-
caca/string.c (modified) (1 diff)
-
win32/config.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/caca.h
r4146 r4318 67 67 * 68 68 * @{ */ 69 /** \e libcaca colour keyword */ 69 70 enum caca_color 70 71 { … … 89 90 }; 90 91 92 /** \e libcaca style keyword */ 91 93 enum caca_style 92 94 { … … 128 130 struct caca_event 129 131 { 130 enum caca_event_type type; 132 enum caca_event_type type; /**< The event type. */ 131 133 union 132 134 { … … 134 136 struct { int w, h; } resize; 135 137 struct { int ch; uint32_t utf32; char utf8[8]; } key; 136 } data; 138 } data; /**< The event information data */ 139 #if !defined(_DOXYGEN_SKIP_ME) 137 140 uint8_t padding[16]; 141 #endif 138 142 }; 139 143 … … 569 573 struct caca_conio_text_info 570 574 { 571 unsigned char winleft; /* left window coordinate */572 unsigned char wintop; /* top window coordinate */573 unsigned char winright; /* right window coordinate */574 unsigned char winbottom; /* bottom window coordinate */575 unsigned char attribute; /* text attribute */576 unsigned char normattr; /* normal attribute */577 unsigned char currmode; /* current video mode:578 BW40, BW80, C40, C80, or C4350 */579 unsigned char screenheight; /* text screen's height */580 unsigned char screenwidth; /* text screen's width */581 unsigned char curx; /* x-coordinate in current window */582 unsigned char cury; /* y-coordinate in current window */575 unsigned char winleft; /**< left window coordinate */ 576 unsigned char wintop; /**< top window coordinate */ 577 unsigned char winright; /**< right window coordinate */ 578 unsigned char winbottom; /**< bottom window coordinate */ 579 unsigned char attribute; /**< text attribute */ 580 unsigned char normattr; /**< normal attribute */ 581 unsigned char currmode; /**< current video mode: 582 BW40, BW80, C40, C80, or C4350 */ 583 unsigned char screenheight; /**< text screen's height */ 584 unsigned char screenwidth; /**< text screen's width */ 585 unsigned char curx; /**< x-coordinate in current window */ 586 unsigned char cury; /**< y-coordinate in current window */ 583 587 }; 584 588 -
libcaca/trunk/caca/file.c
r4148 r4318 51 51 #endif 52 52 53 /** \brief Open a file for reading or writing 54 * 55 * Create a caca file handle for a file. If the file is zipped, it is 56 * decompressed on the fly. 57 * 58 * If an error occurs, NULL is returned and \b errno is set accordingly: 59 * - \c ENOSTS Function not implemented. 60 * - \c EINVAL File not found or permission denied. 61 * 62 * \param path The file path 63 * \param mode The file open mode 64 * \return A file handle to \e path. 65 */ 53 66 caca_file_t *caca_file_open(char const *path, const char *mode) 54 67 { … … 69 82 { 70 83 free(fp); 84 seterrno(EINVAL); 71 85 return NULL; 72 86 } … … 109 123 free(fp); 110 124 gzclose(fp->gz); 125 seterrno(EINVAL); 111 126 return NULL; 112 127 } … … 118 133 { 119 134 free(fp); 135 seterrno(EINVAL); 120 136 return NULL; 121 137 } … … 126 142 } 127 143 144 /** \brief Close a file handle 145 * 146 * Close and destroy the resources associated with a caca file handle. 147 * 148 * This function is a wrapper for fclose() or, if available, gzclose(). 149 * 150 * \param fp The file handle 151 * \return The return value of fclose() or gzclose(). 152 */ 128 153 int caca_file_close(caca_file_t *fp) 129 154 { … … 144 169 } 145 170 171 /** \brief Return the position in a file handle 172 * 173 * Return the file handle position, in bytes. 174 * 175 * \param fp The file handle 176 * \return The current offset in the file handle. 177 */ 146 178 uint64_t caca_file_tell(caca_file_t *fp) 147 179 { … … 158 190 } 159 191 192 /** \brief Read data from a file handle 193 * 194 * Read data from a file handle and copy them into the given buffer. 195 * 196 * \param fp The file handle 197 * \param ptr The destination buffer 198 * \param size The number of bytes to read 199 * \return The number of bytes read 200 */ 160 201 size_t caca_file_read(caca_file_t *fp, void *ptr, size_t size) 161 202 { … … 172 213 } 173 214 215 /** \brief Write data to a file handle 216 * 217 * Write the contents of the given buffer to the file handle. 218 * 219 * \param fp The file handle 220 * \param ptr The source buffer 221 * \param size The number of bytes to write 222 * \return The number of bytes written 223 */ 174 224 size_t caca_file_write(caca_file_t *fp, const void *ptr, size_t size) 175 225 { … … 195 245 } 196 246 247 /** \brief Read a line from a file handle 248 * 249 * Read one line of data from a file handle, up to one less than the given 250 * number of bytes. A trailing zero is appended to the data. 251 * 252 * \param fp The file handle 253 * \param s The destination buffer 254 * \param size The maximum number of bytes to read 255 * \return The number of bytes read, including the trailing zero 256 */ 197 257 char *caca_file_gets(caca_file_t *fp, char *s, int size) 198 258 { … … 229 289 } 230 290 291 /** \brief Tell whether a file handle reached end of file 292 * 293 * Return the end-of-file status of the file handle. 294 * 295 * This function is a wrapper for feof() or, if available, gzeof(). 296 * 297 * \param fp The file handle 298 * \return 1 if EOF was reached, 0 otherwise 299 */ 231 300 int caca_file_eof(caca_file_t *fp) 232 301 { -
libcaca/trunk/caca/string.c
r3595 r4318 326 326 * \param y Y coordinate. 327 327 * \param format The format string to print. 328 * \param a pA va_list containting the arguments to the format string.328 * \param args A va_list containting the arguments to the format string. 329 329 * \return The number of cells printed. 330 330 */ -
libcaca/trunk/win32/config.h
r4300 r4318 81 81 /* #undef USE_GL */ 82 82 /* #undef USE_IMLIB2 */ 83 /* #undef USE_KERNEL */ 83 84 /* #undef USE_NCURSES */ 84 85 /* #undef USE_PLUGINS */
Note: See TracChangeset
for help on using the changeset viewer.
