• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ chkout_c函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中chkout_c函数的典型用法代码示例。如果您正苦于以下问题:C++ chkout_c函数的具体用法?C++ chkout_c怎么用?C++ chkout_c使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了chkout_c函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: swpool_c


//.........这里部分代码省略.........
 
-Restrictions
 
   None. 
 
-Literature_References
 
   None. 
 
-Author_and_Institution
 
   N.J. Bachman    (JPL)
   W.L. Taber      (JPL) 
 
-Version
 
   -CSPICE Version 1.3.0, 27-AUG-2002 (NJB)

      Call to C2F_CreateStrArr_Sig replaced with call to C2F_MapStrArr.

   -CSPICE Version 1.2.0, 28-AUG-2001 (NJB)

      Const-qualified input array names.

   -CSPICE Version 1.1.0, 14-FEB-2000 (NJB)

       Calls to C2F_CreateStrArr replaced with calls to error-signaling 
       version of this routine:  C2F_CreateStrArr_Sig.
      
   -CSPICE Version 1.0.0, 05-JUN-1999 (NJB) (WLT)

-Index_Entries
 
   Watch for an update to a kernel pool variable 
   Notify a routine of an update to a kernel pool variable 
-&
*/

{ /* Begin swpool_c */


   /*
   Local variables
   */

   SpiceChar             * fCvalsArr;

   SpiceInt                fCvalsLen;


   /*
   Participate in error tracing.
   */
   chkin_c ( "swpool_c" );


   /*
   Make sure the input string pointer for agent is non-null 
   and that the length is sufficient.  
   */
   CHKFSTR ( CHK_STANDARD, "swpool_c", agent );

   /*
   Make sure the input string pointer for the names array is non-null 
   and that the length lenvals is sufficient.  
   */
   CHKOSTR ( CHK_STANDARD, "swpool_c", names, lenvals );

   /*
   Create a Fortran-style string array.
   */
   C2F_MapStrArr ( "swpool_c", 
                   nnames, lenvals, names, &fCvalsLen,  &fCvalsArr );

   if ( failed_c() )
   {
      chkout_c ( "swpool_c" );
      return;
   }


   /*
   Call the f2c'd routine.
   */
   swpool_ (  ( char       * ) agent,
              ( integer    * ) &nnames,
              ( char       * ) fCvalsArr,
              ( ftnlen       ) strlen(agent),
              ( ftnlen       ) fCvalsLen      );


   /*
   Free the dynamically allocated array.
   */
   free ( fCvalsArr );


   chkout_c ( "swpool_c" );

} /* End swpool_c */
开发者ID:Dbelsa,项目名称:coft,代码行数:101,代码来源:swpool_c.c


示例2: pckcov_c


//.........这里部分代码省略.........
                          "YYYY MON DD HR:MN:SC.### (TDB) ::TDB",  
                          TIMLEN,
                          timstr                                  );

               printf ( "\n"
                        "Interval:  %ld\n"
                        "Start:     %s\n",
                        i,
                        timstr            );

               timout_c ( e, 
                          "YYYY MON DD HR:MN:SC.### (TDB) ::TDB",  
                          TIMLEN,
                          timstr                                  );
               printf ( "Stop:      %s\n", timstr );

            }
            return ( 0 );
         }


 
-Restrictions
 
   1) If an error occurs while this routine is updating the window 
      `cover', the window may be corrupted. 
 
-Literature_References
 
   None. 
 
-Author_and_Institution
 
   N.J. Bachman   (JPL) 
 
-Version
 
   -CSPICE Version 1.0.1, 01-JUL-2014 (NJB)

       Updated index entries.

   -CSPICE Version 1.0.0, 30-NOV-2007 (NJB)

-Index_Entries
 
   get coverage window for binary pck reference frame
   get coverage start and stop time for binary pck frame 

-&
*/

{ /* Begin pckcov_c */


   /*
   Participate in error tracing.
   */
   if ( return_c() )
   {
      return; 
   }
   chkin_c ( "pckcov_c" );


   /*
   Check the input string `pck' to make sure the pointer is non-null 
   and the string length is non-zero.
   */
   CHKFSTR ( CHK_STANDARD, "pckcov_c", pck );
   
   /*
   Make sure cell data type is d.p. 
   */
   CELLTYPECHK ( CHK_STANDARD, "pckcov_c", SPICE_DP, cover );

   /*
   Initialize the cell if necessary. 
   */
   CELLINIT ( cover );   

   /*
   Call the f2c'd Fortran routine.
   */
   pckcov_ ( ( char       * ) pck,
             ( integer    * ) &idcode,
             ( doublereal * ) (cover->base),
             ( ftnlen       ) strlen(pck)   );

   /*
   Sync the output cell. 
   */
   if ( !failed_c() )
   {
      zzsynccl_c ( F2C, cover );
   }


   chkout_c ( "pckcov_c" );

} /* End pckcov_c */
开发者ID:Dbelsa,项目名称:coft,代码行数:101,代码来源:pckcov_c.c


示例3: frmnam_c


//.........这里部分代码省略.........
 
