Advertisement
Guest User

Solved

a guest
Jan 28th, 2017
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.83 KB | None | 0 0
  1. #include <string.h>
  2. #include <ctype.h>
  3. #include <unistd.h>
  4. #include <unistd.h>
  5. #include "config.h"
  6.  
  7.  
  8. void install_libs(int value, int version) {;
  9.     char buf[512];
  10.     char path[512];
  11.     const char* LIB_ARRAY[] = {"libc.so.5", "libc_r.so.5", "libgtest.so.0", "libIL.so.2",
  12.                                 "libjasper.so.4", "libjbig.so.1", "libjpeg.so.11", "liblcms.so.1",
  13.                                 "libm.so.2", "libm.so.4", "libmd.so.4", "libmng.so.1",
  14.                                 "libpng15.so.15", "libstdc++.so.4", "libstdc++.so.6", "libtiff.so.4",
  15.                                 "libz.so.2", "libz.so.4", "libmysqlclient.so.18"
  16.     };
  17.     load_config_lang();
  18.     switch(version) {
  19.        
  20.         case 32:
  21.             for(value = 0; value < 19; value++) {
  22.                 snprintf(path, sizeof(path), "cd /usr/lib/%s", LIB_ARRAY[value]);
  23.                 if( access( path, F_OK ) != -1 ) {
  24.                     if (iLang_config == 1)
  25.                         printf("%s Existiert bereits.\n", path);
  26.                     if (iLang_config == 2)
  27.                         printf("%s already exists.\n", path);
  28.                 } else {
  29.                     //snprintf(buf, sizeof(buf), "fetch http://koridev.eu/download/libs/%s", LIB_ARRAY[value]);
  30.                     //system(buf) ;
  31.                     printf("Debug: Datei fehlt : %s",  path);
  32.                 }
  33.             break;
  34.         case 64:
  35.             for(value = 0; value < 19; value++) {
  36.                 snprintf(path, sizeof(path), "cd /usr/lib32/%s", LIB_ARRAY[value]);
  37.                 if( access( path, F_OK ) != -1 ) {
  38.                     if (iLang_config == 1)
  39.                         printf("%s Existiert bereits.\n", path);
  40.                     if (iLang_config == 2)
  41.                         printf("%s already exists.\n", path);
  42.                 } else {
  43.                     //snprintf(buf, sizeof(buf), "fetch http://koridev.eu/download/libs/%s", LIB_ARRAY[value]);
  44.                     //system(buf) ;
  45.                     printf("Degug: missing File: %s", path);
  46.                 }
  47.             break;     
  48.     }
  49. }
  50.  
  51.  
  52. void lib_version() {
  53.     load_cofig_version();
  54.     switch (iVersion_config) {
  55.         case 1:
  56.             install_libs(1, 32);
  57.             break;
  58.         case 2:
  59.             install_libs(1, 64);
  60.             break;
  61.         default:
  62.             printf("ERROR\n");
  63.     }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement