Back to index

im-sdk  12.3.91
comp-file-operation-reply.c
Go to the documentation of this file.
00001 #include <stdio.h>
00002 #include <stdlib.h>
00003 #include <sys/types.h>
00004 
00005 #include <iiimp-data.h>
00006 #include <iiimp-opcode.h>
00007 
00008 #include "iiimp-dataP.h"
00009 
00010 IIIMP_open_reply *
00011 iiimp_open_reply_new(
00012     IIIMP_data_s *           data_s,
00013     IIIMP_card32                ns_id,
00014     IIIMP_card32                ns_errno)
00015 {
00016     IIIMP_open_reply *      data;
00017 
00018     data = (IIIMP_open_reply *) malloc(sizeof(IIIMP_open_reply));
00019     if (NULL == data) {
00020        data_s->status = IIIMP_DATA_MALLOC_ERROR;
00021        return NULL;
00022     }
00023 
00024     data->nbyte = 4 + 4 + 4;
00025     data->ns_id = ns_id;
00026     data->ns_errno = ns_errno;
00027 
00028     return data;
00029 }
00030 
00031 IIIMP_read_reply *
00032 iiimp_read_reply_new(
00033     IIIMP_data_s *   data_s,
00034     IIIMP_card32        ns_id,
00035     IIIMP_card32        size,
00036     IIIMP_card32        ns_errno,
00037     IIIMP_card32 *      object)
00038 {
00039     IIIMP_read_reply *        data;
00040  
00041     data = (IIIMP_read_reply *) malloc(sizeof(IIIMP_read_reply));
00042     if (NULL == data) {
00043        data_s->status = IIIMP_DATA_MALLOC_ERROR;
00044        return NULL;
00045     }
00046 
00047     data->nbyte = 4 + 4 + 4 + 4 + size + PAD(size);
00048     data->ns_id = ns_id;
00049     data->size = size;
00050     data->ns_errno = ns_errno;
00051     data->object = object;
00052 
00053     return data;
00054 }
00055 
00056 IIIMP_write_reply *
00057 iiimp_write_reply_new(
00058     IIIMP_data_s *   data_s,
00059     IIIMP_card32        ns_id,
00060     IIIMP_card32        size,
00061     IIIMP_card32        ns_errno)
00062 {
00063     IIIMP_write_reply *     data;
00064 
00065     data = (IIIMP_write_reply *)malloc(sizeof (IIIMP_write_reply));
00066     if (NULL == data) {
00067        data_s->status = IIIMP_DATA_MALLOC_ERROR;
00068        return NULL;
00069     }
00070     data->nbyte = 4 + 4 + 4 + 4;
00071     data->ns_id = ns_id;
00072     data->size = size;
00073     data->ns_errno = ns_errno;
00074 
00075     return data;
00076 }
00077 
00078 IIIMP_close_reply *
00079 iiimp_close_reply_new(
00080     IIIMP_data_s *   data_s,
00081     IIIMP_card32        ns_id,
00082     IIIMP_card32        ns_errno)
00083 {
00084     IIIMP_close_reply *     data;
00085 
00086     data = (IIIMP_close_reply *)malloc(sizeof (IIIMP_close_reply));
00087     if (NULL == data) {
00088        data_s->status = IIIMP_DATA_MALLOC_ERROR;
00089        return NULL;
00090     }
00091     data->nbyte = 4 + 4 + 4;
00092     data->ns_id = ns_id;
00093     data->ns_errno = ns_errno;
00094 
00095     return data;
00096 }
00097 
00098 IIIMP_seek_reply *
00099 iiimp_seek_reply_new(
00100     IIIMP_data_s *      data_s,
00101     IIIMP_card32        ns_id,
00102     IIIMP_card32        ns_errno,
00103     IIIMP_card32        offset)
00104 {
00105     IIIMP_seek_reply *     data;
00106 
00107     data = (IIIMP_seek_reply *)malloc(sizeof (IIIMP_seek_reply));
00108     if (NULL == data) {
00109         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00110         return NULL;
00111     }
00112     data->nbyte = 4 + 4 + 4 + 4;
00113     data->ns_id = ns_id;
00114     data->ns_errno = ns_errno;
00115     data->offset = offset;
00116 
00117     return data;
00118 }
00119 
00120 IIIMP_opendir_reply *
00121 iiimp_opendir_reply_new(
00122     IIIMP_data_s *      data_s,
00123     IIIMP_card32        ns_id,
00124     IIIMP_card32        ns_errno,
00125     IIIMP_card32        nitems,
00126     IIIMP_utf8string *  d_name)
00127 {
00128     IIIMP_opendir_reply *     data;
00129     IIIMP_utf8string *        pu8;
00130     size_t                    nbyte;
00131 
00132     data = (IIIMP_opendir_reply *)malloc(sizeof (IIIMP_opendir_reply));
00133     if (NULL == data) {
00134         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00135         return NULL;
00136     }
00137 
00138     if (d_name) {
00139        for (nbyte = 0, pu8 = d_name; NULL != pu8; pu8 = pu8->next) {
00140            nbyte += pu8->nbyte;
00141        }
00142     }
00143     data->nbyte = 4 + 4 + 4 + 4 + nbyte;
00144     data->ns_id = ns_id;
00145     data->ns_errno = ns_errno;
00146     data->nitems = nitems;
00147     data->d_name = d_name;
00148 
00149     return data;
00150 }
00151 
00152 IIIMP_closedir_reply *
00153 iiimp_closedir_reply_new(
00154     IIIMP_data_s *      data_s,
00155     IIIMP_card32        ns_id,
00156     IIIMP_card32        ns_errno)
00157 {
00158     IIIMP_closedir_reply *     data;
00159     data = (IIIMP_closedir_reply *)malloc(sizeof (IIIMP_closedir_reply));
00160     if (NULL == data) {
00161         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00162         return NULL;
00163     }
00164     data->nbyte = 4 + 4 + 4;
00165     data->ns_id = ns_id;
00166     data->ns_errno = ns_errno;
00167 
00168     return data;
00169 }
00170 
00171 IIIMP_mkdir_reply *
00172 iiimp_mkdir_reply_new(
00173     IIIMP_data_s *      data_s,
00174     IIIMP_card32        ns_id,
00175     IIIMP_card32        ns_errno)
00176 {
00177     IIIMP_mkdir_reply *     data;
00178 
00179     data = (IIIMP_mkdir_reply *)malloc(sizeof (IIIMP_mkdir_reply));
00180     if (NULL == data) {
00181         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00182         return NULL;
00183     }
00184 
00185     data->nbyte = 4 + 4 + 4;
00186     data->ns_id = ns_id;
00187     data->ns_errno = ns_errno;
00188 
00189     return data;
00190 }
00191 
00192 IIIMP_rmdir_reply *
00193 iiimp_rmdir_reply_new(
00194     IIIMP_data_s *      data_s,
00195     IIIMP_card32        ns_id,
00196     IIIMP_card32        ns_errno)
00197 {
00198     IIIMP_rmdir_reply *     data;
00199 
00200     data = (IIIMP_rmdir_reply *)malloc(sizeof (IIIMP_rmdir_reply));
00201     if (NULL == data) {
00202         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00203         return NULL;
00204     }
00205 
00206     data->nbyte = 4 + 4 + 4;
00207     data->ns_id = ns_id;
00208     data->ns_errno = ns_errno;
00209 
00210     return data;
00211 }
00212 
00213 IIIMP_symlink_reply *
00214 iiimp_symlink_reply_new(
00215     IIIMP_data_s *      data_s,
00216     IIIMP_card32        ns_id,
00217     IIIMP_card32        ns_errno)
00218 {
00219     IIIMP_symlink_reply *     data;
00220 
00221     data = (IIIMP_symlink_reply *)malloc(sizeof (IIIMP_symlink_reply));
00222     if (NULL == data) {
00223         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00224         return NULL;
00225     }
00226 
00227     data->nbyte = 4 + 4 + 4;
00228     data->ns_id = ns_id;
00229     data->ns_errno = ns_errno;
00230 
00231     return data;
00232 }
00233 
00234 IIIMP_stat_reply *
00235 iiimp_stat_reply_new(
00236     IIIMP_data_s *      data_s,
00237     IIIMP_card32        ns_id,
00238     IIIMP_card32        ns_errno,
00239     iiimp_stat_struct * stat_buf)
00240 {
00241     IIIMP_stat_reply *     data;
00242 
00243     data = (IIIMP_stat_reply *)malloc(sizeof (IIIMP_stat_reply));
00244     if (NULL == data) {
00245         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00246         return NULL;
00247     }
00248     data->nbyte = 4 + 4 + 4 + sizeof(iiimp_stat_struct);
00249     data->ns_id = ns_id;
00250     data->ns_errno = ns_errno;
00251     data->stat_buf = stat_buf;
00252 
00253     return data;
00254 }
00255 
00256 IIIMP_lstat_reply *
00257 iiimp_lstat_reply_new(
00258     IIIMP_data_s *      data_s,
00259     IIIMP_card32        ns_id,
00260     IIIMP_card32        ns_errno,
00261     iiimp_stat_struct * stat_buf)
00262 {
00263     IIIMP_lstat_reply *     data;
00264 
00265     data = (IIIMP_lstat_reply *)malloc(sizeof (IIIMP_lstat_reply));
00266     if (NULL == data) {
00267         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00268         return NULL;
00269     }
00270     data->nbyte = 4 + 4 + 4 + sizeof(iiimp_stat_struct);
00271     data->ns_id = ns_id;
00272     data->ns_errno = ns_errno;
00273     data->stat_buf = stat_buf;
00274 
00275     return data;
00276 }
00277 
00278 IIIMP_fstat_reply *
00279 iiimp_fstat_reply_new(
00280     IIIMP_data_s *      data_s,
00281     IIIMP_card32        ns_id,
00282     IIIMP_card32        ns_errno,
00283     iiimp_stat_struct * stat_buf)
00284 {
00285     IIIMP_fstat_reply *     data;
00286 
00287     data = (IIIMP_fstat_reply *)malloc(sizeof (IIIMP_fstat_reply));
00288     if (NULL == data) {
00289         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00290         return NULL;
00291     }
00292 
00293     data->nbyte = 4 + 4 + 4 + sizeof(iiimp_stat_struct);
00294     data->ns_id = ns_id;
00295     data->ns_errno = ns_errno;
00296     data->stat_buf = stat_buf;
00297 
00298     return data;
00299 }
00300 
00301 IIIMP_creat_reply *
00302 iiimp_creat_reply_new(
00303     IIIMP_data_s *      data_s,
00304     IIIMP_card32        ns_id,
00305     IIIMP_card32        ns_errno)
00306 {
00307     IIIMP_creat_reply *     data;
00308 
00309     data = (IIIMP_creat_reply *)malloc(sizeof (IIIMP_creat_reply));
00310     if (NULL == data) {
00311         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00312         return NULL;
00313     }
00314 
00315     data->nbyte = 4 + 4 + 4;
00316     data->ns_id = ns_id;
00317     data->ns_errno = ns_errno;
00318 
00319     return data;
00320 }
00321 
00322 IIIMP_lseek_reply *
00323 iiimp_lseek_reply_new(
00324     IIIMP_data_s *      data_s,
00325     IIIMP_card32        ns_id,
00326     IIIMP_card32        ns_errno,
00327     IIIMP_card32        offset)
00328 {
00329     IIIMP_lseek_reply *     data;
00330 
00331     data = (IIIMP_lseek_reply *)malloc(sizeof (IIIMP_lseek_reply));
00332     if (NULL == data) {
00333         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00334         return NULL;
00335     }
00336 
00337     data->nbyte = 4 + 4 + 4 + 4;
00338     data->ns_id = ns_id;
00339     data->ns_errno = ns_errno;
00340     data->offset = offset;
00341 
00342     return data;
00343 }
00344 
00345 IIIMP_unlink_reply *
00346 iiimp_unlink_reply_new(
00347     IIIMP_data_s *      data_s,
00348     IIIMP_card32        ns_id,
00349     IIIMP_card32        ns_errno)
00350 {
00351     IIIMP_unlink_reply *     data;
00352 
00353     data = (IIIMP_unlink_reply *)malloc(sizeof (IIIMP_unlink_reply));
00354     if (NULL == data) {
00355         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00356         return NULL;
00357     }
00358 
00359     data->nbyte = 4 + 4 + 4;
00360     data->ns_id = ns_id;
00361     data->ns_errno = ns_errno;
00362 
00363     return data;
00364 }
00365 
00366 IIIMP_rename_reply *
00367 iiimp_rename_reply_new(
00368     IIIMP_data_s *      data_s,
00369     IIIMP_card32        ns_id,
00370     IIIMP_card32        ns_errno)
00371 {
00372     IIIMP_rename_reply *     data;
00373 
00374     data = (IIIMP_rename_reply *)malloc(sizeof (IIIMP_rename_reply));
00375     if (NULL == data) {
00376         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00377         return NULL;
00378     }
00379 
00380     data->nbyte = 4 + 4 + 4;
00381     data->ns_id = ns_id;
00382     data->ns_errno = ns_errno;
00383 
00384     return data;
00385 }
00386 
00387 IIIMP_fcntl_reply *
00388 iiimp_fcntl_reply_new(
00389     IIIMP_data_s *      data_s,
00390     IIIMP_card32        ns_id,
00391     IIIMP_card32        ns_errno,
00392     IIIMP_card32        return_value)
00393 {
00394     IIIMP_fcntl_reply *     data;
00395 
00396     data = (IIIMP_fcntl_reply *)malloc(sizeof (IIIMP_fcntl_reply));
00397     if (NULL == data) {
00398         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00399         return NULL;
00400     }
00401 
00402     data->nbyte = 4 + 4 + 4 + 4;
00403     data->ns_id = ns_id;
00404     data->ns_errno = ns_errno;
00405     data->return_value = return_value;
00406 
00407     return data;
00408 }
00409 
00410 IIIMP_truncate_reply *
00411 iiimp_truncate_reply_new(
00412     IIIMP_data_s *      data_s,
00413     IIIMP_card32        ns_id,
00414     IIIMP_card32        ns_errno)
00415 {
00416     IIIMP_truncate_reply *     data;
00417 
00418     data = (IIIMP_truncate_reply *)malloc(sizeof (IIIMP_truncate_reply));
00419     if (NULL == data) {
00420         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00421         return NULL;
00422     }
00423 
00424     data->nbyte = 4 + 4 + 4;
00425     data->ns_id = ns_id;
00426     data->ns_errno = ns_errno;
00427 
00428     return data;
00429 }
00430 
00431 IIIMP_ftruncate_reply *
00432 iiimp_ftruncate_reply_new(
00433     IIIMP_data_s *      data_s,
00434     IIIMP_card32        ns_id,
00435     IIIMP_card32        ns_errno)
00436 {
00437     IIIMP_ftruncate_reply *     data;
00438     data = (IIIMP_ftruncate_reply *)malloc(sizeof (IIIMP_ftruncate_reply));
00439     if (NULL == data) {
00440         data_s->status = IIIMP_DATA_MALLOC_ERROR;
00441         return NULL;
00442     }
00443 
00444     data->nbyte = 4 + 4 + 4;
00445     data->ns_id = ns_id;
00446     data->ns_errno = ns_errno;
00447 
00448     return data;
00449 }
00450 
00451 void
00452 iiimp_open_reply_delete(IIIMP_data_s * data_s, IIIMP_open_reply *m)
00453 {
00454     if (NULL == m) return;
00455     free(m);
00456     return;
00457 }
00458 
00459 void
00460 iiimp_read_reply_delete(IIIMP_data_s * data_s, IIIMP_read_reply * m)
00461 {
00462     if (NULL == m) return;
00463     free(m);
00464     return;
00465 }
00466 
00467 void
00468 iiimp_write_reply_delete(IIIMP_data_s * data_s, IIIMP_write_reply * m)
00469 {
00470     if (NULL == m) return;
00471     free(m);
00472     return;
00473 }
00474 
00475 void
00476 iiimp_close_reply_delete(IIIMP_data_s * data_s, IIIMP_close_reply * m)
00477 {
00478     if (NULL == m) return;
00479     free(m);
00480     return;
00481 }
00482 
00483 void
00484 iiimp_seek_reply_delete(IIIMP_data_s * data_s, IIIMP_seek_reply * m)
00485 {
00486     if (NULL == m) return;
00487     free(m);
00488     return;
00489 }
00490 
00491 void
00492 iiimp_opendir_reply_delete(IIIMP_data_s * data_s, IIIMP_opendir_reply * m)
00493 {
00494     if (NULL == m) return;
00495     iiimp_utf8string_list_delete(data_s, m->d_name);
00496     free(m);
00497     return;
00498 }
00499 
00500 void
00501 iiimp_closedir_reply_delete(IIIMP_data_s * data_s, IIIMP_closedir_reply * m)
00502 {
00503     if (NULL == m) return;
00504     free(m);
00505     return;
00506 }
00507 
00508 void
00509 iiimp_mkdir_reply_delete(IIIMP_data_s * data_s, IIIMP_mkdir_reply * m)
00510 {
00511     if (NULL == m) return;
00512     free(m);
00513     return;
00514 }
00515 
00516 void
00517 iiimp_rmdir_reply_delete(IIIMP_data_s * data_s, IIIMP_rmdir_reply * m)
00518 {
00519     if (NULL == m) return;
00520     free(m);
00521     return;
00522 }
00523 
00524 void
00525 iiimp_symlink_reply_delete(IIIMP_data_s * data_s, IIIMP_symlink_reply * m)
00526 {
00527     if (NULL == m) return;
00528     free(m);
00529     return;
00530 }
00531 
00532 void
00533 iiimp_stat_reply_delete(IIIMP_data_s * data_s, IIIMP_stat_reply * m)
00534 {
00535     if (NULL == m) return;
00536     free(m);
00537     return;
00538 }
00539 
00540 void
00541 iiimp_fstat_reply_delete(IIIMP_data_s * data_s, IIIMP_fstat_reply * m)
00542 {
00543     if (NULL == m) return;
00544     free(m);
00545     return;
00546 }
00547 
00548 
00549 void
00550 iiimp_lstat_reply_delete(IIIMP_data_s * data_s, IIIMP_lstat_reply * m)
00551 {
00552     if (NULL == m) return;
00553     free(m);
00554     return;
00555 }
00556 
00557 void
00558 iiimp_creat_reply_delete(IIIMP_data_s * data_s, IIIMP_creat_reply * m)
00559 {
00560     if (NULL == m) return;
00561     free(m);
00562     return;
00563 }
00564 
00565 void
00566 iiimp_lseek_reply_delete(IIIMP_data_s * data_s, IIIMP_lseek_reply * m)
00567 {
00568     if (NULL == m) return;
00569     free(m);
00570     return;
00571 }
00572 
00573 void
00574 iiimp_unlink_reply_delete(IIIMP_data_s * data_s, IIIMP_unlink_reply * m)
00575 {
00576     if (NULL == m) return;
00577     free(m);
00578     return;
00579 }
00580 
00581 void
00582 iiimp_rename_reply_delete(IIIMP_data_s * data_s, IIIMP_rename_reply * m)
00583 {
00584     if (NULL == m) return;
00585     free(m);
00586     return;
00587 }
00588 
00589 void
00590 iiimp_fcntl_reply_delete(IIIMP_data_s * data_s, IIIMP_fcntl_reply * m)
00591 {
00592     if (NULL == m) return;
00593     free(m);
00594     return;
00595 }
00596 
00597 void
00598 iiimp_truncate_reply_delete(IIIMP_data_s * data_s, IIIMP_truncate_reply * m)
00599 {
00600     if (NULL == m) return;
00601     free(m);
00602     return;
00603 }
00604 
00605 void
00606 iiimp_ftruncate_reply_delete(IIIMP_data_s * data_s, IIIMP_ftruncate_reply * m)
00607 {
00608     if (NULL == m) return;
00609     free(m);
00610     return;
00611 }
00612 
00613 void
00614 iiimp_open_reply_pack(
00615     IIIMP_data_s *   data_s,
00616     IIIMP_open_reply *        m,
00617     size_t *            nbyte,
00618     uchar_t **          ptr)
00619 {
00620     size_t           rest;
00621     uchar_t *        p;
00622 
00623     rest = *nbyte;
00624     p = *ptr;
00625 
00626     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
00627     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
00628     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
00629 
00630     *nbyte = rest;
00631     *ptr = p;
00632 
00633     return;
00634 }
00635 
00636 void
00637 iiimp_read_reply_pack(
00638     IIIMP_data_s *   data_s,
00639     IIIMP_read_reply *  m,
00640     size_t *            nbyte,
00641     uchar_t **          ptr)
00642 {
00643     size_t           rest;
00644     uchar_t *        p;
00645     int                 i, count, object_size;
00646     IIIMP_card32 *      buf;
00647 
00648     object_size = m->size + PAD((m->size) % 4);
00649     count = (object_size / 4);
00650 
00651     rest = *nbyte;
00652     p = *ptr;
00653 
00654     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
00655     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
00656     PUTU32(m->size, rest, p, data_s->byte_swap);
00657     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
00658 
00659     buf = (IIIMP_card32 *)m->object;
00660     for (i=0; i<count; i++) {
00661        PUTU32(*(buf + i), rest, p, data_s->byte_swap); 
00662     }
00663 
00664     *nbyte = rest;
00665     *ptr = p;
00666 
00667     return;
00668 }
00669 
00670 void
00671 iiimp_write_reply_pack(
00672     IIIMP_data_s *   data_s,
00673     IIIMP_write_reply *       m,
00674     size_t *            nbyte,
00675     uchar_t **          ptr)
00676 {
00677     size_t           rest;
00678     uchar_t *        p;
00679 
00680     rest = *nbyte;
00681     p = *ptr;
00682 
00683     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
00684     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
00685     PUTU32(m->size, rest, p, data_s->byte_swap);
00686     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
00687 
00688     *nbyte = rest;
00689     *ptr = p;
00690 
00691     return;
00692 }
00693 
00694 void
00695 iiimp_close_reply_pack(
00696     IIIMP_data_s *   data_s,
00697     IIIMP_close_reply *       m,
00698     size_t *            nbyte,
00699     uchar_t **          ptr)
00700 {
00701     size_t           rest;
00702     uchar_t *        p;
00703 
00704     rest = *nbyte;
00705     p = *ptr;
00706 
00707     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
00708     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
00709     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
00710 
00711     *nbyte = rest;
00712     *ptr = p;
00713 
00714     return;
00715 }
00716 
00717 void
00718 iiimp_seek_reply_pack(
00719     IIIMP_data_s *      data_s,
00720     IIIMP_seek_reply *  m,
00721     size_t *            nbyte,
00722     uchar_t **          ptr)
00723 {
00724     size_t              rest;
00725     uchar_t *           p;
00726 
00727     rest = *nbyte;
00728     p = *ptr;
00729 
00730     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
00731     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
00732     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
00733     PUTU32(m->offset, rest, p, data_s->byte_swap);
00734 
00735     *nbyte = rest;
00736     *ptr = p;
00737 
00738     return;
00739 }
00740 
00741 void
00742 iiimp_opendir_reply_pack(
00743     IIIMP_data_s *         data_s,
00744     IIIMP_opendir_reply *  m,
00745     size_t *               nbyte,
00746     uchar_t **             ptr)
00747 {
00748     size_t              rest;
00749     uchar_t *           p;
00750 
00751     rest = *nbyte;
00752     p = *ptr;
00753 
00754     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
00755     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
00756     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
00757     PUTU32(m->nitems, rest, p, data_s->byte_swap);
00758     iiimp_utf8string_list_pack(data_s, m->d_name, &rest, &p);
00759 
00760     *nbyte = rest;
00761     *ptr = p;
00762 
00763     return;
00764 }
00765 
00766 void
00767 iiimp_closedir_reply_pack(
00768     IIIMP_data_s *          data_s,
00769     IIIMP_closedir_reply *  m,
00770     size_t *                nbyte,
00771     uchar_t **              ptr)
00772 {
00773     size_t              rest;
00774     uchar_t *           p;
00775 
00776     rest = *nbyte;
00777     p = *ptr;
00778 
00779     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
00780     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
00781     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
00782 
00783     *nbyte = rest;
00784     *ptr = p;
00785     
00786     return;
00787 }   
00788 
00789 void
00790 iiimp_mkdir_reply_pack(
00791     IIIMP_data_s *        data_s,
00792     IIIMP_mkdir_reply *   m,
00793     size_t *              nbyte,
00794     uchar_t **            ptr)
00795 {
00796     size_t              rest;
00797     uchar_t *           p;
00798 
00799     rest = *nbyte;
00800     p = *ptr;
00801 
00802     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
00803     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
00804     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
00805 
00806     *nbyte = rest;
00807     *ptr = p;
00808     
00809     return;
00810 }   
00811 
00812 void
00813 iiimp_rmdir_reply_pack(
00814     IIIMP_data_s *       data_s,
00815     IIIMP_rmdir_reply *  m,
00816     size_t *             nbyte,
00817     uchar_t **           ptr)
00818 {
00819     size_t              rest;
00820     uchar_t *           p;
00821 
00822     rest = *nbyte;
00823     p = *ptr;
00824 
00825     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
00826     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
00827     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
00828 
00829     *nbyte = rest;
00830     *ptr = p;
00831     
00832     return;
00833 }   
00834 
00835 void
00836 iiimp_symlink_reply_pack(
00837     IIIMP_data_s *         data_s,
00838     IIIMP_symlink_reply *  m,
00839     size_t *               nbyte,
00840     uchar_t **             ptr)
00841 {
00842     size_t              rest;
00843     uchar_t *           p;
00844 
00845     rest = *nbyte;
00846     p = *ptr;
00847 
00848     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
00849     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
00850     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
00851 
00852     *nbyte = rest;
00853     *ptr = p;
00854     
00855     return;
00856 }   
00857 
00858 void
00859 iiimp_stat_reply_pack(
00860     IIIMP_data_s *       data_s,
00861     IIIMP_stat_reply *   m,
00862     size_t *             nbyte,
00863     uchar_t **           ptr)
00864 {
00865     size_t              rest;
00866     uchar_t *           p;
00867 
00868     rest = *nbyte;
00869     p = *ptr;
00870 
00871     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
00872     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
00873     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
00874 
00875     if (m->ns_id > 0) {
00876        PUTU32(m->stat_buf->s_mode, rest, p, data_s->byte_swap);
00877        PUTU32(m->stat_buf->s_nlink, rest, p, data_s->byte_swap);
00878        PUTU32(m->stat_buf->s_uid, rest, p, data_s->byte_swap);
00879        PUTU32(m->stat_buf->s_gid, rest, p, data_s->byte_swap);
00880        PUTU32(m->stat_buf->s_atime, rest, p, data_s->byte_swap);
00881        PUTU32(m->stat_buf->s_mtime, rest, p, data_s->byte_swap);
00882        PUTU32(m->stat_buf->s_ctime, rest, p, data_s->byte_swap);
00883        PUTU32(m->stat_buf->s_blksize, rest, p, data_s->byte_swap);
00884        PUTU32(m->stat_buf->s_attr, rest, p, data_s->byte_swap);
00885 
00886        PUTU64(m->stat_buf->s_dev, rest, p, data_s->byte_swap);
00887        PUTU64(m->stat_buf->s_rdev, rest, p, data_s->byte_swap);
00888        PUTU64(m->stat_buf->s_ino, rest, p, data_s->byte_swap);
00889        PUTU64(m->stat_buf->s_size, rest, p, data_s->byte_swap);
00890        PUTU64(m->stat_buf->s_blocks, rest, p, data_s->byte_swap);
00891     }
00892 
00893     *nbyte = rest;
00894     *ptr = p;
00895     
00896     return;
00897 }   
00898 
00899 void
00900 iiimp_lstat_reply_pack(
00901     IIIMP_data_s *        data_s,
00902     IIIMP_lstat_reply *   m,
00903     size_t *              nbyte,
00904     uchar_t **            ptr)
00905 {
00906     size_t              rest;
00907     uchar_t *           p;
00908 
00909     rest = *nbyte;
00910     p = *ptr;
00911 
00912     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
00913     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
00914     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
00915 
00916     if (m->ns_id > 0) {
00917        PUTU32(m->stat_buf->s_mode, rest, p, data_s->byte_swap);
00918        PUTU32(m->stat_buf->s_nlink, rest, p, data_s->byte_swap);
00919        PUTU32(m->stat_buf->s_uid, rest, p, data_s->byte_swap);
00920        PUTU32(m->stat_buf->s_gid, rest, p, data_s->byte_swap);
00921        PUTU32(m->stat_buf->s_atime, rest, p, data_s->byte_swap);
00922        PUTU32(m->stat_buf->s_mtime, rest, p, data_s->byte_swap);
00923        PUTU32(m->stat_buf->s_ctime, rest, p, data_s->byte_swap);
00924        PUTU32(m->stat_buf->s_blksize, rest, p, data_s->byte_swap);
00925        PUTU32(m->stat_buf->s_attr, rest, p, data_s->byte_swap);
00926 
00927        PUTU64(m->stat_buf->s_dev, rest, p, data_s->byte_swap);
00928        PUTU64(m->stat_buf->s_rdev, rest, p, data_s->byte_swap);
00929        PUTU64(m->stat_buf->s_ino, rest, p, data_s->byte_swap);
00930        PUTU64(m->stat_buf->s_size, rest, p, data_s->byte_swap);
00931        PUTU64(m->stat_buf->s_blocks, rest, p, data_s->byte_swap);
00932     }
00933 
00934     *nbyte = rest;
00935     *ptr = p;
00936     
00937     return;
00938 }   
00939 
00940 void
00941 iiimp_fstat_reply_pack(
00942     IIIMP_data_s *        data_s,
00943     IIIMP_fstat_reply *   m,
00944     size_t *              nbyte,
00945     uchar_t **            ptr)
00946 {
00947     size_t              rest;
00948     uchar_t *           p;
00949 
00950     rest = *nbyte;
00951     p = *ptr;
00952 
00953     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
00954     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
00955     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
00956 
00957     if (m->ns_id > 0) {
00958        PUTU32(m->stat_buf->s_mode, rest, p, data_s->byte_swap);
00959        PUTU32(m->stat_buf->s_nlink, rest, p, data_s->byte_swap);
00960        PUTU32(m->stat_buf->s_uid, rest, p, data_s->byte_swap);
00961        PUTU32(m->stat_buf->s_gid, rest, p, data_s->byte_swap);
00962        PUTU32(m->stat_buf->s_atime, rest, p, data_s->byte_swap);
00963        PUTU32(m->stat_buf->s_mtime, rest, p, data_s->byte_swap);
00964        PUTU32(m->stat_buf->s_ctime, rest, p, data_s->byte_swap);
00965        PUTU32(m->stat_buf->s_blksize, rest, p, data_s->byte_swap);
00966        PUTU32(m->stat_buf->s_attr, rest, p, data_s->byte_swap);
00967 
00968        PUTU64(m->stat_buf->s_dev, rest, p, data_s->byte_swap);
00969        PUTU64(m->stat_buf->s_rdev, rest, p, data_s->byte_swap);
00970        PUTU64(m->stat_buf->s_ino, rest, p, data_s->byte_swap);
00971        PUTU64(m->stat_buf->s_size, rest, p, data_s->byte_swap);
00972        PUTU64(m->stat_buf->s_blocks, rest, p, data_s->byte_swap);
00973     }
00974 
00975     *nbyte = rest;
00976     *ptr = p;
00977     
00978     return;
00979 }   
00980 
00981 void
00982 iiimp_creat_reply_pack(
00983     IIIMP_data_s *        data_s,
00984     IIIMP_creat_reply *   m,
00985     size_t *              nbyte,
00986     uchar_t **            ptr)
00987 {
00988     size_t              rest;
00989     uchar_t *           p;
00990 
00991     rest = *nbyte;
00992     p = *ptr;
00993 
00994     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
00995     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
00996     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
00997 
00998     *nbyte = rest;
00999     *ptr = p;
01000     
01001     return;
01002 }   
01003 
01004 void
01005 iiimp_lseek_reply_pack(
01006     IIIMP_data_s *       data_s,
01007     IIIMP_lseek_reply *  m,
01008     size_t *             nbyte,
01009     uchar_t **           ptr)
01010 {
01011     size_t              rest;
01012     uchar_t *           p;
01013 
01014     rest = *nbyte;
01015     p = *ptr;
01016 
01017     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
01018     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
01019     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
01020     PUTU32(m->offset, rest, p, data_s->byte_swap);
01021 
01022     *nbyte = rest;
01023     *ptr = p;
01024     
01025     return;
01026 }   
01027 
01028 void
01029 iiimp_unlink_reply_pack(
01030     IIIMP_data_s *        data_s,
01031     IIIMP_unlink_reply *  m,
01032     size_t *              nbyte,
01033     uchar_t **            ptr)
01034 {
01035     size_t              rest;
01036     uchar_t *           p;
01037 
01038     rest = *nbyte;
01039     p = *ptr;
01040 
01041     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
01042     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
01043     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
01044 
01045     *nbyte = rest;
01046     *ptr = p;
01047     
01048     return;
01049 }   
01050 
01051 void
01052 iiimp_rename_reply_pack(
01053     IIIMP_data_s *        data_s,
01054     IIIMP_rename_reply *  m,
01055     size_t *              nbyte,
01056     uchar_t **            ptr)
01057 {
01058     size_t              rest;
01059     uchar_t *           p;
01060 
01061     rest = *nbyte;
01062     p = *ptr;
01063 
01064     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
01065     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
01066     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
01067 
01068     *nbyte = rest;
01069     *ptr = p;
01070     
01071     return;
01072 }   
01073 
01074 void
01075 iiimp_fcntl_reply_pack(
01076     IIIMP_data_s *      data_s,
01077     IIIMP_fcntl_reply * m,
01078     size_t *            nbyte,
01079     uchar_t **          ptr)
01080 {
01081     size_t              rest;
01082     uchar_t *           p;
01083 
01084     rest = *nbyte;
01085     p = *ptr;
01086 
01087     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
01088     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
01089     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
01090     PUTU32(m->return_value, rest, p, data_s->byte_swap);
01091 
01092     *nbyte = rest;
01093     *ptr = p;
01094     
01095     return;
01096 }   
01097 
01098 void
01099 iiimp_truncate_reply_pack(
01100     IIIMP_data_s *          data_s,
01101     IIIMP_truncate_reply *  m,
01102     size_t *                nbyte,
01103     uchar_t **              ptr)
01104 {
01105     size_t              rest;
01106     uchar_t *           p;
01107 
01108     rest = *nbyte;
01109     p = *ptr;
01110 
01111     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
01112     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
01113     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
01114 
01115     *nbyte = rest;
01116     *ptr = p;
01117     
01118     return;
01119 }   
01120 
01121 void
01122 iiimp_ftruncate_reply_pack(
01123     IIIMP_data_s *           data_s,
01124     IIIMP_ftruncate_reply *  m,
01125     size_t *                 nbyte,
01126     uchar_t **               ptr)
01127 {
01128     size_t              rest;
01129     uchar_t *           p;
01130 
01131     rest = *nbyte;
01132     p = *ptr;
01133 
01134     PUTU32(m->nbyte, rest, p, data_s->byte_swap);
01135     PUTU32(m->ns_id, rest, p, data_s->byte_swap);
01136     PUT32(m->ns_errno, rest, p, data_s->byte_swap);
01137 
01138     *nbyte = rest;
01139     *ptr = p;
01140     
01141     return;
01142 }   
01143 
01144 IIIMP_open_reply *
01145 iiimp_open_reply_unpack(
01146     IIIMP_data_s *      data_s,
01147     size_t *            nbyte,
01148     const uchar_t **    ptr,
01149     size_t              nbyte_max)
01150 {
01151     IIIMP_open_reply *  data;
01152     size_t              rest;
01153     const uchar_t *     p;
01154   
01155     rest = nbyte_max;
01156     p = *ptr;
01157     
01158     if ((*nbyte < rest) || (rest < 4)) {
01159         data_s->status = IIIMP_DATA_INVALID;
01160         return NULL;
01161     }
01162     
01163     data = (IIIMP_open_reply *)malloc(nbyte_max);
01164     if (NULL == data) {
01165         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01166         return NULL;
01167     }
01168 
01169     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01170     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01171     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01172 
01173     *nbyte = rest;
01174     *ptr = p;
01175 
01176     return data;
01177 }
01178 
01179 IIIMP_read_reply *
01180 iiimp_read_reply_unpack(
01181     IIIMP_data_s *      data_s,
01182     size_t *            nbyte,
01183     const uchar_t **    ptr,
01184     size_t              nbyte_max)
01185 {
01186     IIIMP_read_reply *  data;
01187     size_t              rest;
01188     const uchar_t *     p;
01189     int                 i, count, object_size;
01190     IIIMP_card32 *      buf;
01191 
01192     rest = nbyte_max;
01193     p = *ptr;
01194 
01195     if ((*nbyte < rest) || (rest < (4 + 4 + 4 + 4))) {
01196         data_s->status = IIIMP_DATA_INVALID;
01197         return NULL;
01198     }
01199 
01200     object_size =  (rest - 4 - 4 - 4 -4);
01201     count = (object_size / 4);
01202 
01203     data = (IIIMP_read_reply *)malloc(nbyte_max);
01204     if (NULL == data) {
01205         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01206         return NULL;
01207     }
01208     data->object = NULL;
01209 
01210     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01211     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01212     GETU32(data->size, rest, p, data_s->byte_swap);
01213     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01214 
01215     buf = (IIIMP_card32 *)malloc(data->size);
01216     if (NULL == buf) {
01217        data_s->status = IIIMP_DATA_MALLOC_ERROR;
01218        return NULL;
01219     }
01220 
01221     for (i=0; i<count; i++) {
01222        GETU32(*(buf + i), rest, p, data_s->byte_swap);
01223     }
01224     data->object = (void *)buf;
01225 
01226     *nbyte = rest;
01227     *ptr = p;
01228 
01229     return data;
01230 }
01231 
01232 IIIMP_write_reply *
01233 iiimp_write_reply_unpack(
01234     IIIMP_data_s *      data_s,
01235     size_t *            nbyte,
01236     const uchar_t **    ptr,
01237     size_t              nbyte_max)
01238 {
01239     IIIMP_write_reply * data;
01240     size_t              rest;
01241     const uchar_t *     p;
01242 
01243     rest = nbyte_max;
01244     p = *ptr;
01245 
01246     if ((*nbyte < rest) || (rest < (4 + 4 + 4 + 4))) {
01247         data_s->status = IIIMP_DATA_INVALID;
01248         return NULL;
01249     }
01250 
01251     data = (IIIMP_write_reply *)malloc(nbyte_max);
01252     if (NULL == data) {
01253         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01254         return NULL;
01255     }
01256 
01257     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01258     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01259     GETU32(data->size, rest, p, data_s->byte_swap);
01260     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01261 
01262     *nbyte = rest;
01263     *ptr = p;
01264 
01265     return data;
01266 }
01267 
01268 IIIMP_close_reply *
01269 iiimp_close_reply_unpack(
01270     IIIMP_data_s *      data_s,
01271     size_t *            nbyte,
01272     const uchar_t **    ptr,
01273     size_t              nbyte_max)
01274 {
01275     IIIMP_close_reply *       data;
01276     size_t              rest;
01277     const uchar_t *     p;
01278 
01279     rest = nbyte_max;
01280     p = *ptr;
01281 
01282     if ((*nbyte < rest) || (rest < (4 + 4 + 4))) {
01283         data_s->status = IIIMP_DATA_INVALID;
01284         return NULL;
01285     }
01286 
01287     data = (IIIMP_close_reply *)malloc(nbyte_max);
01288     if (NULL == data) {
01289         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01290         return NULL;
01291     }
01292 
01293     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01294     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01295     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01296 
01297     *nbyte = rest;
01298     *ptr = p;
01299 
01300     return data;
01301 }
01302 
01303 IIIMP_seek_reply *
01304 iiimp_seek_reply_unpack(
01305     IIIMP_data_s *      data_s,
01306     size_t *            nbyte,
01307     const uchar_t **    ptr,
01308     size_t              nbyte_max)
01309 {
01310     IIIMP_seek_reply *  data;
01311     size_t              rest;
01312     const uchar_t *     p;
01313 
01314     rest = nbyte_max;
01315     p = *ptr;
01316 
01317     if ((*nbyte < rest) || (rest < (4 + 4 + 4 + 4))) {
01318         data_s->status = IIIMP_DATA_INVALID;
01319         return NULL;
01320     }
01321 
01322     data = (IIIMP_seek_reply *)malloc(nbyte_max);
01323     if (NULL == data) {
01324         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01325         return NULL;
01326     }
01327 
01328     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01329     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01330     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01331     GETU32(data->offset, rest, p, data_s->byte_swap);
01332 
01333     *nbyte = rest;
01334     *ptr = p;
01335 
01336     return data;
01337 }
01338 
01339 IIIMP_opendir_reply *
01340 iiimp_opendir_reply_unpack(
01341     IIIMP_data_s *      data_s,
01342     size_t *            nbyte,
01343     const uchar_t **    ptr,
01344     size_t              nbyte_max)
01345 {
01346     IIIMP_opendir_reply *  data;
01347     size_t                 rest;
01348     const uchar_t *        p;
01349 
01350     rest = nbyte_max;
01351     p = *ptr;
01352 
01353     if ((*nbyte < rest) || (rest < (4 + 4 + 4 + 4))) {
01354         data_s->status = IIIMP_DATA_INVALID;
01355         return NULL;
01356     }
01357 
01358     data = (IIIMP_opendir_reply *)malloc(nbyte_max);
01359     if (NULL == data) {
01360         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01361         return NULL;
01362     }
01363 
01364     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01365     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01366     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01367     GETU32(data->nitems, rest, p, data_s->byte_swap);
01368 
01369     if (data->nitems > 0) {
01370        data->d_name = iiimp_utf8string_list_unpack(data_s, &rest, &p, rest);
01371        if (NULL == data->d_name) {
01372            iiimp_opendir_reply_delete(data_s, data);
01373            return NULL;
01374        }
01375 
01376     }
01377 
01378     *nbyte = rest;
01379     *ptr = p;
01380 
01381     return data;
01382 }
01383 
01384 IIIMP_closedir_reply *
01385 iiimp_closedir_reply_unpack(
01386     IIIMP_data_s *      data_s,
01387     size_t *            nbyte,
01388     const uchar_t **    ptr,
01389     size_t              nbyte_max)
01390 {
01391     IIIMP_closedir_reply *  data;
01392     size_t                  rest;
01393     const uchar_t *         p;
01394 
01395     rest = nbyte_max;
01396     p = *ptr;
01397 
01398     if ((*nbyte < rest) || (rest < (4 + 4 + 4))) {
01399         data_s->status = IIIMP_DATA_INVALID;
01400         return NULL;
01401     }
01402 
01403     data = (IIIMP_closedir_reply *)malloc(nbyte_max);
01404     if (NULL == data) {
01405         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01406         return NULL;
01407     }
01408 
01409     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01410     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01411     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01412 
01413     *nbyte = rest;
01414     *ptr = p;
01415 
01416     return data;
01417 }
01418 
01419 IIIMP_mkdir_reply *
01420 iiimp_mkdir_reply_unpack(
01421     IIIMP_data_s *      data_s,
01422     size_t *            nbyte,
01423     const uchar_t **    ptr,
01424     size_t              nbyte_max)
01425 {
01426     IIIMP_mkdir_reply * data;
01427     size_t              rest;
01428     const uchar_t *     p;
01429 
01430     rest = nbyte_max;
01431     p = *ptr;
01432 
01433     if ((*nbyte < rest) || (rest < (4 + 4 + 4))) {
01434         data_s->status = IIIMP_DATA_INVALID;
01435         return NULL;
01436     }
01437 
01438     data = (IIIMP_mkdir_reply *)malloc(nbyte_max);
01439     if (NULL == data) {
01440         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01441         return NULL;
01442     }
01443 
01444     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01445     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01446     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01447 
01448     *nbyte = rest;
01449     *ptr = p;
01450 
01451     return data;
01452 }
01453 
01454 IIIMP_rmdir_reply *
01455 iiimp_rmdir_reply_unpack(
01456     IIIMP_data_s *      data_s,
01457     size_t *            nbyte,
01458     const uchar_t **    ptr,
01459     size_t              nbyte_max)
01460 {
01461     IIIMP_rmdir_reply * data;
01462     size_t              rest;
01463     const uchar_t *     p;
01464 
01465     rest = nbyte_max;
01466     p = *ptr;
01467 
01468     if ((*nbyte < rest) || (rest < (4 + 4 + 4))) {
01469         data_s->status = IIIMP_DATA_INVALID;
01470         return NULL;
01471     }
01472 
01473     data = (IIIMP_rmdir_reply *)malloc(nbyte_max);
01474     if (NULL == data) {
01475         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01476         return NULL;
01477     }
01478 
01479     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01480     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01481     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01482 
01483     *nbyte = rest;
01484     *ptr = p;
01485 
01486     return data;
01487 }
01488 
01489 IIIMP_symlink_reply *
01490 iiimp_symlink_reply_unpack(
01491     IIIMP_data_s *      data_s,
01492     size_t *            nbyte,
01493     const uchar_t **    ptr,
01494     size_t              nbyte_max)
01495 {
01496     IIIMP_symlink_reply * data;
01497     size_t                rest;
01498     const uchar_t *     p;
01499 
01500     rest = nbyte_max;
01501     p = *ptr;
01502 
01503     if ((*nbyte < rest) || (rest < 4)) {
01504         data_s->status = IIIMP_DATA_INVALID;
01505         return NULL;
01506     }
01507 
01508     data = (IIIMP_symlink_reply *)malloc(nbyte_max);
01509     if (NULL == data) {
01510         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01511         return NULL;
01512     }
01513 
01514     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01515     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01516     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01517 
01518     *nbyte = rest;
01519     *ptr = p;
01520 
01521     return data;
01522 }
01523 
01524 IIIMP_stat_reply *
01525 iiimp_stat_reply_unpack(
01526     IIIMP_data_s *      data_s,
01527     size_t *            nbyte,
01528     const uchar_t **    ptr,
01529     size_t              nbyte_max)
01530 {
01531     IIIMP_stat_reply *  data;
01532     size_t              rest;
01533     const uchar_t *     p;
01534     iiimp_stat_struct * im_stat;
01535 
01536     rest = nbyte_max;
01537     p = *ptr;
01538 
01539     if ((*nbyte < rest) || (rest < (4 + 4 + 4))) {
01540         data_s->status = IIIMP_DATA_INVALID;
01541         return NULL;
01542     }
01543 
01544     data = (IIIMP_stat_reply *)malloc(nbyte_max);
01545     if (NULL == data) {
01546         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01547         return NULL;
01548     }
01549 
01550     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01551     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01552     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01553 
01554     if (data->ns_id <= 0) {
01555        data->stat_buf = (iiimp_stat_struct *)NULL;
01556     } else {
01557        im_stat = (iiimp_stat_struct *) calloc(1, sizeof(iiimp_stat_struct));
01558        GETU32(im_stat->s_mode, rest, p, data_s->byte_swap);
01559        GETU32(im_stat->s_nlink, rest, p, data_s->byte_swap);
01560        GETU32(im_stat->s_uid, rest, p, data_s->byte_swap);
01561        GETU32(im_stat->s_gid, rest, p, data_s->byte_swap);
01562        GETU32(im_stat->s_atime, rest, p, data_s->byte_swap);
01563        GETU32(im_stat->s_mtime, rest, p, data_s->byte_swap);
01564        GETU32(im_stat->s_ctime, rest, p, data_s->byte_swap);
01565        GETU32(im_stat->s_blksize, rest, p, data_s->byte_swap);
01566        GETU32(im_stat->s_attr, rest, p, data_s->byte_swap);
01567     
01568        GETU64(im_stat->s_dev, rest, p, data_s->byte_swap);
01569        GETU64(im_stat->s_rdev, rest, p, data_s->byte_swap);
01570        GETU64(im_stat->s_ino, rest, p, data_s->byte_swap);
01571        GETU64(im_stat->s_size, rest, p, data_s->byte_swap);
01572        GETU64(im_stat->s_blocks, rest, p, data_s->byte_swap);
01573        data->stat_buf = im_stat;
01574     }
01575 
01576     *nbyte = rest;
01577     *ptr = p;
01578 
01579     return data;
01580 }
01581 
01582 IIIMP_lstat_reply *
01583 iiimp_lstat_reply_unpack(
01584     IIIMP_data_s *      data_s,
01585     size_t *            nbyte,
01586     const uchar_t **    ptr,
01587     size_t              nbyte_max)
01588 {
01589     IIIMP_lstat_reply * data;
01590     size_t              rest;
01591     const uchar_t *     p;
01592     iiimp_stat_struct * im_stat;
01593 
01594     rest = nbyte_max;
01595     p = *ptr;
01596 
01597     if ((*nbyte < rest) || (rest < (4 + 4 + 4))) {
01598         data_s->status = IIIMP_DATA_INVALID;
01599         return NULL;
01600     }
01601 
01602     data = (IIIMP_lstat_reply *)malloc(nbyte_max);
01603     if (NULL == data) {
01604         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01605         return NULL;
01606     }
01607 
01608     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01609     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01610     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01611 
01612     if (data->ns_id <= 0) {
01613        data->stat_buf = (iiimp_stat_struct *)NULL;
01614     } else {
01615        im_stat = (iiimp_stat_struct *) calloc(1, sizeof(iiimp_stat_struct));
01616        GETU32(im_stat->s_mode, rest, p, data_s->byte_swap);
01617        GETU32(im_stat->s_nlink, rest, p, data_s->byte_swap);
01618        GETU32(im_stat->s_uid, rest, p, data_s->byte_swap);
01619        GETU32(im_stat->s_gid, rest, p, data_s->byte_swap);
01620        GETU32(im_stat->s_atime, rest, p, data_s->byte_swap);
01621        GETU32(im_stat->s_mtime, rest, p, data_s->byte_swap);
01622        GETU32(im_stat->s_ctime, rest, p, data_s->byte_swap);
01623        GETU32(im_stat->s_blksize, rest, p, data_s->byte_swap);
01624        GETU32(im_stat->s_attr, rest, p, data_s->byte_swap);
01625     
01626        GETU64(im_stat->s_dev, rest, p, data_s->byte_swap);
01627        GETU64(im_stat->s_rdev, rest, p, data_s->byte_swap);
01628        GETU64(im_stat->s_ino, rest, p, data_s->byte_swap);
01629        GETU64(im_stat->s_size, rest, p, data_s->byte_swap);
01630        GETU64(im_stat->s_blocks, rest, p, data_s->byte_swap);
01631        data->stat_buf = im_stat;
01632     }
01633 
01634     *nbyte = rest;
01635     *ptr = p;
01636 
01637     return data;
01638 }
01639 
01640 IIIMP_fstat_reply *
01641 iiimp_fstat_reply_unpack(
01642     IIIMP_data_s *      data_s,
01643     size_t *            nbyte,
01644     const uchar_t **    ptr,
01645     size_t              nbyte_max)
01646 {
01647     IIIMP_fstat_reply * data;
01648     size_t              rest;
01649     const uchar_t *     p;
01650     iiimp_stat_struct * im_stat;
01651 
01652     rest = nbyte_max;
01653     p = *ptr;
01654 
01655     if ((*nbyte < rest) || (rest < (4 + 4 + 4))) {
01656         data_s->status = IIIMP_DATA_INVALID;
01657         return NULL;
01658     }
01659 
01660     data = (IIIMP_fstat_reply *)malloc(nbyte_max);
01661     if (NULL == data) {
01662         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01663         return NULL;
01664     }
01665 
01666     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01667     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01668     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01669 
01670     if (data->ns_id <= 0) {
01671        data->stat_buf = (iiimp_stat_struct *)NULL;
01672     } else {
01673        im_stat = (iiimp_stat_struct *) calloc(1, sizeof(iiimp_stat_struct));
01674        GETU32(im_stat->s_mode, rest, p, data_s->byte_swap);
01675        GETU32(im_stat->s_nlink, rest, p, data_s->byte_swap);
01676        GETU32(im_stat->s_uid, rest, p, data_s->byte_swap);
01677        GETU32(im_stat->s_gid, rest, p, data_s->byte_swap);
01678        GETU32(im_stat->s_atime, rest, p, data_s->byte_swap);
01679        GETU32(im_stat->s_mtime, rest, p, data_s->byte_swap);
01680        GETU32(im_stat->s_ctime, rest, p, data_s->byte_swap);
01681        GETU32(im_stat->s_blksize, rest, p, data_s->byte_swap);
01682        GETU32(im_stat->s_attr, rest, p, data_s->byte_swap);
01683     
01684        GETU64(im_stat->s_dev, rest, p, data_s->byte_swap);
01685        GETU64(im_stat->s_rdev, rest, p, data_s->byte_swap);
01686        GETU64(im_stat->s_ino, rest, p, data_s->byte_swap);
01687        GETU64(im_stat->s_size, rest, p, data_s->byte_swap);
01688        GETU64(im_stat->s_blocks, rest, p, data_s->byte_swap);
01689        data->stat_buf = im_stat;
01690     }
01691 
01692     *nbyte = rest;
01693     *ptr = p;
01694 
01695     return data;
01696 }
01697 
01698 IIIMP_creat_reply *
01699 iiimp_creat_reply_unpack(
01700     IIIMP_data_s *      data_s,
01701     size_t *            nbyte,
01702     const uchar_t **    ptr,
01703     size_t              nbyte_max)
01704 {
01705     IIIMP_creat_reply * data;
01706     size_t              rest;
01707     const uchar_t *     p;
01708 
01709     rest = nbyte_max;
01710     p = *ptr;
01711 
01712     if ((*nbyte < rest) || (rest < (4 + 4 + 4))) {
01713         data_s->status = IIIMP_DATA_INVALID;
01714         return NULL;
01715     }
01716 
01717     data = (IIIMP_creat_reply *)malloc(nbyte_max);
01718     if (NULL == data) {
01719         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01720         return NULL;
01721     }
01722 
01723     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01724     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01725     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01726 
01727     *nbyte = rest;
01728     *ptr = p;
01729 
01730     return data;
01731 }
01732 
01733 IIIMP_lseek_reply *
01734 iiimp_lseek_reply_unpack(
01735     IIIMP_data_s *      data_s,
01736     size_t *            nbyte,
01737     const uchar_t **    ptr,
01738     size_t              nbyte_max)
01739 {
01740     IIIMP_lseek_reply * data;
01741     size_t              rest;
01742     const uchar_t *     p;
01743 
01744     rest = nbyte_max;
01745     p = *ptr;
01746 
01747     if ((*nbyte < rest) || (rest < (4 + 4 + 4))) {
01748         data_s->status = IIIMP_DATA_INVALID;
01749         return NULL;
01750     }
01751 
01752     data = (IIIMP_lseek_reply *)malloc(nbyte_max);
01753     if (NULL == data) {
01754         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01755         return NULL;
01756     }
01757 
01758     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01759     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01760     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01761     GETU32(data->offset, rest, p, data_s->byte_swap);
01762 
01763     *nbyte = rest;
01764     *ptr = p;
01765 
01766     return data;
01767 }
01768 
01769 IIIMP_unlink_reply *
01770 iiimp_unlink_reply_unpack(
01771     IIIMP_data_s *      data_s,
01772     size_t *            nbyte,
01773     const uchar_t **    ptr,
01774     size_t              nbyte_max)
01775 {
01776     IIIMP_unlink_reply * data;
01777     size_t               rest;
01778     const uchar_t *      p;
01779 
01780     rest = nbyte_max;
01781     p = *ptr;
01782 
01783     if ((*nbyte < rest) || (rest < (4 + 4 + 4))) {
01784         data_s->status = IIIMP_DATA_INVALID;
01785         return NULL;
01786     }
01787 
01788     data = (IIIMP_unlink_reply *)malloc(nbyte_max);
01789     if (NULL == data) {
01790         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01791         return NULL;
01792     }
01793 
01794     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01795     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01796     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01797 
01798     *nbyte = rest;
01799     *ptr = p;
01800 
01801     return data;
01802 }
01803 
01804 IIIMP_rename_reply *
01805 iiimp_rename_reply_unpack(
01806     IIIMP_data_s *      data_s,
01807     size_t *            nbyte,
01808     const uchar_t **    ptr,
01809     size_t              nbyte_max)
01810 {
01811     IIIMP_rename_reply * data;
01812     size_t               rest;
01813     const uchar_t *      p;
01814 
01815     rest = nbyte_max;
01816     p = *ptr;
01817 
01818     if ((*nbyte < rest) || (rest < (4 + 4 + 4))) {
01819         data_s->status = IIIMP_DATA_INVALID;
01820         return NULL;
01821     }
01822 
01823     data = (IIIMP_rename_reply *)malloc(nbyte_max);
01824     if (NULL == data) {
01825         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01826         return NULL;
01827     }
01828 
01829     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01830     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01831     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01832 
01833     *nbyte = rest;
01834     *ptr = p;
01835 
01836     return data;
01837 }
01838 
01839 IIIMP_fcntl_reply *
01840 iiimp_fcntl_reply_unpack(
01841     IIIMP_data_s *      data_s,
01842     size_t *            nbyte,
01843     const uchar_t **    ptr,
01844     size_t              nbyte_max)
01845 {
01846     IIIMP_fcntl_reply *  data;
01847     size_t               rest;
01848     const uchar_t *      p;
01849 
01850     rest = nbyte_max;
01851     p = *ptr;
01852 
01853     if ((*nbyte < rest) || (rest < (4 + 4 + 4))) {
01854         data_s->status = IIIMP_DATA_INVALID;
01855         return NULL;
01856     }
01857 
01858     data = (IIIMP_fcntl_reply *)malloc(nbyte_max);
01859     if (NULL == data) {
01860         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01861         return NULL;
01862     }
01863 
01864     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01865     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01866     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01867     GETU32(data->return_value, rest, p, data_s->byte_swap);
01868 
01869     *nbyte = rest;
01870     *ptr = p;
01871 
01872     return data;
01873 }
01874 
01875 IIIMP_truncate_reply *
01876 iiimp_truncate_reply_unpack(
01877     IIIMP_data_s *      data_s,
01878     size_t *            nbyte,
01879     const uchar_t **    ptr,
01880     size_t              nbyte_max)
01881 {
01882     IIIMP_truncate_reply * data;
01883     size_t                 rest;
01884     const uchar_t *        p;
01885 
01886     rest = nbyte_max;
01887     p = *ptr;
01888 
01889     if ((*nbyte < rest) || (rest < (4 + 4 + 4))) {
01890         data_s->status = IIIMP_DATA_INVALID;
01891         return NULL;
01892     }
01893 
01894     data = (IIIMP_truncate_reply *)malloc(nbyte_max);
01895     if (NULL == data) {
01896         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01897         return NULL;
01898     }
01899 
01900     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01901     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01902     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01903 
01904     *nbyte = rest;
01905     *ptr = p;
01906 
01907     return data;
01908 }
01909 
01910 IIIMP_ftruncate_reply *
01911 iiimp_ftruncate_reply_unpack(
01912     IIIMP_data_s *      data_s,
01913     size_t *            nbyte,
01914     const uchar_t **    ptr,
01915     size_t              nbyte_max)
01916 {
01917     IIIMP_ftruncate_reply * data;
01918     size_t                  rest;
01919     const uchar_t *         p;
01920 
01921     rest = nbyte_max;
01922     p = *ptr;
01923 
01924     if ((*nbyte < rest) || (rest < (4 + 4 + 4))) {
01925         data_s->status = IIIMP_DATA_INVALID;
01926         return NULL;
01927     }
01928 
01929     data = (IIIMP_ftruncate_reply *)malloc(nbyte_max);
01930     if (NULL == data) {
01931         data_s->status = IIIMP_DATA_MALLOC_ERROR;
01932         return NULL;
01933     }
01934 
01935     GETU32(data->nbyte, rest, p, data_s->byte_swap);
01936     GETU32(data->ns_id, rest, p, data_s->byte_swap);
01937     GET32(data->ns_errno, rest, p, data_s->byte_swap);
01938 
01939     *nbyte = rest;
01940     *ptr = p;
01941 
01942     return data;
01943 }
01944 
01945 void
01946 iiimp_open_reply_print(
01947     IIIMP_data_s *      data_s,
01948     IIIMP_open_reply *  m
01949 )
01950 {
01951     if (NULL == m) return;
01952 
01953     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
01954     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
01955     (void)fputc('\n', data_s->print_fp);
01956 }
01957 
01958 void
01959 iiimp_read_reply_print(
01960     IIIMP_data_s *      data_s,
01961     IIIMP_read_reply *  m
01962 )
01963 {
01964     if (NULL == m) return;
01965 
01966     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
01967     (void)fprintf(data_s->print_fp, "\tsize = %d\n", m->size);
01968     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
01969     (void)fputc('\n', data_s->print_fp);
01970 }
01971 
01972 void
01973 iiimp_write_reply_print(
01974     IIIMP_data_s *      data_s,
01975     IIIMP_write_reply * m
01976 )
01977 {
01978     if (NULL == m) return;
01979 
01980     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
01981     (void)fprintf(data_s->print_fp, "\tsize = %d\n", m->size);
01982     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
01983     (void)fputc('\n', data_s->print_fp);
01984 }
01985 
01986 void
01987 iiimp_close_reply_print(
01988     IIIMP_data_s *      data_s,
01989     IIIMP_close_reply * m
01990 )
01991 {
01992     if (NULL == m) return;
01993 
01994     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
01995     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
01996     (void)fputc('\n', data_s->print_fp);
01997 }
01998 
01999 void
02000 iiimp_seek_reply_print(
02001     IIIMP_data_s *     data_s,
02002     IIIMP_seek_reply * m
02003 )
02004 {
02005     if (NULL == m) return;
02006 
02007     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02008     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02009     (void)fprintf(data_s->print_fp, "\toffset = %d\n", m->offset);
02010     (void)fputc('\n', data_s->print_fp);
02011 }
02012 
02013 void
02014 iiimp_opendir_reply_print(
02015     IIIMP_data_s *        data_s,
02016     IIIMP_opendir_reply * m
02017 )
02018 {
02019     if (NULL == m) return;
02020 
02021     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02022     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02023     (void)fprintf(data_s->print_fp, "\tnitems = %d\n", m->nitems);
02024     (void)fputc('\n', data_s->print_fp);
02025     (void)fprintf(data_s->print_fp, "\td_name = ");
02026     iiimp_utf8string_list_print(data_s, m->d_name);
02027     (void)fputc('\n', data_s->print_fp);
02028 }
02029 
02030 void
02031 iiimp_closedir_reply_print(
02032     IIIMP_data_s *         data_s,
02033     IIIMP_closedir_reply * m
02034 )
02035 {
02036     if (NULL == m) return;
02037 
02038     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02039     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02040     (void)fputc('\n', data_s->print_fp);
02041 }
02042 
02043 void
02044 iiimp_mkdir_reply_print(
02045     IIIMP_data_s *      data_s,
02046     IIIMP_mkdir_reply * m
02047 )
02048 {
02049     if (NULL == m) return;
02050 
02051     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02052     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02053     (void)fputc('\n', data_s->print_fp);
02054 }
02055 
02056 void
02057 iiimp_rmdir_reply_print(
02058     IIIMP_data_s *      data_s,
02059     IIIMP_rmdir_reply * m
02060 )
02061 {
02062     if (NULL == m) return;
02063 
02064     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02065     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02066     (void)fputc('\n', data_s->print_fp);
02067 }
02068 
02069 void
02070 iiimp_symlink_reply_print(
02071     IIIMP_data_s *        data_s,
02072     IIIMP_symlink_reply * m
02073 )
02074 {
02075     if (NULL == m) return;
02076 
02077     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02078     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02079     (void)fputc('\n', data_s->print_fp);
02080 }
02081 
02082 void
02083 iiimp_stat_reply_print(
02084     IIIMP_data_s *     data_s,
02085     IIIMP_stat_reply * m
02086 )
02087 {
02088     if (NULL == m) return;
02089 
02090     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02091     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02092     (void)fputc('\n', data_s->print_fp);
02093 }
02094 
02095 void
02096 iiimp_lstat_reply_print(
02097     IIIMP_data_s *      data_s,
02098     IIIMP_lstat_reply * m
02099 )
02100 {
02101     if (NULL == m) return;
02102 
02103     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02104     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02105     (void)fputc('\n', data_s->print_fp);
02106 }
02107 
02108 void
02109 iiimp_fstat_reply_print(
02110     IIIMP_data_s *      data_s,
02111     IIIMP_fstat_reply * m
02112 )
02113 {
02114     if (NULL == m) return;
02115 
02116     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02117     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02118     (void)fputc('\n', data_s->print_fp);
02119 }
02120 
02121 void
02122 iiimp_creat_reply_print(
02123     IIIMP_data_s *      data_s,
02124     IIIMP_creat_reply * m
02125 )
02126 {
02127     if (NULL == m) return;
02128 
02129     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02130     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02131     (void)fputc('\n', data_s->print_fp);
02132 }
02133 
02134 void
02135 iiimp_lseek_reply_print(
02136     IIIMP_data_s *      data_s,
02137     IIIMP_lseek_reply * m
02138 )
02139 {
02140     if (NULL == m) return;
02141 
02142     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02143     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02144     (void)fprintf(data_s->print_fp, "\toffset = %d\n", m->offset);
02145     (void)fputc('\n', data_s->print_fp);
02146 }
02147 
02148 void
02149 iiimp_unlink_reply_print(
02150     IIIMP_data_s *       data_s,
02151     IIIMP_unlink_reply * m
02152 )
02153 {
02154     if (NULL == m) return;
02155 
02156     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02157     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02158     (void)fputc('\n', data_s->print_fp);
02159 }
02160 
02161 void
02162 iiimp_rename_reply_print(
02163     IIIMP_data_s *       data_s,
02164     IIIMP_rename_reply * m
02165 )
02166 {
02167     if (NULL == m) return;
02168 
02169     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02170     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02171     (void)fputc('\n', data_s->print_fp);
02172 }
02173 
02174 void
02175 iiimp_fcntl_reply_print(
02176     IIIMP_data_s *      data_s,
02177     IIIMP_fcntl_reply * m
02178 )
02179 {
02180     if (NULL == m) return;
02181 
02182     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02183     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02184     (void)fprintf(data_s->print_fp, "\treturn_value = %d\n", m->return_value);
02185     (void)fputc('\n', data_s->print_fp);
02186 }
02187 
02188 void
02189 iiimp_truncate_reply_print(
02190     IIIMP_data_s *         data_s,
02191     IIIMP_truncate_reply * m
02192 )
02193 {
02194     if (NULL == m) return;
02195 
02196     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02197     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02198     (void)fputc('\n', data_s->print_fp);
02199 }
02200 
02201 void
02202 iiimp_ftruncate_reply_print(
02203     IIIMP_data_s *          data_s,
02204     IIIMP_ftruncate_reply * m
02205 )
02206 {
02207     if (NULL == m) return;
02208 
02209     (void)fprintf(data_s->print_fp, "\tns_id = %d\n", m->ns_id);
02210     (void)fprintf(data_s->print_fp, "\tns_errno = %d\n", m->ns_errno);
02211     (void)fputc('\n', data_s->print_fp);
02212 }
02213 
02214 /* Local Variables: */
02215 /* c-file-style: "iiim-project" */
02216 /* End: */