~ubuntu-branches/ubuntu/precise/libmtp/precise-proposed

« back to all changes in this revision

Viewing changes to examples/pathutils.c

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2009-12-14 22:32:10 UTC
  • mto: (16.1.3 sid) (0.2.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 24.
  • Revision ID: james.westby@ubuntu.com-20091214223210-vekc5340wzmz54bw
Tags: upstream-1.0.1
ImportĀ upstreamĀ versionĀ 1.0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
  return -1;
114
114
}
115
115
 
116
 
int progress (u_int64_t const sent, u_int64_t const total, void const * const data)
 
116
int progress (const uint64_t sent, const uint64_t total, void const * const data)
117
117
{
118
118
  int percent = (sent*100)/total;
119
119
#ifdef __WIN32__
132
132
  char *ptype;
133
133
  LIBMTP_filetype_t filetype;
134
134
 
 
135
#ifdef __WIN32__
 
136
  ptype = strrchr(filename, '.');
 
137
#else
135
138
  ptype = rindex(filename,'.');
 
139
#endif
136
140
  // This accounts for the case with a filename without any "." (period).
137
141
  if (!ptype) {
138
142
    ptype = "";
209
213
    filetype = LIBMTP_FILETYPE_JPX;
210
214
  } else if (!strcasecmp (ptype, "bin")) {
211
215
    filetype = LIBMTP_FILETYPE_FIRMWARE;
 
216
  } else if (!strcasecmp (ptype, "vcf")) {
 
217
    filetype = LIBMTP_FILETYPE_VCARD3;
212
218
  } else {
213
219
    /* Tagging as unknown file type */
214
220
    filetype = LIBMTP_FILETYPE_UNKNOWN;
215
221
  }
216
 
  printf("type:%s,%d\n",ptype,filetype);
 
222
  printf("type: %s, %d\n", ptype, filetype);
217
223
  return filetype;
218
224
}
219
225
 
230
236
  return ++p;
231
237
}
232
238
#endif
233