4 * Copyright 2012 Samsung Electronics Co., Ltd
6 * Licensed under the Flora License, Version 1.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.tizenopensource.org/license
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 * This file implements wifi direct application utils functions.
23 * @file wfd-app-util.c
24 * @author Sungsik Jang (sungsik.jang@samsung.com)
31 #include "wfd-ugapp-util.h"
34 char *wfd_app_trim_path(const char *filewithpath)
37 char *filename = NULL;
38 if ((filename = strrchr(filewithpath, '/')) == NULL)
39 return (char *) filewithpath;
41 return (filename + 1);
43 static char *filename[100];
46 const char *space = " ";
47 int len = strlen(filewithpath);
50 strptr = (char *) filewithpath + (len - 20);
52 } else if (len < 20) {
53 strptr = (char *) filewithpath;
57 strncpy((char *) filename, space, strlen(space));
58 strncpy((char *) filename + start, strptr, 50);
60 return (char *) filename;
68 return syscall(__NR_gettid);
70 fprintf(stderr, "__NR_gettid is not defined, please include linux/unistd.h ");