• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/ap/gpl/minidlna/flac-1.2.1/src/libFLAC/

Lines Matching defs:to

16  * contributors may be used to endorse or promote products derived from
53 * to <- NULL
55 * to <- copy of from
57 * malloc error leaves 'to' unchanged
59 static FLAC__bool copy_bytes_(FLAC__byte **to, const FLAC__byte *from, unsigned bytes)
61 FLAC__ASSERT(0 != to);
67 *to = x;
72 *to = 0;
78 /* like copy_bytes_(), but free()s the original '*to' if the copy succeeds and the original '*to' is non-NULL */
79 static FLAC__bool free_copy_bytes_(FLAC__byte **to, const FLAC__byte *from, unsigned bytes)
82 FLAC__ASSERT(0 != to);
84 if(*to)
85 free(*to);
86 *to = copy;
94 /* reallocate entry to 1 byte larger and add a terminating NUL */
108 /* copies the NUL-terminated C-string 'from' to '*to', leaving '*to'
109 * unchanged if malloc fails, free()ing the original '*to' if it
110 * succeeds and the original '*to' was not NULL
112 static FLAC__bool copy_cstring_(char **to, const char *from)
115 FLAC__ASSERT(to);
117 if(*to)
118 free(*to);
119 *to = copy;
126 static FLAC__bool copy_vcentry_(FLAC__StreamMetadata_VorbisComment_Entry *to, const FLAC__StreamMetadata_VorbisComment_Entry *from)
128 to->length = from->length;
131 to->entry = 0;
140 to->entry = x;
145 static FLAC__bool copy_track_(FLAC__StreamMetadata_CueSheet_Track *to, const FLAC__StreamMetadata_CueSheet_Track *from)
147 memcpy(to, from, sizeof(FLAC__StreamMetadata_CueSheet_Track));
157 to->indices = x;
268 /* we have to make sure that the string we're taking over is null-terminated */
500 /* now initialize mime_type and description with empty strings to make things easier on the client */
526 FLAC__StreamMetadata *to;
530 if(0 != (to = FLAC__metadata_object_new(object->type))) {
531 to->is_last = object->is_last;
532 to->type = object->type;
533 to->length = object->length;
534 switch(to->type) {
536 memcpy(&to->data.stream_info, &object->data.stream_info, sizeof(FLAC__StreamMetadata_StreamInfo));
541 if(to->length < FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8) { /* underflow check */
542 FLAC__metadata_object_delete(to);
545 memcpy(&to->data.application.id, &object->data.application.id, FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8);
546 if(!copy_bytes_(&to->data.application.data, object->data.application.data, object->length - FLAC__STREAM_METADATA_APPLICATION_ID_LEN / 8)) {
547 FLAC__metadata_object_delete(to);
552 to->data.seek_table.num_points = object->data.seek_table.num_points;
553 if(to->data.seek_table.num_points > SIZE_MAX / sizeof(FLAC__StreamMetadata_SeekPoint)) { /* overflow check */
554 FLAC__metadata_object_delete(to);
557 if(!copy_bytes_((FLAC__byte**)&to->data.seek_table.points, (FLAC__byte*)object->data.seek_table.points, object->data.seek_table.num_points * sizeof(FLAC__StreamMetadata_SeekPoint))) {
558 FLAC__metadata_object_delete(to);
563 if(0 != to->data.vorbis_comment.vendor_string.entry) {
564 free(to->data.vorbis_comment.vendor_string.entry);
565 to->data.vorbis_comment.vendor_string.entry = 0;
567 if(!copy_vcentry_(&to->data.vorbis_comment.vendor_string, &object->data.vorbis_comment.vendor_string)) {
568 FLAC__metadata_object_delete(to);
573 to->data.vorbis_comment.comments = 0;
577 to->data.vorbis_comment.comments = vorbiscomment_entry_array_copy_(object->data.vorbis_comment.comments, object->data.vorbis_comment.num_comments);
578 if(0 == to->data.vorbis_comment.comments) {
579 FLAC__metadata_object_delete(to);
583 to->data.vorbis_comment.num_comments = object->data.vorbis_comment.num_comments;
586 memcpy(&to->data.cue_sheet, &object->data.cue_sheet, sizeof(FLAC__StreamMetadata_CueSheet));
592 to->data.cue_sheet.tracks = cuesheet_track_array_copy_(object->data.cue_sheet.tracks, object->data.cue_sheet.num_tracks);
593 if(0 == to->data.cue_sheet.tracks) {
594 FLAC__metadata_object_delete(to);
600 to->data.picture.type = object->data.picture.type;
601 if(!copy_cstring_(&to->data.picture.mime_type, object->data.picture.mime_type)) {
602 FLAC__metadata_object_delete(to);
605 if(!copy_cstring_((char**)(&to->data.picture.description), (const char*)object->data.picture.description)) {
606 FLAC__metadata_object_delete(to);
609 to->data.picture.width = object->data.picture.width;
610 to->data.picture.height = object->data.picture.height;
611 to->data.picture.depth = object->data.picture.depth;
612 to->data.picture.colors = object->data.picture.colors;
613 to->data.picture.data_length = object->data.picture.data_length;
614 if(!copy_bytes_((&to->data.picture.data), object->data.picture.data, object->data.picture.data_length)) {
615 FLAC__metadata_object_delete(to);
620 if(!copy_bytes_(&to->data.unknown.data, object->data.unknown.data, object->length)) {
621 FLAC__metadata_object_delete(to);
628 return to;
958 /* if growing, set new elements to placeholders */
1420 /* must delete from end to start otherwise it will interfere with our iteration */
1438 FLAC__StreamMetadata_CueSheet_Track *to;
1442 if(0 != (to = FLAC__metadata_object_cuesheet_track_new())) {
1443 if(!copy_track_(to, object)) {
1444 FLAC__metadata_object_cuesheet_track_delete(to);
1449 return to;
1698 /*@@@@add to tests*/
1713 for (i = 0; i < (cs->num_tracks-1); i++) /* -1 to avoid counting the lead-out */