-Examples
 
   Suppose you needed to create a message concerning a reference 
   frame and wish to use the name of the frame in the message. 
   Suppose further that you have only the frame ID code at your 
   disposal.  You can capture the frame name using this routine 
   as shown here. 
 
      #include "SpiceUsr.h"   
           .
           .
           .
      #define NAMELEN         33
      
      SpiceChar               frname [NAMELEN];
      SpiceInt                frcode;

 
      frmnam_c ( frcode, NAMELEN, frname );
 
      if ( iswhsp_c(frname) )  
      { 
         sprintf ( frname, "%ld", frcode );
      }

      printf ( "Concerning reference frame: %s\n", frname );
 
        [Print the rest of your message.]
        
 
-Restrictions
 
   None. 
 
-Literature_References
 
   None. 
 
-Author_and_Institution
 
   W.L. Taber      (JPL) 
   B.V. Semenov    (JPL) 
   N.J. Bachman    (JPL)
   
-Version
 
   -CSPICE Version 1.0.2, 08-JAN-2014 (BVS) 

       Fixed typo in Examples (frname_c -> frmnam_c). Reordered
       header sections.

   -CSPICE Version 1.0.1, 26-MAR-2003 (NJB) 

       Fixed description of exception (4):  replaced "lenout-1"
       with "lenout."  Removed spurious word "clock" from string
       description.

   -CSPICE Version 1.0.0, 13-AUG-2001 (NJB) (WLT)

-Index_Entries
 
   Frame idcode to frame name translation   

-&
*/

{ /* Begin frmnam_c */


   /*
   Participate in error tracing.
   */
   chkin_c ( "frmnam_c" );

   /*
   Make sure the output frmnam has at least enough room for one output
   character and a null terminator.  Also check for a null pointer.
   */
   CHKOSTR ( CHK_STANDARD, "frmnam_c", frname, lenout );


   /*
   Do the conversion.
   */
   frmnam_ ( ( integer * ) &frcode, 
             ( char    * ) frname, 
             ( ftnlen    ) lenout-1 );
      
   /*
   Convert the Fortran string to a C string by placing a null
   after the last non-blank character.  This operation is valid
   whether or not the CSPICE routine signaled an error.
   */
   F2C_ConvertStr ( lenout, frname );


   chkout_c ( "frmnam_c" );

} /* End frmnam_c */
开发者ID:Boxx-Obspm,项目名称:DOCKing_System,代码行数:101,代码来源:frmnam_c.c


示例4: getelm_c


//.........这里部分代码省略.........
-Index_Entries
 
   Parse two-line elements 
 
-&
*/

{ /* Begin getelm_c */


   /*
   Local constants
   */
   #define NELTS           2
   
   
   /*
   Local variables
   */
   SpiceChar            ** cvalsPtr;
   SpiceChar             * fCvalsArr;

   SpiceInt                i;
   SpiceInt                fCvalsLen;

   SpiceStatus             status;

   /*
   Participate in error tracing.
   */
   chkin_c ( "getelm_c" );


   /*
   Check the input line array for null pointer of insufficient string
   length.
   */
   CHKOSTR ( CHK_STANDARD, "getelm_c", lines, lineln );


   /*
   Convert the input string array to a Fortran-style string array.

   We'll first allocate an array of character pointers to index
   the values, initialize this array, and use it to produce
   a dynamically allocated array of Fortran-style strings.
   */

   cvalsPtr = ( SpiceChar ** ) malloc ( NELTS * sizeof(SpiceChar *) );

   if ( cvalsPtr == 0 )
   {
      setmsg_c ( "Failure on malloc call to create pointer array "
                 "for line values."                              );
      sigerr_c ( "SPICE(MALLOCFAILED)"                           );
      chkout_c ( "getelm_c"                                      );
      return;
   }
   
   for ( i = 0;  i < NELTS;  i++  )
   {
      cvalsPtr[i] =  (SpiceChar *)lines  +  ( i * lineln );
   }
   
   status = C2F_CreateStrArr (  NELTS, 
                                ( ConstSpiceChar ** ) cvalsPtr, 
                                &fCvalsLen, 
                                &fCvalsArr                      );
  /* fCvalsArr[2*fCvalsLen] = '\0'; */
   
   if ( status == SPICEFAILURE )
   {
      free ( cvalsPtr );
      
      setmsg_c ( "C to Fortran string array conversion for `lines' "
                 "failed."                                           );
      sigerr_c ( "SPICE(STRINGCONVERROR)"                            );
      chkout_c ( "getelm_c"                                          );
      return;
   }
   
   /*
   Call the f2c'd routine.
   */
   getelm_ (  ( integer    * ) &frstyr,
              ( char       * ) fCvalsArr,
              ( doublereal * ) epoch,
              ( doublereal * ) elems,
              ( ftnlen       ) fCvalsLen  );
   
   /*
   Clean up all of our dynamically allocated arrays.
   */
   free ( cvalsPtr  );
   free ( fCvalsArr );


   chkout_c ( "getelm_c" );

} /* End getelm_c */
开发者ID:Boxx-Obspm,项目名称:DOCKing_System,代码行数:101,代码来源:getelm_c.c


示例5: nplnpt_c


//.........这里部分代码省略.........
-Particulars
 
   For every line L and point P, there is a unique closest point 
   on L to P.  Call this closest point C.  It is always true that 
   P - C  is perpendicular to L, and the length of P - C is called 
   the "distance" between P and L. 
 
