Revision 1843 trunk/plugins/decoder/decoder.c
| decoder.c (revision 1843) | ||
|---|---|---|
| 36 | 36 | 
                  int decode(const char *inname, const char *forced_outname, struct decoded_file **decoded_list, int *saved_errno, char **errmsg);  | 
              
| 37 | 37 | 
                   | 
              
| 38 | 38 | 
                  static NNTPGrabDecoderRes  | 
              
| 39 | 
                  nntpgrab_plugin_decoder_decode_file(NGPlugin *plugin_data, const char *collection_name, NNTPFile *file, const char *temp_directory, const char *target_directory, int *saved_errno, char **errmsg);  | 
              |
| 39 | 
                  nntpgrab_plugin_decoder_decode_file(NGPlugin *plugin_data, const char *collection_name, NNTPFile *file, const char *temp_directory, const char *target_directory, char **real_filename, int *saved_errno, char **errmsg);  | 
              |
| 40 | 40 | 
                   | 
              
| 41 | 41 | 
                  void  | 
              
| 42 | 42 | 
                  nntpgrab_plugin_initialize(NGPlugin *plugin_data)  | 
              
| ... | ... | |
| 50 | 50 | 
                  ng_plugin_register_function(plugin_data,  | 
              
| 51 | 51 | 
                  "decode_file",  | 
              
| 52 | 52 | 
                  NG_PLUGIN_FUNCTION(nntpgrab_plugin_decoder_decode_file),  | 
              
| 53 | 
                  ng_plugin_marshal_INT__STRING_POINTER_STRING_STRING_POINTER_POINTER,  | 
              |
| 53 | 
                  ng_plugin_marshal_INT__STRING_POINTER_STRING_STRING_POINTER_POINTER_POINTER,  | 
              |
| 54 | 54 | 
                  G_TYPE_INT,  | 
              
| 55 | 
                  6, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_STRING,  | 
              |
| 56 | 
                  G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_POINTER);  | 
              |
| 55 | 
                  7, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_STRING,  | 
              |
| 56 | 
                  G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_POINTER);  | 
              |
| 57 | 57 | 
                  }  | 
              
| 58 | 58 | 
                   | 
              
| 59 | 59 | 
                  ngboolean  | 
              
| ... | ... | |
| 761 | 761 | 
                  }  | 
              
| 762 | 762 | 
                   | 
              
| 763 | 763 | 
                  static NNTPGrabDecoderRes  | 
              
| 764 | 
                  nntpgrab_plugin_decoder_decode_file(NGPlugin *plugin_data, const char *collection_name, NNTPFile *file, const char *temp_directory, const char *target_directory, int *saved_errno, char **errmsg)  | 
              |
| 764 | 
                  nntpgrab_plugin_decoder_decode_file(NGPlugin *plugin_data, const char *collection_name, NNTPFile *file, const char *temp_directory, const char *target_directory, char **real_filename, int *saved_errno, char **errmsg)  | 
              |
| 765 | 765 | 
                  {
                 | 
              
| 766 | 766 | 
                  int i;  | 
              
| 767 | 767 | 
                  #if 0  | 
              
| ... | ... | |
| 784 | 784 | 
                  g_return_val_if_fail(file != NULL, DECODER_RESULT_ERROR);  | 
              
| 785 | 785 | 
                  g_return_val_if_fail(temp_directory != NULL, DECODER_RESULT_ERROR);  | 
              
| 786 | 786 | 
                  g_return_val_if_fail(target_directory != NULL, DECODER_RESULT_ERROR);  | 
              
| 787 | 
                  g_return_val_if_fail(real_filename != NULL, DECODER_RESULT_ERROR);  | 
              |
| 787 | 788 | 
                  g_return_val_if_fail(saved_errno != NULL, DECODER_RESULT_ERROR);  | 
              
| 788 | 789 | 
                   | 
              
| 789 | 790 | 
                  *saved_errno = 0;  | 
              
| ... | ... | |
| 834 | 835 | 
                  g_print("prev_real_filename_out = %s\n", prev_real_filename_out);
                 | 
              
| 835 | 836 | 
                  g_print("ret = %i\n", ret);
                 | 
              
| 836 | 837 | 
                  #endif  | 
              
| 837 | 
                  strncpy((char*) file->real_filename, prev_real_filename_out, sizeof(file->real_filename) - 1);  | 
              |
| 838 | 
                  *real_filename = g_strdup(prev_real_filename_out);  | 
              |
| 838 | 839 | 
                  new_decoder_used = TRUE;  | 
              
| 839 | 840 | 
                              if (ret == DECODER_RESULT_ERROR) {
                 | 
              
| 840 | 841 | 
                                  g_print("Error during decode\n");
                 | 
              
| ... | ... | |
| 907 | 908 | 
                  }  | 
              
| 908 | 909 | 
                      } else {
                 | 
              
| 909 | 910 | 
                          if (decoded_list) {
                 | 
              
| 910 | 
                  strncpy((char*) file->real_filename, decoded_list->outname, sizeof(file->real_filename) - 1);  | 
              |
| 911 | 
                  *real_filename = g_strdup(decoded_list->outname);  | 
              |
| 911 | 912 | 
                              for(i = 0; i < decoded_list->total_parts; i++) {
                 | 
              
| 912 | 913 | 
                                  switch(decoded_list->status[i]) {
                 | 
              
| 913 | 914 | 
                  case part_missing:  | 
              
Also available in: Unified diff
NNTPGrab

