X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=include%2Fctsupport.h;h=58274ee3039a9e37c7157a73f3dbcb7a70eef987;hb=dfa390de2efc04d85b03718a6480f735516df0e8;hp=3cc00f6c1c265d5ad221a6b81434d9a964d2d1c5;hpb=e289f8ecb69ba183b32e32ff20f1679f4b62194d;p=ctsim.git diff --git a/include/ctsupport.h b/include/ctsupport.h index 3cc00f6..58274ee 100644 --- a/include/ctsupport.h +++ b/include/ctsupport.h @@ -9,7 +9,7 @@ ** This is part of the CTSim program ** Copyright (C) 1983-2000 Kevin Rosenberg ** -** $Id: ctsupport.h,v 1.3 2000/06/19 19:10:08 kevin Exp $ +** $Id: ctsupport.h,v 1.5 2000/06/28 15:25:34 kevin Exp $ ** ** ** This program is free software; you can redistribute it and/or modify @@ -149,10 +149,13 @@ typedef unsigned char kuint8; #endif -/* filefuncs.cpp */ -bool file_exists(const char* fname); -const char* fileBasename(const char* filename); -FILE *sys_fopen(const char *filename, const char *mode, const char *progname); +inline const char* +fileBasename (const char* const filename) +{ + const char* p = strrchr (filename, '/'); + return (p ? p + 1 : filename); +} + /* strfuncs.cpp */ char* str_skip_head(const char* str, const char* const charlist); @@ -251,8 +254,6 @@ int clip_sector (double& x1, double& y1, double& x2, double& y2, const double u, int clip_circle (double& x1, double& y1, double& x2, double& y2, const double cx, const double cy, const double radius, double t1, double t2); int clip_triangle (double& x1, double& y1, double& x2, double& y2, const double u, const double v, const int clip_xaxis); -// norm_ang.cpp -double norm_ang (double theta); // xform.cpp void indent_mtx2 (GRFMTX_2D m); @@ -265,7 +266,8 @@ void rotate2d (double x[], double y[], int pts, double angle); void xlat2d (double x[], double y[], int pts, double xoffset, double yoffset); void scale2d (double x[], double y[], int pts, double xfact, double yfact); -// simpson.cpp +// mathfuncs.cpp +double normalizeAngle (double theta); double integrateSimpson (const double xmin, const double xmax, const double *y, const int np);