-Examples
 
   1)  Suppose a line passes through the point ( 1, 2, 3 ) and 
       has direction vector ( 0, 1, 1 ).  We wish to find the 
       closest point on the line to the point ( -6, 9, 10 ).  We 
       can use the code fragment 
 
          #include "SpiceUsr.h"
               .
               .
               .
          LINPT[0]   =  1.0; 
          LINPT[1]   =  2.0; 
          LINPT[2]   =  3.0; 
 
          LINDIR[0]  =  0.0; 
          LINDIR[1]  =  1.0; 
          LINDIR[2]  =  1.0; 
 
          POINT[0]   = -6.0; 
          POINT[1]   =  9.0; 
          POINT[2]   = 10.0; 
 
          nplnpt_c ( linpt, lindir, point, pnear, &dist );
 
 
       After the call, pnear will take the value 
 
          ( 1., 9., 10. ); 
 
       dist will be 7.0. 
 
-Restrictions
 
   None. 
 
-Literature_References
 
   None. 
 
-Author_and_Institution
 
   N.J. Bachman   (JPL) 
 
-Version
 
   -CSPICE Version 1.0.0, 16-AUG-1999 (NJB)

-Index_Entries
 
   distance between point and line 
   nearest point on line to point 
 
-&
*/

{ /* Begin nplnpt_c */

 
   /*
   Local variables
   */
   SpiceDouble             trans [3];
 


   /*
   We need a real direction vector to work with.
   */
   if (  vzero_c (lindir)  )
   {
      chkin_c  ( "nplnpt_c"                           );
      setmsg_c ( "Direction vector must be non-zero." );
      sigerr_c ( "SPICE(ZEROVECTOR)"                  );
      chkout_c ( "nplnpt_c"                           );
      return;
   }
 
 
   /*
   We translate line and input point so as to put the line through
   the origin.  Then the nearest point on the translated line to the
   translated point TRANS is the projection of TRANS onto the line.
   */
   
   vsub_c  ( point,  linpt,  trans );
   vproj_c ( trans,  lindir, pnear );
   vadd_c  ( pnear,  linpt,  pnear );
 
   *dist = vdist_c ( pnear,  point );


} /* End nplnpt_c */
开发者ID:Dbelsa,项目名称:coft,代码行数:101,代码来源:nplnpt_c.c


示例6: gfrr_c


//.........这里部分代码省略.........
    */

    chkin_c ( "gfrr_c" );

    /*
    Make sure cell data types are d.p.
    */
    CELLTYPECHK2 ( CHK_STANDARD, "gfrr_c", SPICE_DP, cnfine, result );

    /*
    Initialize the input cells if necessary.
    */
    CELLINIT2 ( cnfine, result );

    /*
    Check the input strings to make sure each pointer is non-null
    and each string length is non-zero.
    */
    CHKFSTR ( CHK_STANDARD, "gfrr_c", target );
    CHKFSTR ( CHK_STANDARD, "gfrr_c", abcorr );
    CHKFSTR ( CHK_STANDARD, "gfrr_c", obsrvr );
    CHKFSTR ( CHK_STANDARD, "gfrr_c", relate );

    /*
    Check the workspace size; some mallocs have a violent
    dislike for negative allocation amounts. To be safe,
    rule out a count of zero intervals as well.
    */

    if ( nintvls < 1 )
    {
        setmsg_c ( "The specified workspace interval count # was "
                   "less than the minimum allowed value of one (1)." );
        errint_c ( "#",  nintvls                              );
        sigerr_c ( "SPICE(VALUEOUTOFRANGE)"                   );
        chkout_c ( "gfrr_c"                                   );
        return;
    }

    /*
    Allocate the workspace. 'nintvls' indicates the maximum number of
    intervals returned in 'result'. An interval consists of
    two values.
    */

    nintvls = 2 * nintvls;

    nBytes  = ( nintvls + SPICE_CELL_CTRLSZ ) * nw * sizeof(SpiceDouble);

    work    = (doublereal *) alloc_SpiceMemory( nBytes );

    if ( !work )
    {
        setmsg_c ( "Workspace allocation of # bytes failed due to "
                   "malloc failure"                               );
        errint_c ( "#",  nBytes                                   );
        sigerr_c ( "SPICE(MALLOCFAILED)"                          );
        chkout_c ( "gfrr_c"                                       );
        return;
    }

    /*
    Let the f2'd routine do the work.
    */

    gfrr_( ( char          * ) target,
           ( char          * ) abcorr,
           ( char          * ) obsrvr,
           ( char          * ) relate,
           ( doublereal    * ) &refval,
           ( doublereal    * ) &adjust,
           ( doublereal    * ) &step,
           ( doublereal    * ) (cnfine->base),
           ( integer       * ) &nintvls,
           ( integer       * ) &nw,
           ( doublereal    * ) work,
           ( doublereal    * ) (result->base),
           ( ftnlen          ) strlen(target),
           ( ftnlen          ) strlen(abcorr),
           ( ftnlen          ) strlen(obsrvr),
           ( ftnlen          ) strlen(relate) );

    /*
    De-allocate the workspace.
    */
    free_SpiceMemory( work );

    /*
    Sync the output cell.
    */
    if ( !failed_c() )
    {
        zzsynccl_c ( F2C, result ) ;
    }

    ALLOC_CHECK;

    chkout_c ( "gfrr_c" );

} /* End gfrr_c */
开发者ID:Boxx-Obspm,项目名称:DOCKing_System,代码行数:101,代码来源:gfrr_c.c


示例7: vprjp_c


//.........这里部分代码省略.........
   vector. 
 
   Two related routines are vprjpi_c, which inverts an orthogonal 
   projection of a vector onto a plane, and vproj_c, which projects 
   a vector orthogonally onto another vector. 
 
