X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=include%2Fctsupport.h;h=14ef13c2b87edb1d844db171b504aca0093903e4;hb=01ee1e0085970643368d65c38b09008927e24cd5;hp=3cc00f6c1c265d5ad221a6b81434d9a964d2d1c5;hpb=e289f8ecb69ba183b32e32ff20f1679f4b62194d;p=ctsim.git diff --git a/include/ctsupport.h b/include/ctsupport.h index 3cc00f6..14ef13c 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.7 2000/11/28 14:54:07 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); @@ -188,7 +191,7 @@ char *td_day_name(int n); // Math Section -#include +#include #define PI 3.14159265358979323846 #define HALFPI 1.57079632679489661923 /* PI divided by 2 */ @@ -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,29 +266,11 @@ 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); -// Console I/O Section - -#define C_BLACK 0 /* color codes */ -#define C_BLUE 1 -#define C_GREEN 2 -#define C_CYAN 3 -#define C_RED 4 -#define C_MAGENTA 5 -#define C_BROWN 6 -#define C_WHITE 7 -#define C_GREY 8 -#define C_LTBLUE 9 -#define C_LTGREEN 10 -#define C_LTCYAN 11 -#define C_LTRED 12 -#define C_LTMAGENTA 13 -#define C_YELLOW 14 -#define C_LTWHITE 15 - /*----------------------------------------------------------------------*/ /* screen character codes */