/* * scanner.cpp * * Copyright 2024 Michael Rasmussen * * 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., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * */ #include #include "main.hpp" #include "scanner.h" struct Scanner { void* obj; }; Scanner_t* scanner_create(const char* file) { Scanner_t* s; ExifScanner* obj; s = g_new0(Scanner_t, 1); obj = new ExifScanner(file); s->obj = obj; return s; } void scanner_destroy(Scanner_t* s) { if (s == NULL) return; delete static_cast(s->obj); free(s); } gchar* get_lens_maker(Scanner_t* s) { ExifScanner* obj; if (s == NULL) return NULL; obj = static_cast(s->obj); return obj->get_cscring(obj->get_maker()); } gchar* get_lens_serial_number(Scanner_t* s) { ExifScanner* obj; if (s == NULL) return NULL; obj = static_cast(s->obj); return obj->get_cscring(obj->get_serial_number()); } gchar* get_lens_info(Scanner_t* s) { ExifScanner* obj; if (s == NULL) return NULL; obj = static_cast(s->obj); return obj->get_cscring(obj->get_lens()); }