-Examples
 
   1)   Find the closest point in the ring plane of a planet to a 
        spacecraft located at positn (in body-fixed coordinates). 
        Suppose the vector normal is normal to the ring plane, and 
        that origin, which represents the body center, is in the 
        ring plane.  Then we can make a `plane' with the code 
 
           pnv2pl_c ( origin, normal, &plane ); 
 
        can find the projection by making the call 
 
           vprjp_c ( positn, &plane, proj ); 
 
-Restrictions
 
   None. 
 
-Literature_References
 
   [1] `Calculus and Analytic Geometry', Thomas and Finney. 
 
-Author_and_Institution
 
   N.J. Bachman   (JPL) 
 
-Version
 
   -CSPICE Version 1.0.0, 05-MAR-1999 (NJB)

-Index_Entries
 
   vector projection onto plane 
 
-&
*/

{ /* Begin vprjp_c */


   /*
   Local variables
   */
   SpiceDouble             constant;
   SpiceDouble             normal    [3];


   /*
   Participate in error tracing.
   */

   if ( return_c() ) 
   {
      return;
   }
   
   chkin_c ( "vprjp_c" );


   /*
   Obtain a unit vector normal to the input plane, and a constant
   for the plane.
   */
   pl2nvc_c ( plane, normal, &constant );
 
   
   /*
   Let the notation < a, b > indicate the inner product of vectors
   a and b.

   vin differs from its projection onto plane by some multiple of
   normal.  That multiple is


             < vin - vout, normal >                 *  normal

      =   (  < vin, normal > - < vout, normal >  )  *  normal

      =   (  < vin, normal > - const             )  *  normal


   Subtracting this multiple of normal from vin yields vout.
   */
 
   vlcom_c (  1.0,
              vin,
              constant - vdot_c ( vin, normal ),
              normal,
              vout                              );
 
 
   chkout_c ( "vprjp_c" );

} /* End vprjp_c */
开发者ID:Boxx-Obspm,项目名称:DOCKing_System,代码行数:101,代码来源:vprjp_c.c


示例8: ckcov_c


//.........这里部分代码省略.........
-Literature_References
 
   None. 
 
-Author_and_Institution
 
   N.J. Bachman   (JPL) 
 
-Version
 
   -CSPICE Version 1.0.1, 30-NOV-2007 (NJB)

       Corrected bug in first example program in header:
       program now empties result window prior to collecting
       data for each object. Updated examples to use wncard_c 
       rather than card_c. Updated second example to demonstrate
       segment-level summary capability.

   -CSPICE Version 1.0.0, 07-JAN-2005 (NJB)

-Index_Entries
 
   get coverage window for ck object 
 
-&
*/

{ /* Begin ckcov_c */


   /*
   Local variables 
   */
   logical                 need;


   /*
   Participate in error tracing.
   */
   if ( return_c() )
   {
      return; 
   }
   chkin_c ( "ckcov_c" );

   /*
   Check the input string `ck' to make sure the pointer is non-null 
   and the string length is non-zero.
   */
   CHKFSTR ( CHK_STANDARD, "ckcov_c", ck );
   
   /*
   Check the input string `level' to make sure the pointer is non-null 
   and the string length is non-zero.
   */
   CHKFSTR ( CHK_STANDARD, "ckcov_c", level );

   /*
   Check the input string `timsys' to make sure the pointer is non-null 
   and the string length is non-zero.
   */
   CHKFSTR ( CHK_STANDARD, "ckcov_c", timsys );

   /*
   Make sure cell data type is d.p. 
   */
   CELLTYPECHK ( CHK_STANDARD, "ckcov_c", SPICE_DP, cover );

   /*
   Initialize the cell if necessary. 
   */
   CELLINIT ( cover );   

   /*
   Call the f2c'd Fortran routine.
   */
   need = needav;

   ckcov_ ( ( char       * ) ck,
            ( integer    * ) &idcode,
            ( logical    * ) &need,
            ( char       * ) level,
            ( doublereal * ) &tol,
            ( char       * ) timsys,
            ( doublereal * ) (cover->base),
            ( ftnlen       ) strlen(ck),
            ( ftnlen       ) strlen(level),
            ( ftnlen       ) strlen(timsys)  );

   /*
   Sync the output cell. 
   */
   if ( !failed_c() )
   {
      zzsynccl_c ( F2C, cover );
   }

   chkout_c ( "ckcov_c" );

} /* End ckcov_c */
开发者ID:haisamido,项目名称:GMAT,代码行数:101,代码来源:ckcov_c.c


示例9: qcktrc_c


//.........这里部分代码省略.........


         ====================================================================
         ============

         Toolkit version: N0065

         SPICE(NOLOADEDFILES) --

         At least one SPK file needs to be loaded by SPKLEF before beginning 
         a search.

         A traceback follows.  The name of the highest level module is first.
         spkezr_c --> SPKEZR --> SPKEZ --> SPKGEO --> SPKSFS

         ====================================================================
         ============
         Traceback:
         spkezr_c --> SPKEZR --> SPKEZ --> SPKGEO --> SPKSFS


-Restrictions
 
   1) It is assumed no module names exceed SPICE_ERROR_MODLEN
      characters in length. 
 
-Literature_References
 
   None. 
 
-Author_and_Institution
 
   N.J. Bachman    (JPL) 
   K.R. Gehringer  (JPL) 
 
