00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
#include <string.h>
00042
#include <stdlib.h>
00043
#include "idima.h"
00044
#include "idvol.h"
00045
#include "idsig.h"
00046
#include "idprint.h"
00047
#include "idseq.h"
00048
#include "idcnt.h"
00049
#include "idcnt3d.h"
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 char *
IdGetFileName(
void *obj)
00078 {
00079
if (obj)
00080
switch (
IdLibidoType(obj)) {
00081
case IMA:
00082
return (
_IdImaPrivate(obj)->_fichier);
00083
case VOL:
00084
return (
_IdVolPrivate(obj)->_fichier);
00085
case SIG:
00086
return (
_IdSigPrivate(obj)->_fichier);
00087
case CNT:
00088
return (
_IdCntPrivate(obj)->_fichier);
00089
case SEQ:
00090
return (
_IdSeqPrivate(obj)->_fichier);
00091
case CNT3D:
00092
return (
_IdCntPrivate(obj)->_fichier);
00093 }
00094
00095
return ((
char *) NULL);
00096 }
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126 int IdSetFileName(
void *obj,
char *nf)
00127 {
00128
if (obj)
00129
switch (
IdLibidoType(obj)) {
00130
case IMA:
00131
if (
_IdImaPrivate(obj)->_fichier)
00132 free((
_IdImaPrivate(obj)->_fichier));
00133
if (nf == 0)
00134
break;
00135
_IdImaPrivate(obj)->_fichier =
00136 (
char *) malloc(strlen(nf) + 1);
00137 strcpy(
_IdImaPrivate(obj)->_fichier, nf);
00138
return (1);
00139
00140
case VOL:
00141
if (
_IdVolPrivate(obj)->_fichier)
00142 free((
_IdVolPrivate(obj)->_fichier));
00143
if (nf == 0)
00144
break;
00145
_IdVolPrivate(obj)->_fichier =
00146 (
char *) malloc(strlen(nf) + 1);
00147 strcpy(
_IdVolPrivate(obj)->_fichier, nf);
00148
return (1);
00149
00150
case SIG:
00151
if (
_IdSigPrivate(obj)->_fichier)
00152 free((
_IdSigPrivate(obj)->_fichier));
00153
if (nf == 0)
00154
break;
00155
_IdSigPrivate(obj)->_fichier =
00156 (
char *) malloc(strlen(nf) + 1);
00157 strcpy(
_IdSigPrivate(obj)->_fichier, nf);
00158
return (1);
00159
00160
case CNT:
00161
if (
_IdCntPrivate(obj)->_fichier)
00162 free((
_IdCntPrivate(obj)->_fichier));
00163
if (nf == 0)
00164
break;
00165
_IdCntPrivate(obj)->_fichier =
00166 (
char *) malloc(strlen(nf) + 1);
00167 strcpy(
_IdCntPrivate(obj)->_fichier, nf);
00168
return (1);
00169
00170
case CNT3D:
00171
if (
_IdCnt3DPrivate(obj)->_fichier)
00172 free((
_IdCnt3DPrivate(obj)->_fichier));
00173
if (nf == 0)
00174
break;
00175
_IdCnt3DPrivate(obj)->_fichier =
00176 (
char *) malloc(strlen(nf) + 1);
00177 strcpy(
_IdCnt3DPrivate(obj)->_fichier, nf);
00178
return (1);
00179
00180
case SEQ:
00181
if (
_IdSeqPrivate(obj)->_fichier)
00182 free((
_IdSeqPrivate(obj)->_fichier));
00183
if (nf == 0)
00184
break;
00185
_IdSeqPrivate(obj)->_fichier =
00186 (
char *) malloc(strlen(nf) + 1);
00187 strcpy(
_IdSeqPrivate(obj)->_fichier, nf);
00188
return (1);
00189 }
00190
return (0);
00191 }
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219 char *
IdGetMessage(
void *obj)
00220 {
00221
if (obj)
00222
switch (
IdLibidoType(obj)) {
00223
case IMA:
00224
return (
_IdImaPrivate(obj)->_message);
00225
case VOL:
00226
return (
_IdVolPrivate(obj)->_message);
00227
case SIG:
00228
return (
_IdSigPrivate(obj)->_message);
00229
case SEQ:
00230
return (
_IdSeqPrivate(obj)->_message);
00231
case CNT:
00232
return (
_IdCntPrivate(obj)->_message);
00233
case CNT3D:
00234
return (
_IdCnt3DPrivate(obj)->_message);
00235
default:
00236
00237
return((
char *)NULL);
00238 }
00239
00240
return (0);
00241 }
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271 int IdSetMessage(
void *obj,
char *nf)
00272 {
00273
if (obj)
00274
switch (
IdLibidoType(obj)) {
00275
case IMA:
00276
if (
_IdImaPrivate(obj)->_message)
00277 free((
_IdImaPrivate(obj)->_message));
00278
if (nf == 0)
00279
break;
00280
_IdImaPrivate(obj)->_message =
00281 (
char *) malloc(strlen(nf) + 1);
00282 strcpy(
_IdImaPrivate(obj)->_message, nf);
00283
return (1);
00284
case VOL:
00285
if (
_IdVolPrivate(obj)->_message)
00286 free((
_IdVolPrivate(obj)->_message));
00287
if (nf == 0)
00288
break;
00289
_IdVolPrivate(obj)->_message =
00290 (
char *) malloc(strlen(nf) + 1);
00291 strcpy(
_IdVolPrivate(obj)->_message, nf);
00292
return (1);
00293
case SIG:
00294
if (
_IdSigPrivate(obj)->_message)
00295 free((
_IdSigPrivate(obj)->_message));
00296
if (nf == 0)
00297
break;
00298
_IdSigPrivate(obj)->_message =
00299 (
char *) malloc(strlen(nf) + 1);
00300 strcpy(
_IdSigPrivate(obj)->_message, nf);
00301
return (1);
00302
case SEQ:
00303
if (
_IdSeqPrivate(obj)->_message)
00304 free((
_IdSeqPrivate(obj)->_message));
00305
if (nf == 0)
00306
break;
00307
_IdSeqPrivate(obj)->_message =
00308 (
char *) malloc(strlen(nf) + 1);
00309 strcpy(
_IdSeqPrivate(obj)->_message, nf);
00310
return (1);
00311
case CNT:
00312
if (
_IdCntPrivate(obj)->_message)
00313 free((
_IdCntPrivate(obj)->_message));
00314
if (nf == 0)
00315
break;
00316
_IdCntPrivate(obj)->_message =
00317 (
char *) malloc(strlen(nf) + 1);
00318 strcpy(
_IdCntPrivate(obj)->_message, nf);
00319
return (1);
00320
case CNT3D:
00321
if (
_IdCnt3DPrivate(obj)->_message)
00322 free((
_IdCnt3DPrivate(obj)->_message));
00323
if (nf == 0)
00324
break;
00325
_IdCnt3DPrivate(obj)->_message =
00326 (
char *) malloc(strlen(nf) + 1);
00327 strcpy(
_IdCnt3DPrivate(obj)->_message, nf);
00328
return (1);
00329
00330
00331 }
00332
return (0);
00333 }