1 2 /* 3 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 */ 18 19 /* fortran miscellaneous support routines */ 20 21 typedef int INT; 22 23 /** 24 * \brief buf receives date in the form dd-mmm-yy trucated or padded to buf_len 25 */ 26 void Ftn_date(char *buf, INT buf_len); 27 28 /** 29 * \brief buffer receives date in the form dd-mmm-yy. 30 */ 31 void Ftn_datew(char buf[9]); 32 33 /** 34 * \brief i,j,k receive integer values for month, day, and year 35 */ 36 void Ftn_jdate(INT *i, INT *j, INT *k); 37 38 /** 39 * \brief i,j,k receive short integer values for month, day, and year 40 */ 41 void Ftn_idate(short *i, short *j, short *k); 42 43 /** 44 * \brief Returns the number of seconds since midnight minus the supplied value 45 */ 46 float Ftn_secnds(float x); 47 48 /** 49 * \brief double precision version of secnds. 50 */ 51 double Ftn_dsecnds(double x); 52 53 /* 54 * \brief buf returns time in the form hh:mm:ss padded or blank filled to 55 * 8 characters. 56 */ 57 void Ftn_time(char *buf, INT buf_len); 58 59 /* 60 * \brief buf returns time in the form hh:mm:ss. 61 */ 62 void Ftn_timew(char buf[8]); 63 64 /** \brief 65 * returns VMS-compatible random number sequence 66 */ 67 float Ftn_ran(unsigned *seed); 68 69 /** 70 * \brief Ftn_dran double precision version of ran): 71 */ 72 double Ftn_dran(unsigned *seed); 73 74 #if defined(TARGET_WIN) 75 /* 76 * Miscellaneous support routines for windows '3f-like' routines 77 * which are self-contained as opposed to fortran interfaces to 78 * C system routines. 79 */ 80 void CopyMemory(char *to, char *from, size_t n); 81 int MakeWord(int lo, int hi); 82 #endif 83