-Version
 
   -CSPICE Version 1.0.0, 05-NOV-2013 (NJB) (KRG)

-Index_Entries
 
   get quick traceback 
 
-&
*/

{ /* Begin qcktrc_c */

 
   /*
   This routine does not check in unless an input error occurs.
   */


   /* 
   Make sure the output string has at least enough room for one output
   character and a null terminator. Also check for a null pointer.

   We don't use the usual CHKOSTR macro here because we must reset
   the error status before signaling an error.
   */
   if ( trace == NULL )
   {
      reset_c  ();

      chkin_c  ( "qcktrc_c"                                   );
      setmsg_c ( "The output string pointer 'trace' is null." );
      sigerr_c ( "SPICE(NULLPOINTER)"                         );
      chkout_c ( "qcktrc_c"                                   );
      return;
   }

   if ( tracelen < 2 )
   {
      reset_c  ();

      chkin_c  ( "qcktrc_c"                                     );
      setmsg_c ( "The output string 'trace' has length #; the "
                 "minimum allowed length is 2 characters."      );
      errint_c ( "#",  tracelen                                 );
      sigerr_c ( "SPICE(STRINGTOOSHORT)"                        );
      chkout_c ( "qcktrc_c"                                     );
      return;
   }


   /*
   Fetch the traceback. 
   */
   qcktrc_ ( ( char       * ) trace,
             ( ftnlen       ) tracelen-1 );

   /*
   Convert the output name string to a null-terminated,
   C style string. 
   */
   F2C_ConvertStr ( tracelen, trace );


} /* End qcktrc_c */
开发者ID:Boxx-Obspm,项目名称:DOCKing_System,代码行数:101,代码来源:qcktrc_c.c


示例10: gfuds_c


//.........这里部分代码省略.........
   */
   CELLTYPECHK2 ( CHK_STANDARD, "gfuds_c", SPICE_DP, cnfine, result );

   /* 
   Initialize the input cells if necessary. 
   */
   CELLINIT2 ( cnfine, result );

   /*
   Check the other input strings to make sure each pointer is non-null 
   and each string length is non-zero.
   */
   CHKFSTR ( CHK_STANDARD, "gfuds_c", relate );

   /*
   Store the input function pointers so these functions can be
   called by the GF adapters. 
   */
   zzadsave_c ( UDFUNC,  (void *)(udfunc)  );
   zzadsave_c ( UDQDEC,  (void *)(udqdec)  );

   /*
   Check the workspace size; some mallocs have a violent
   dislike for negative allocation amounts. To be safe,
   rule out a count of zero intervals as well.
   */

   if ( nintvls < 1 )
      {
      setmsg_c ( "The specified workspace interval count # was "
                 "less than the minimum allowed value of one (1)." );
      errint_c ( "#",  nintvls                              );
      sigerr_c ( "SPICE(VALUEOUTOFRANGE)"                   );
      chkout_c ( "gfuds_c"                                  );
      return;
      } 
      

   /*
   Allocate the workspace. 'nintvls' indicates the maximum number of
   intervals returned in 'result'. An interval consists of
   two values.
   */

   nintvls = 2 * nintvls;
   
   nBytes = (nintvls + SPICE_CELL_CTRLSZ ) * nw * sizeof(SpiceDouble);

   work   = (doublereal *) alloc_SpiceMemory( nBytes );

   if ( !work ) 
      {
      setmsg_c ( "Workspace allocation of # bytes failed due to "
                 "malloc failure"                               );
      errint_c ( "#",  nBytes                                   );
      sigerr_c ( "SPICE(MALLOCFAILED)"                          );
      chkout_c ( "gfuds_c"                                      );
      return;
      }


   /*
   Let the f2c'd routine do the work. 

   We pass the adapter functions, not those provided as inputs,
   to the f2c'd routine:
开发者ID:haisamido,项目名称:GMAT,代码行数:67,代码来源:gfuds_c.c


示例11: zzgfdsps_


//.........这里部分代码省略.........

   /*
   Local variables
   */      
   SpiceChar             * CFmtPtr;
   SpiceChar             * CStringPtr;

   SpiceInt                i;
   SpiceInt                nl;
   SpiceInt                nt;
   SpiceInt                outlen;
 

   /*
   Participate in error tracing.
   */
   chkin_c ( "zzgfdsps_" );

   /*
   The input strings are Fortran-style; they're not 
   null-terminated. Convert these to C-style strings
   so we can work with them. We'll need to use dynamic
   memory to hold the C-style strings. 
   */
   F2C_CreateStr_Sig ( stringLen, string, &CStringPtr );
   
   if ( failed_c() ) 
   {
      /*
      The CSPICE string utilities do their own clean-up of
      allocated memory, so we won't attempt to free the
      C string. 
      */
      chkout_c ( "zzgfdsps_" );

      return (-1);
   }

   F2C_CreateStr_Sig ( fmtLen, fmt, &CFmtPtr );

   if ( failed_c() ) 
   {
      /*
      Failure at this point requires that we free the previous,
      successfully allocated string. 
      */
      free ( CStringPtr );

      chkout_c ( "zzgfdsps_" );

      return(-1);
   }

   /*
   Display any blank lines indicated by `nlead'. 
   */

   nl = *nlead;
   nt = *ntrail;

 
   for ( i = 0;  i < nl; i++ )
   {
      putc ( '\n', stdout );
   }
