Posts tagged ‘source code’

Koleksi Kode Sumber (14) : MINIX (2) – Perintah basename



/* basename - print the last part of a path:    Author: Blaine Garfolo */

#define NULL 0

main(argc,argv)

int argc;
char *argv[];
{
int j,suflen;
char *c;
char *d;
extern char *rindex();

if (argc < 2)     {
std_err("Usage: basename string [suffix]  \n");
exit(1);
}
c=argv[1];
d = rindex(argv[1],'/');
if (d == NULL)
d = argv[1];
else
d++;

if (argc == 2) {       /* if no suffix */
prints("%s \n",d);
exit(0);
} else {            /* if suffix is present */
c = d;
suflen = strlen(argv[2]);
j = strlen(c) - suflen;
if (strcmp(c+j, argv[2]) == 0) *(c+j) = 0;
}
prints("%s \n",c);
}


Iklan

[Dokumentasi Kode Sumber] (3) : Header hijri.h



/************************************************************************
* $Id: hijri.h,v 1.6 2004/07/16 01:16:32 nadim Exp $
*
* ------------
* Description:
* ------------
*  Copyright (c) 2004, Arabeyes, Nadim Shaikli
*
*  A Hijri (Islamic) to/from Gregorian (Christian) date conversion library.
*  This file contains various structures/prototypes to be used within the
*  library itself.  Some of these structs are of interest to the user others
*  shouldn't be.
*
*
* -----------------
* Revision Details:    (Updated by Revision Control System)
* -----------------
*  $Date: 2004/07/16 01:16:32 $
*  $Author: nadim $
*  $Revision: 1.6 $
*  $Source$
*
* (www.arabeyes.org - under LGPL license - see COPYING file)
************************************************************************/

Baca lebih lanjut…

Koleksi Kode Sumber (2) : Kalkulator Waktu Sholat



/************************************************************************
* $Id: prayer.c 2186 2009-03-09 14:19:57Z thamer $
*
* ------------
* Description:
* ------------
*  Copyright (c) 2003-2006, 2009, Arabeyes, Thamer Mahmoud
*
*  A full featured Muslim Prayer Times calculator
*
*
* -----------------
* Revision Details:    (Updated by Revision Control System)
* -----------------
*  $Date: 2009-03-09 17:19:57 +0300 (Mon, 09 Mar 2009) $
*  $Author: thamer $
*  $Revision: 2186 $
*  $Source$
*
* (www.arabeyes.org - under LGPL license - see COPYING file)
************************************************************************/

Baca lebih lanjut…

Koleksi Kode Sumber (1) : Konversi Kalender (Gregorian, Julian, Hijriah)



/************************************************************************
* $Id: umm_alqura.c,v 1.5 2004/07/16 01:16:32 nadim Exp $
*
* ------------
* Description:
* ------------
*  Copyright (c) 2004, Arabeyes, Fayez Alhargan
*
*    This is a program that computes the Hijary dates for Umm-AlQura
*    calendar the official calendar of the Kingdom of Saudi Arabia.
*
*      King Abdulaziz City for Science and Technology
*      Computer and Electronics Research Institute
*      Riyadh, Saudi Arabia
*      alhargan-at-kacst.edu.sa
*      Tel:4813770 Fax:4813764
*
*    Fayez Alhargan version: opn1.2
*    Fayez Alhargan last modified 22-1-2003
*
* -----------------
* Revision Details:    (Updated by Revision Control System)
* -----------------
*  $Date: 2004/07/16 01:16:32 $
*  $Author: nadim $
*  $Revision: 1.5 $
*  $Source$
*
* (www.arabeyes.org - under LGPL license - see COPYING file)
************************************************************************/</pre>

Baca lebih lanjut…

Tanya 23 : dot slash installation


Tanya :

Bagaimana caranya instalasi dari source code

Jawab :

Kita langsung bahas dengan contoh ya.

Misalnya anda ada file bernama filename.tar.gz

Pertama, ekstrak file tersebut

tar -xzf filename.tar.gz

Akan terbentuk folder dengan nama filename

Masuk ke folder tersebut lalu lakukan pra kompilasi

./configure

Setelah selesai, kompilasi dengan perintah

make

Lalu install dengan perintah

make install

Selesai …

Anda juga dapat menentukan target tempat instalasi dengan menambah opsi –prefix=/ pada saat pra kompilasi, menjadi

./configure --prefix=/target/tempat/instalasi

Tanpa –prefix, biasanya program akan terinstall di /usr/local/

OK, selamat mencoba

%d blogger menyukai ini: