/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#+
#+     Internet Radio Automation & Encoding Toolkit
#+
#+     Copyright (C) 2018 - 2026 by Kevin C. O'Kane
#+
#+     Kevin C. O'Kane
#+     kc.okane@gmail.com
#+     https://www.cs.uni.edu/~okane
#+     https://threadsafebooks.com/
#+
#+ This program is free software; you can redistribute it and/or modify
#+ it under the terms of the GNU General Public License as published by
#+ the Free Software Foundation; either version 2 of the License, or
#+ (at your option) any later version.
#+
#+ This program is distributed in the hope that it will be useful,
#+ but WITHOUT ANY WARRANTY; without even the implied warranty of
#+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#+ GNU General Public License for more details.
#+
#+ You should have received a copy of the GNU General Public License
#+ along with this program; if not, write to the Free Software
#+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#+
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/

//	June 8, 2026

#include "includes.h"
#include "common-externs.h"

#define SLASH '/'

//-----------------------------------------------
//	load program file name into buttons
//-----------------------------------------------

char *	ProgramName(char * name) {

	int i, j, k, m;
	static char tmp[8192];
	static char tmp1[8192];
	char played[64];
	FILE * f1;
	char *p1;

	strcpy(tmp, name);
	p1 = basename(tmp);
	if (p1 != NULL) {
		for (int i = strlen(p1); i > 0; i--) {
			if (p1[i] == '.') { 
				p1[i] = 0;
				strcpy(tmp1, p1);
				return tmp1;
				}
			}
		}

	printf("\n*** Name error\n\t %s\n\t %s\n\n", name, p1);
	return NULL;
	}