开发者ID:Boxx-Obspm,项目名称:DOCKing_System,代码行数:66,代码来源:zzgfdsps.c


示例12: psv2pl_c


//.........这里部分代码省略.........
 
-Examples
 
   1)  Project a vector v orthogonally onto a plane defined by 
       point, span1, and span2.  proj is the projection we want; it 
       is the closest vector in the plane to v. 
 
          psv2pl_c ( point,  span1,   span2,  &plane ); 
          vprjp_c  ( v,      &plane,  proj           );
 
 
   2)  Find the plane determined by a spacecraft's position vector 
       relative to a central body and the spacecraft's velocity 
       vector.  We assume that all vectors are given in the same 
       coordinate system. 
 
          /.
          pos is the spacecraft's position, relative to 
          the central body.  vel is the spacecraft's velocity 
          vector.  pos is a point (vector, if you like) in 
          the orbit plane, and it is also one of the spanning 
          vectors of the plane. 
          ./
          psv2pl_c ( pos, pos, vel, &plane );
           
 
-Restrictions
 
   None. 
 
-Literature_References
 
   [1] `Calculus and Analytic Geometry', Thomas and Finney. 
 
-Author_and_Institution
 
   N.J. Bachman   (JPL) 
 
-Version
 
   -CSPICE Version 1.0.0, 05-MAR-1999 (NJB)

-Index_Entries
 
   point and spanning vectors to plane 
 
-&
*/

{ /* Begin psv2pl_c */



   /*
   This routine checks in only if an error is discovered.
   */

   if ( return_c () ) 
   {
      return;
   }

   /*
   Find the unitized cross product of SPAN1 and SPAN2; this is our
   unit normal vector, or possibly its inverse.
   */
   ucrss_c (  span1,  span2,  plane->normal  );

   if (  vzero_c ( plane->normal )  )
   {
      chkin_c  ( "psv2pl_c"                       );
      setmsg_c ( "Spanning vectors are parallel." );
      sigerr_c ( "SPICE(DEGENERATECASE)"          );
      chkout_c ( "psv2pl_c"                       );
      return;
   }
 
 
   /*
   Find the plane constant corresponding to the unit normal
   vector we've found.
   */
   plane->constant  =  vdot_c ( plane->normal, point );
 
 
   /*
   The constant should be the distance of the plane from the
   origin.  If the constant is negative, negate both it and the
   normal vector.
   */
      
   if ( plane->constant  <  0. ) 
   {
      plane->constant  =   - (plane->constant);
      
      vminus_c ( plane->normal, plane->normal );
   }


} /* End psv2pl_c */
开发者ID:Dbelsa,项目名称:coft,代码行数:101,代码来源:psv2pl_c.c


示例13: wninsd_c


//.........这里部分代码省略.........
   input window. If the new interval overlaps any of the intervals 
   in the window, the intervals are merged. Thus, the cardinality 
   of the input window can actually decrease as the result of an 
   insertion. However, because inserting an interval that is 
   disjoint from the other intervals in the window can increase the 
   cardinality of the window, the routine signals an error. 
 
   No other CSPICE unary window routine can increase the number of
   intervals in the input window.

-Examples
 
    Let window contain the intervals 
 
       [ 1, 3 ]  [ 7, 11 ]  [ 23, 27 ] 
 
    Then the following series of calls 
 
       wninsd_c ( 5.0,  5.0, &window )                  (1) 
       wninsd_c ( 4.0,  8.0, &window )                  (2) 
       wninsd_c ( 0.0, 30.0, &window )                  (3) 
 
    produces the following series of windows 

       [ 1,  3 ]  [ 5,  5 ]  [  7, 11 ]  [ 23, 27 ]     (1) 
       [ 1,  3 ]  [ 4, 11 ]  [ 23, 27 ]                 (2) 
       [ 0, 30 ]                                        (3) 
 
-Restrictions
 
   None. 
 
-Literature_References
 
   None. 
 
-Author_and_Institution
 
   N.J. Bachman    (JPL) 
   K.R. Gehringer  (JPL) 
   H.A. Neilan     (JPL) 
   W.L. Taber      (JPL) 
   I.M. Underwood  (JPL) 
 
-Version
 
   -CSPICE Version 1.0.0, 29-JUL-2002 (NJB) (KRG) (HAN) (WLT) (IMU)

-Index_Entries
 
   insert an interval into a d.p. window 
 
-&
*/

{ /* Begin wninsd_c */


   /*
   Standard SPICE error handling. 
   */

   if ( return_c() )
   {
      return;
   }
   chkin_c ( "wninsd_c" );


   /*
   Make sure cell data type is d.p. 
   */
   CELLTYPECHK ( CHK_STANDARD, "wninsd_c", SPICE_DP, window );


   /*
   Initialize the cell if necessary. 
   */
   CELLINIT ( window );
   

   /*
   Let the f2c'd routine do the work. 
   */
   wninsd_ ( (doublereal * )  &left,
             (doublereal * )  &right,
             (doublereal * )  (window->base) );

   /*
   Sync the output cell. 
   */
   if ( !failed_c() )
   {
      zzsynccl_c ( F2C, window );
   }


   chkout_c ( "wninsd_c" );

} /* End wninsd_c */
开发者ID:Boxx-Obspm,项目名称:DOCKing_System,代码行数:101,代码来源:wninsd_c.c


示例14: vprjpi_c


//.........这里部分代码省略.........
   
   chkin_c ( "vprjpi_c" );

 
   /*
   Unpack the planes.
   */
   pl2nvc_c ( projpl, projn, &projc );
   pl2nvc_c ( invpl,  invn,  &invc  );
 
   /*
   We'll first discuss the computation of VOUT in the nominal case,
   and then deal with the exceptional cases.

   When projpl and invpl are not orthogonal to each other, the
   inverse projection of vin will differ from vin by a multiple of
   projn, the unit normal vector to projpl.  We find this multiple
   by using the fact that the inverse projection vout satisfies the
   plane equation for the inverse projection plane invpl.

      We have

         vout = vin  +  mult * projn;                           (1)

      since vout satisfies

         < vout, invn >  =  invc

      we must have

         <  vin  +  mult * projn,  invn  > = invc

      which in turn implies


                   invc  -  < vin, invn >
         mult  =  ------------------------.                     (2)
                      < projn, invn >

      Having mult, we can compute vout according to equation (1).

   Now, if the denominator in the above expression for mult is zero
   or just too small, performing the division would cause a
   divide-by-zero error or an overflow of mult.  In either case, we
   will avoid carrying out the division, and we'll set found to
   SPICEFALSE.
   
 
   Compute the numerator and denominator of the right side of (2).
   */
   
   numer  =  invc - vdot_c ( vin,   invn );
   denom  =         vdot_c ( projn, invn );
   
 
   /*
   If the magnitude of the denominator is greater than
   
                         BOUND
      limit  =  abs (  ---------- * numer  ),
                        dpmax_c()

   we can safely divide the numerator by the denominator, and the
   magnitude of the result will be no greater than

       dpmax_c()
      ----------- .
        BOUND

   Note that we have ruled out the case where numer and denom are
   both zero by insisting on strict inequality in the comparison of
   denom and limit:
   */
 
   if ( fabs(numer) < 1.0 )
   {
      limit  =  fabs ( BOUND / dpmax_c() );
   }
   else
   {
      limit  =  fabs (  ( BOUND / dpmax_c() ) * numer  );
   }
 
   *found  =  ( fabs (denom) > limit );
   
   
   if ( *found )  
   {
      /*
      We'll compute vout after all.
      */
      mult = numer / denom;

      vlcom_c ( 1.0, vin, mult, projn, vout );
   }


   chkout_c ( "vprjpi_c" );

} /* End vprjpi_c */
开发者ID:Boxx-Obspm,项目名称:DOCKing_System,代码行数:101,代码来源:vprjpi_c.c


示例15: kdata_c


//.........这里部分代码省略.........

      Corrected example code to match routine's argument list.
      (2 arguments reversed)

   -CSPICE Version 1.1.0, 02-FEB-2003 (EDW)

      Corrected example code to match routine's argument list.

   -CSPICE Version 1.0.0, 12-SEP-1999 (NJB) (WLT)

-Index_Entries

   Retrieve information on loaded SPICE kernels

-&
*/

{   /* Begin kdata_c */


    /*
    Local variables
    */
    logical                 fnd;


    /*
    Participate in error tracing.
    */
    chkin_c ( "kdata_c" );


    /*
    Check the input string kind to make sure the pointer is non-null
    and the string length is non-zero.
    */
    CHKFSTR ( CHK_STANDARD, "kdata_c", kind );


    /*
    Make sure the output string file has at least enough room for one
    output character and a null terminator.  Also check for a null
    pointer.
    */
    CHKOSTR ( CHK_STANDARD, "kdata_c", file, fillen );


    /*
    Make sure the output string filtyp has at least enough room for one
    output character and a null terminator.  Also check for a null
    pointer.
    */
    CHKOSTR ( CHK_STANDARD, "kdata_c", filtyp, typlen );


    /*
    Make sure the output string source has at least enough room for one
    output character and a null terminator.  Also check for a null
    pointer.
    */
    CHKOSTR ( CHK_STANDARD, "kdata_c", source, srclen );


    /*
    Map the input index from C to Fortran style.
    */

    which++;


    /*
    Call the f2c'd routine.
    */
    kdata_ (  ( integer   * ) &which,
              ( char      * ) kind,
              ( char      * ) file,
              ( char      * ) filtyp,
              ( char      * ) source,
              ( integer   * ) handle,
              ( logical   * ) &fnd,
              ( ftnlen      ) strlen(kind),
              ( ftnlen      ) fillen-1,
              ( ftnlen      ) typlen-1,
              ( ftnlen      ) srclen-1     );


    /*
    Convert the output strings from Fortran style to C style.  Set
    the SpiceBoolean output found flag.
    */
    F2C_ConvertStr( fillen, file   );
    F2C_ConvertStr( typlen, filtyp );
    F2C_ConvertStr( srclen, source );

    *found = fnd;


    chkout_c ( "kdata_c" );

} /* End kdata_c */
开发者ID:Boxx-Obspm,项目名称:DOCKing_System,代码行数:101,代码来源:kdata_c.c


示例16: dtpool_c


//.........这里部分代码省略.........
      #include "SpiceUsr.h"
            .
            .
            .
      dtpool_c ( varnam, &found, &n, &type );
 
      if ( found ) 
      {
         printf ( "\n"
                  "Properties of variable %s:\n"
                  "\n"
                  "   Size: %d\n",
                  varnam,
                  n                           );
         
         if ( type == 'C' )
         {
            printf ( "   Type:  Character\n" );
         }
         else
         {
            printf ( "   Type:  Numeric\n" );
         }
      }
      
      else
      { 
         printf ( "%s is not present in the kernel pool.\n", varnam );
      } 
 
 
-Restrictions
 
   None. 
 
-Literature_References
 
   None. 
 
-Author_and_Institution
 
   W.L. Taber  (JPL) 
 
-Version
 
   -CSPICE Version 1.1.0, 17-OCT-1999 (NJB)  
   
      Local type logical variable now used for found flag used in
      interface of dtpool_.
            
   -CSPICE Version 1.0.0, 10-MAR-1999 (NJB)

-Index_Entries
 
   return summary information about a kernel pool variable
 
-&
*/

{ /* Begin dtpool_c */

   /*
   Local variables
   */
   logical                 fnd;
   
   
   /*
   Participate in error tracing.
   */
   chkin_c ( "dtpool_c" );


   /*
   Check the input string name to make sure the pointer is non-null
   and the string length is non-zero.
   */
   CHKFSTR ( CHK_STANDARD, "dtpool_c", name );


   /*
   Call the f2c'd routine.
   */
   dtpool_ ( ( char     * ) name,
             ( logical  * ) &fnd,
             ( integer  * ) n,
             ( char     * ) type,
             ( ftnlen     ) strlen(name), 
             ( ftnlen     ) 1             );
   
   /*
   Assign the SpiceBoolean found flag.
   */
   
   *found = fnd;
   
   
   chkout_c ( "dtpool_c" );

} /* End dtpool_c */
开发者ID:TomCrowley-ME,项目名称:me_sim_test,代码行数:101,代码来源:dtpool_c.c


示例17: dafrfr_c


//.........这里部分代码省略.........
 
   3) If the specified record cannot (for some reason) be read, 
      the error SPICE(DAFFRNOTFOUND) is signaled. 
 
-Files
 
   The input `handle' should refer to a DAF file open for read
   or write access.
 
-Particulars
 
   The file record of a DAF is the only record that contains 
   any global information about the file. This record is created 
   when the file is created, and is updated only when new arrays 
   are added. 
 
   Like character records, file records are not buffered. 
 
-Examples
 
   In the following example, the file record of a DAF is read
   to determine the first free address in the file.
 
      #include <stdio.h>
      #include "SpiceUsr.h"

      int main ( int argc, char ** argv )
      {
         #define IFNLEN   61

         SpiceChar               ifname[IFNLEN];

         SpiceInt                bward;
         SpiceInt                free;
         SpiceInt                fward;
         SpiceInt                handle;
         SpiceInt                nd;
         SpiceInt                ni;

         dafopr_c ( argv[1], &handle );

         dafrfr_c ( handle, IFNLEN, &nd, &ni, ifname, &fward, &bward, &free );

         printf ( "First free DAF address is %ld.\n", free );

         return ( 0 );
      } 

 
-Restrictions
 
   None. 
 
-Literature_References

   None.

-Author_and_Institution
 

   N.J. Bachman    (JPL)
   K.R. Gehringer  (JPL) 
   I.M. Underwood  (JPL) 
 
-Version
 
   -CSPICE Version 1.0.0, 17-JUN-2009 (NJB) (KRG) (IMU)

-Index_Entries
 
   read daf file record 
 
-&
*/

{ /* Begin dafrfr_c */

   /*
   Participate in error tracing.
   */
   chkin_c ( "dafrfr_c" );

   dafrfr_ ( (integer *) &handle,
             (integer *) nd,
             (integer *) ni,
             (char    *) ifname,
             (integer *) fward,
             (integer *) bward,
             (integer *) free,
             (ftnlen   ) lenout-1 );
  
   /*
   Convert the internal file name to a C-style string. 
   */
   F2C_ConvertStr ( lenout, ifname );


   chkout_c ( "dafrfr_c" );

} /* End dafrfr_c */
开发者ID:Dbelsa,项目名称:coft,代码行数:101,代码来源:dafrfr_c.c


示例18: spkw09_c


//.........这里部分代码省略.........
-Particulars
 
   This routine writes an SPK type 09 data segment to the open SPK 
   file according to the format described in the type 09 section of 
   the SPK Required Reading. The SPK file must have been opened with 
   write access. 
 
-Examples
 
   Suppose that you have states and are prepared to produce 
   a segment of type 09 in an SPK file. 
 
   The following code fragment could be used to add the new segment 
   to a previously opened SPK file attached to HANDLE. The file must 
   have been opened with write access. 
 
      #include "SpiceUsr.h"
           .
           .
           .
        
      /.
      Create a segment identifier. 
      ./
      #define  SEGID  "MY_SAMPLE_SPK_TYPE_9_SEGMENT" 
 
        
      /.
      Write the segment. 
      ./
        
      spkw09_c ( handle,  body,    center,  frame, 
                 first,   last,    segid,   degree, 
                 n,       states,  epochs          );
 
-Restrictions
 
   None. 
 
-Literature_References
 
   None. 
 
-Author_and_Institution
 
   K.R. Gehringer (JPL) 
   N.J. Bachman   (JPL) 
   J.M. Lynch     (JPL) 
   W.L. Taber     (JPL) 
 
-Version
 
   -CSPICE Version 1.0.0, 21-JUN-1999 (KRG) (NJB) (JML) (WLT)

-Index_Entries
 
   

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ chmod函数代码示例发布时间:2022-05-30
下一篇:
C++ chkout_函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap